Skip to content
Snippets Groups Projects
Select Git revision
  • 835c77ccfa56815b51fc3daded4f7fd39f5e5cca
  • devel default
  • lk_update_ringback
  • wenpeng-0917
  • asterisk_rdkb
  • fix_crash_at_transport
  • lk_debug_dialogs
  • lk_forking_revert
  • wenpeng-jul8
  • gyang-devel
  • gyang-devel1
  • wenpeng-jul9
  • asterisk_rdkb_ipv6
  • 16916_rdkb_merge
  • lk_disable_registrar
  • wenpeng-100rel-ippbx
  • fix_multiple_dns_lookup
  • dev_fxs_no_wb
  • fix_fallback
  • 14666_fxs_no_wideband_codec
  • fix_srv_records
  • fix_deadlock_in_bridge_peer_functions
  • 22.0.0-pre1
  • 21.4.2
  • 20.9.2
  • 18.24.2
  • certified-20.7-cert2
  • certified-18.9-cert11
  • 21.4.1
  • 20.9.1
  • 18.24.1
  • 21.4.0
  • 20.9.0
  • 18.24.0
  • certified-20.7-cert1
  • certified-18.9-cert10
  • 21.4.0-rc1
  • 20.9.0-rc1
  • 18.24.0-rc1
  • 21.3.1
  • 20.8.1
  • 18.23.1
42 results

pbx_ael.c

Blame
  • smsq.c 24.59 KiB
    /*
     * Asterisk -- An open source telephony toolkit.
     *
     * Copyright (C) 2004 - 2005
     *
     * SMS queuing application for use with asterisk app_sms
     * by Adrian Kennard
     *
     * See http://www.asterisk.org for more information about
     * the Asterisk project. Please do not directly contact
     * any of the maintainers of this project for assistance;
     * the project provides a web site, mailing lists and IRC
     * channels for your use.
     *
     * This program is free software, distributed under the terms of
     * the GNU General Public License Version 2. See the LICENSE file
     * at the top of the source tree.
     */
    
    /*** MODULEINFO
    	<support_level>extended</support_level>
     ***/
    
    #include "asterisk.h"
    
    #include <popt.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <dirent.h>
    #include <ctype.h>
    #include <time.h>
    
    #if !defined(POPT_ARGFLAG_SHOW_DEFAULT)
    #define     POPT_ARGFLAG_SHOW_DEFAULT 0x00800000
    #endif
    
    
    /*!
     * \brief reads next USC character from null terminated UTF-8 string and advanced pointer
     * for non valid UTF-8 sequences.
     * \return character as is Does \b NOT advance pointer for null termination
    */
    static int utf8decode (unsigned char **pp)
    {
       unsigned char *p = *pp;
       if (!*p)
          return 0;                 /* null termination of string */
       (*pp)++;
       if (*p < 0xC0)
          return *p;                /* ascii or continuation character */
       if (*p < 0xE0)
       {
          if (*p < 0xC2 || (p[1] & 0xC0) != 0x80)
             return *p;             /* not valid UTF-8 */
          (*pp)++;
          return ((*p & 0x1F) << 6) + (p[1] & 0x3F);
       }
       if (*p < 0xF0)
       {
          if ((*p == 0xE0 && p[1] < 0xA0) || (p[1] & 0xC0) != 0x80 || (p[2] & 0xC0) != 0x80)
             return *p;             /* not valid UTF-8 */
          (*pp) += 2;
          return ((*p & 0x0F) << 12) + ((p[1] & 0x3F) << 6) + (p[2] & 0x3F);
       }
       if (*p < 0xF8)
       {
          if ((*p == 0xF0 && p[1] < 0x90) || (p[1] & 0xC0) != 0x80 || (p[2] & 0xC0) != 0x80 || (p[3] & 0xC0) != 0x80)
             return *p;             /* not valid UTF-8 */
          (*pp) += 3;
          return ((*p & 0x07) << 18) + ((p[1] & 0x3F) << 12) + ((p[2] & 0x3F) << 6) + (p[3] & 0x3F);