From 977319c83c14dcc9c705cba1548bfab94fe2b03c Mon Sep 17 00:00:00 2001 From: Redmer Loen Date: Tue, 6 Mar 2018 07:42:45 +0100 Subject: [PATCH 1/3] Updated to pjsip 2.7.2 (#24) --- Pod/VialerPJSIP.a | 4 +- Pod/vialer-pjsip-include/pj/compat/assert.h | 9 +- .../pj/compat/high_precision.h | 17 ++- Pod/vialer-pjsip-include/pj/compat/os_auto.h | 5 +- .../pj/compat/os_auto.h.in | 5 +- Pod/vialer-pjsip-include/pj/compat/rand.h | 16 ++- Pod/vialer-pjsip-include/pj/compat/setjmp.h | 50 +++++++- Pod/vialer-pjsip-include/pj/compat/socket.h | 30 ++++- Pod/vialer-pjsip-include/pj/config.h | 50 ++------ .../pj/config_site_sample.h | 3 - Pod/vialer-pjsip-include/pj/sock.h | 4 +- Pod/vialer-pjsip-include/pj/ssl_sock.h | 7 +- Pod/vialer-pjsip-include/pjlib-util/cli.h | 4 +- Pod/vialer-pjsip-include/pjlib-util/scanner.h | 14 ++- Pod/vialer-pjsip-include/pjlib-util/xml.h | 9 +- Pod/vialer-pjsip-include/pjmedia/config.h | 12 +- Pod/vialer-pjsip-include/pjmedia/sdp.h | 9 +- .../pjsip-simple/iscomposing.h | 9 +- Pod/vialer-pjsip-include/pjsip-simple/xpidf.h | 9 +- Pod/vialer-pjsip-include/pjsip/sip_config.h | 37 +++--- Pod/vialer-pjsip-include/pjsip/sip_parser.h | 24 +--- Pod/vialer-pjsip-include/pjsua-lib/pjsua.h | 110 +----------------- Pod/vialer-pjsip-include/pjsua2/endpoint.hpp | 13 +-- Pod/vialer-pjsip-include/pjsua2/media.hpp | 53 +-------- .../Versions/A/Headers/pj/compat/assert.h | 9 +- .../A/Headers/pj/compat/high_precision.h | 17 ++- .../Versions/A/Headers/pj/compat/os_auto.h | 5 +- .../Versions/A/Headers/pj/compat/os_auto.h.in | 5 +- .../Versions/A/Headers/pj/compat/rand.h | 16 ++- .../Versions/A/Headers/pj/compat/setjmp.h | 50 +++++++- .../Versions/A/Headers/pj/compat/socket.h | 30 ++++- .../Versions/A/Headers/pj/config.h | 50 ++------ .../A/Headers/pj/config_site_sample.h | 3 - .../Versions/A/Headers/pj/sock.h | 4 +- .../Versions/A/Headers/pj/ssl_sock.h | 7 +- .../Versions/A/Headers/pjlib-util/cli.h | 4 +- .../Versions/A/Headers/pjlib-util/scanner.h | 14 ++- .../Versions/A/Headers/pjlib-util/xml.h | 9 +- .../Versions/A/Headers/pjmedia/config.h | 12 +- .../Versions/A/Headers/pjmedia/sdp.h | 9 +- .../A/Headers/pjsip-simple/iscomposing.h | 9 +- .../Versions/A/Headers/pjsip-simple/xpidf.h | 9 +- .../Versions/A/Headers/pjsip/sip_config.h | 37 +++--- .../Versions/A/Headers/pjsip/sip_parser.h | 24 +--- .../Versions/A/Headers/pjsua-lib/pjsua.h | 110 +----------------- .../Versions/A/Headers/pjsua2/endpoint.hpp | 13 +-- .../Versions/A/Headers/pjsua2/media.hpp | 53 +-------- VialerPJSIP.framework/Versions/A/VialerPJSIP | 4 +- vialerbuild | 6 +- 49 files changed, 370 insertions(+), 642 deletions(-) diff --git a/Pod/VialerPJSIP.a b/Pod/VialerPJSIP.a index 39ba5254..1e0b7e4d 100644 --- a/Pod/VialerPJSIP.a +++ b/Pod/VialerPJSIP.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:48a736cca25f7148e4752604da5655c00e690d7c16ce0074316be9e10d99270f -size 138629072 +oid sha256:f6febad72767333887d23ae4203059b0de1c8483ea8726dd4257a4d151412383 +size 190652176 diff --git a/Pod/vialer-pjsip-include/pj/compat/assert.h b/Pod/vialer-pjsip-include/pj/compat/assert.h index fd5394f1..f1b5c965 100644 --- a/Pod/vialer-pjsip-include/pj/compat/assert.h +++ b/Pod/vialer-pjsip-include/pj/compat/assert.h @@ -1,4 +1,4 @@ -/* $Id: assert.h 5692 2017-11-13 06:06:25Z ming $ */ +/* $Id: assert.h 3553 2011-05-05 06:14:19Z nanang $ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono @@ -28,6 +28,13 @@ #if defined(PJ_HAS_ASSERT_H) && PJ_HAS_ASSERT_H != 0 # include +#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0 +# define assert(expr) do { \ + if (!(expr)) \ + printk("!!ASSERTION FAILED: [%s:%d] \"" #expr "\"\n",\ + __FILE__, __LINE__); \ + } while (0) + #else # warning "assert() is not implemented" # define assert(expr) diff --git a/Pod/vialer-pjsip-include/pj/compat/high_precision.h b/Pod/vialer-pjsip-include/pj/compat/high_precision.h index cf997727..277389f6 100644 --- a/Pod/vialer-pjsip-include/pj/compat/high_precision.h +++ b/Pod/vialer-pjsip-include/pj/compat/high_precision.h @@ -1,4 +1,4 @@ -/* $Id: high_precision.h 5692 2017-11-13 06:06:25Z ming $ */ +/* $Id: high_precision.h 3553 2011-05-05 06:14:19Z nanang $ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono @@ -31,6 +31,21 @@ # define PJ_HIGHPREC_VALUE_IS_ZERO(a) (a==0) # define pj_highprec_mod(a,b) (a=fmod(a,b)) +#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0 + +# include + + typedef pj_int64_t pj_highprec_t; + +# define pj_highprec_div(a1,a2) do_div(a1,a2) +# define pj_highprec_mod(a1,a2) (a1=do_mod(a1, a2)) + + PJ_INLINE(pj_int64_t) do_mod( pj_int64_t a1, pj_int64_t a2) + { + return do_div(a1,a2); + } + + #elif defined(PJ_HAS_INT64) && PJ_HAS_INT64 != 0 /* * Next choice is to use 64-bit arithmatics. diff --git a/Pod/vialer-pjsip-include/pj/compat/os_auto.h b/Pod/vialer-pjsip-include/pj/compat/os_auto.h index 092c620f..7c66d361 100644 --- a/Pod/vialer-pjsip-include/pj/compat/os_auto.h +++ b/Pod/vialer-pjsip-include/pj/compat/os_auto.h @@ -1,5 +1,5 @@ /* pjlib/include/pj/compat/os_auto.h. Generated from os_auto.h.in by configure. */ -/* $Id: os_auto.h.in 5725 2018-01-15 08:52:29Z ming $ */ +/* $Id: os_auto.h.in 5543 2017-01-24 05:36:50Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono @@ -220,9 +220,6 @@ #ifndef PJ_HAS_SSL_SOCK #define PJ_HAS_SSL_SOCK 1 #endif -#ifndef PJ_SSL_SOCK_IMP -# define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_OPENSSL -#endif #endif /* __PJ_COMPAT_OS_AUTO_H__ */ diff --git a/Pod/vialer-pjsip-include/pj/compat/os_auto.h.in b/Pod/vialer-pjsip-include/pj/compat/os_auto.h.in index 6c4f4cb6..311888d7 100644 --- a/Pod/vialer-pjsip-include/pj/compat/os_auto.h.in +++ b/Pod/vialer-pjsip-include/pj/compat/os_auto.h.in @@ -1,4 +1,4 @@ -/* $Id: os_auto.h.in 5725 2018-01-15 08:52:29Z ming $ */ +/* $Id: os_auto.h.in 5543 2017-01-24 05:36:50Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono @@ -219,9 +219,6 @@ #ifndef PJ_HAS_SSL_SOCK #undef PJ_HAS_SSL_SOCK #endif -#ifndef PJ_SSL_SOCK_IMP -# define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_NONE -#endif #endif /* __PJ_COMPAT_OS_AUTO_H__ */ diff --git a/Pod/vialer-pjsip-include/pj/compat/rand.h b/Pod/vialer-pjsip-include/pj/compat/rand.h index 115705a2..32467eed 100644 --- a/Pod/vialer-pjsip-include/pj/compat/rand.h +++ b/Pod/vialer-pjsip-include/pj/compat/rand.h @@ -1,4 +1,4 @@ -/* $Id: rand.h 5692 2017-11-13 06:06:25Z ming $ */ +/* $Id: rand.h 3553 2011-05-05 06:14:19Z nanang $ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono @@ -44,6 +44,20 @@ # define platform_rand rand # endif +#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0 + /* + * Linux kernel mode random number generator. + */ +# include +# define platform_srand(seed) + + PJ_INLINE(int) platform_rand(void) + { + int value; + get_random_bytes((void*)&value, sizeof(value)); + return value; + } + #else # warning "platform_rand() is not implemented" # define platform_rand() 1 diff --git a/Pod/vialer-pjsip-include/pj/compat/setjmp.h b/Pod/vialer-pjsip-include/pj/compat/setjmp.h index 1cd41eb8..0aea2184 100644 --- a/Pod/vialer-pjsip-include/pj/compat/setjmp.h +++ b/Pod/vialer-pjsip-include/pj/compat/setjmp.h @@ -1,4 +1,4 @@ -/* $Id: setjmp.h 5692 2017-11-13 06:06:25Z ming $ */ +/* $Id: setjmp.h 3553 2011-05-05 06:14:19Z nanang $ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono @@ -35,6 +35,54 @@ # define pj_longjmp(buf,d) longjmp(buf,d) # endif +#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0 && \ + defined(PJ_M_I386) && PJ_M_I386 != 0 + + /* + * These are taken from uClibc. + * Copyright (C) 2000-2003 Erik Andersen + */ +# if defined __USE_MISC || defined _ASM +# define JB_BX 0 +# define JB_SI 1 +# define JB_DI 2 +# define JB_BP 3 +# define JB_SP 4 +# define JB_PC 5 +# define JB_SIZE 24 +# endif + +# ifndef _ASM + typedef int __jmp_buf[6]; + + /* A `sigset_t' has a bit for each signal. */ +# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) + typedef struct __sigset_t_tag + { + unsigned long int __val[_SIGSET_NWORDS]; + } __sigset_t; + + /* Calling environment, plus possibly a saved signal mask. */ + typedef struct __jmp_buf_tag /* C++ doesn't like tagless structs. */ + { + /* NOTE: The machine-dependent definitions of `__sigsetjmp' + assume that a `jmp_buf' begins with a `__jmp_buf' and that + `__mask_was_saved' follows it. Do not move these members + or add others before it. */ + __jmp_buf __jmpbuf; /* Calling environment. */ + int __mask_was_saved; /* Saved the signal mask? */ + // we never saved the mask. + __sigset_t __saved_mask; /* Saved signal mask. */ + } jmp_buf[1]; + + typedef jmp_buf sigjmp_buf; + typedef jmp_buf pj_jmp_buf; + + PJ_DECL(int) pj_setjmp(pj_jmp_buf env); + PJ_DECL(void) pj_longjmp(pj_jmp_buf env, int val) __attribute__((noreturn)); + +# endif /* _ASM */ + #elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 /* Symbian framework don't use setjmp/longjmp */ diff --git a/Pod/vialer-pjsip-include/pj/compat/socket.h b/Pod/vialer-pjsip-include/pj/compat/socket.h index dc8d1877..c7b45319 100644 --- a/Pod/vialer-pjsip-include/pj/compat/socket.h +++ b/Pod/vialer-pjsip-include/pj/compat/socket.h @@ -1,4 +1,4 @@ -/* $Id: socket.h 5692 2017-11-13 06:06:25Z ming $ */ +/* $Id: socket.h 5445 2016-10-05 09:52:39Z riza $ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono @@ -184,6 +184,34 @@ #undef s6_addr #undef sin_zero +/* + * Linux kernel specifics + */ +#if defined(PJ_LINUX_KERNEL) +# include +# include /* FIONBIO */ +# include /* sys_select() */ +# include /* set/get_fs() */ + + typedef int socklen_t; +# define getsockopt sys_getsockopt + + /* + * Wrapper for select() in Linux kernel. + */ + PJ_INLINE(int) select(int n, fd_set *inp, fd_set *outp, fd_set *exp, + struct timeval *tvp) + { + int count; + mm_segment_t oldfs = get_fs(); + set_fs(KERNEL_DS); + count = sys_select(n, inp, outp, exp, tvp); + set_fs(oldfs); + return count; + } +#endif /* PJ_LINUX_KERNEL */ + + /* * This will finally be obsoleted, since it should be declared in * os_auto.h diff --git a/Pod/vialer-pjsip-include/pj/config.h b/Pod/vialer-pjsip-include/pj/config.h index 29f886e6..08b03cfd 100644 --- a/Pod/vialer-pjsip-include/pj/config.h +++ b/Pod/vialer-pjsip-include/pj/config.h @@ -1,4 +1,4 @@ -/* $Id: config.h 5725 2018-01-15 08:52:29Z ming $ */ +/* $Id: config.h 5744 2018-02-21 02:58:39Z ming $ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono @@ -115,6 +115,12 @@ # define PJ_WIN32 1 # include +#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0 + /* + * Linux kernel + */ +# include + #elif defined(PJ_LINUX) || defined(linux) || defined(__linux) /* * Linux @@ -912,9 +918,8 @@ /** * Enable secure socket. For most platforms, this is implemented using - * OpenSSL or GnuTLS, so this will require one of those libraries to - * be installed. For Symbian platform, this is implemented natively - * using CSecureSocket. + * OpenSSL, so this will require OpenSSL to be installed. For Symbian + * platform, this is implemented natively using CSecureSocket. * * Default: 0 (for now) */ @@ -923,28 +928,6 @@ #endif -/* - * Secure socket implementation. - * Select one of these implementations in PJ_SSL_SOCK_IMP. - */ -#define PJ_SSL_SOCK_IMP_NONE 0 /**< Disable SSL socket. */ -#define PJ_SSL_SOCK_IMP_OPENSSL 1 /**< Using OpenSSL. */ -#define PJ_SSL_SOCK_IMP_GNUTLS 2 /**< Using GnuTLS. */ - - -/** - * Select which SSL socket implementation to use. Currently pjlib supports - * PJ_SSL_SOCK_IMP_OPENSSL, which uses OpenSSL, and PJ_SSL_SOCK_IMP_GNUTLS, - * which uses GnuTLS. Setting this to PJ_SSL_SOCK_IMP_NONE will disable - * secure socket. - * - * Default is PJ_SSL_SOCK_IMP_NONE - */ -#ifndef PJ_SSL_SOCK_IMP -# define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_NONE -#endif - - /** * Define the maximum number of ciphers supported by the secure socket. * @@ -988,17 +971,6 @@ #endif -/** - * Maximum number of socket options in pj_sockopt_params. - * - * Default: 4 - */ -#ifndef PJ_MAX_SOCKOPT_PARAMS -# define PJ_MAX_SOCKOPT_PARAMS 4 -#endif - - - /** @} */ /******************************************************************** @@ -1321,13 +1293,13 @@ PJ_BEGIN_DECL #define PJ_VERSION_NUM_MINOR 7 /** PJLIB version revision number. */ -#define PJ_VERSION_NUM_REV 1 +#define PJ_VERSION_NUM_REV 2 /** * Extra suffix for the version (e.g. "-trunk"), or empty for * web release version. */ -#define PJ_VERSION_NUM_EXTRA "-svn" +#define PJ_VERSION_NUM_EXTRA "" /** * PJLIB version number consists of three bytes with the following format: diff --git a/Pod/vialer-pjsip-include/pj/config_site_sample.h b/Pod/vialer-pjsip-include/pj/config_site_sample.h index 57fe3d45..31bfd6e1 100644 --- a/Pod/vialer-pjsip-include/pj/config_site_sample.h +++ b/Pod/vialer-pjsip-include/pj/config_site_sample.h @@ -411,9 +411,6 @@ #define PJSIP_MAX_DIALOG_COUNT 31 #define PJSUA_MAX_CALLS 4 - /* Separate worker thread for timer and ioqueue */ - // #define PJSUA_SEPARATE_WORKER_FOR_TIMER 1 - /* Other pjsua settings */ #define PJSUA_MAX_ACC 4 #define PJSUA_MAX_PLAYERS 4 diff --git a/Pod/vialer-pjsip-include/pj/sock.h b/Pod/vialer-pjsip-include/pj/sock.h index fc72c540..19e25d33 100644 --- a/Pod/vialer-pjsip-include/pj/sock.h +++ b/Pod/vialer-pjsip-include/pj/sock.h @@ -1,4 +1,4 @@ -/* $Id: sock.h 5719 2018-01-05 09:48:31Z nanang $ */ +/* $Id: sock.h 5636 2017-08-02 02:51:59Z ming $ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono @@ -629,6 +629,8 @@ typedef struct pj_ip_mreq { pj_in_addr imr_interface; /**< local IP address of interface. */ } pj_ip_mreq; +/* Maximum number of socket options. */ +#define PJ_MAX_SOCKOPT_PARAMS 4 /** * Options to be set for the socket. diff --git a/Pod/vialer-pjsip-include/pj/ssl_sock.h b/Pod/vialer-pjsip-include/pj/ssl_sock.h index a7da3ebb..ebab8e78 100644 --- a/Pod/vialer-pjsip-include/pj/ssl_sock.h +++ b/Pod/vialer-pjsip-include/pj/ssl_sock.h @@ -1,4 +1,4 @@ -/* $Id: ssl_sock.h 5725 2018-01-15 08:52:29Z ming $ */ +/* $Id: ssl_sock.h 5472 2016-10-27 07:58:01Z ming $ */ /* * Copyright (C) 2009-2011 Teluu Inc. (http://www.teluu.com) * @@ -184,11 +184,6 @@ typedef struct pj_ssl_cert_info { pj_str_t raw; /**< Raw certificate in PEM format, only available for remote certificate. */ - struct { - unsigned cnt; /**< # of entry */ - pj_str_t *cert_raw; - } raw_chain; - } pj_ssl_cert_info; diff --git a/Pod/vialer-pjsip-include/pjlib-util/cli.h b/Pod/vialer-pjsip-include/pjlib-util/cli.h index 267afe65..a91fb3de 100644 --- a/Pod/vialer-pjsip-include/pjlib-util/cli.h +++ b/Pod/vialer-pjsip-include/pjlib-util/cli.h @@ -400,14 +400,12 @@ PJ_DECL(void) pj_cli_register_front_end(pj_cli_t *cli, * Create a new complete command specification from an XML node text and * register it to the CLI application. * - * Note that the input string MUST be NULL terminated. - * * @param cli The CLI application. * @param group Optional group to which this command will be added * to, or specify NULL if this command is a root * command. * @param xml Input string containing XML node text for the - * command, MUST be NULL terminated. + * command. * @param handler Function handler for the command. This must be NULL * if the command specifies a command group. * @param p_cmd Optional pointer to store the newly created diff --git a/Pod/vialer-pjsip-include/pjlib-util/scanner.h b/Pod/vialer-pjsip-include/pjlib-util/scanner.h index 99acce85..f47a8f03 100644 --- a/Pod/vialer-pjsip-include/pjlib-util/scanner.h +++ b/Pod/vialer-pjsip-include/pjlib-util/scanner.h @@ -1,4 +1,4 @@ -/* $Id: scanner.h 5693 2017-11-14 08:20:15Z ming $ */ +/* $Id: scanner.h 4537 2013-06-19 06:47:43Z riza $ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono @@ -216,14 +216,16 @@ typedef struct pj_scan_state /** - * Initialize the scanner. - * Note that the input string buffer MUST be NULL terminated and have - * length at least buflen+1 (buflen MUST NOT include the NULL terminator). + * Initialize the scanner. Note that the input string buffer must have + * length at least buflen+1 because the scanner will NULL terminate the + * string during initialization. * * @param scanner The scanner to be initialized. - * @param bufstart The input buffer to scan, which must be NULL terminated. + * @param bufstart The input buffer to scan. Note that buffer[buflen] will be + * filled with NULL char until scanner is destroyed, so + * the actual buffer length must be at least buflen+1. * @param buflen The length of the input buffer, which normally is - * strlen(bufstart), hence not counting the NULL terminator. + * strlen(bufstart). * @param options Zero, or combination of PJ_SCAN_AUTOSKIP_WS or * PJ_SCAN_AUTOSKIP_WS_HEADER * @param callback Callback to be called when the scanner encounters syntax diff --git a/Pod/vialer-pjsip-include/pjlib-util/xml.h b/Pod/vialer-pjsip-include/pjlib-util/xml.h index 17355325..81dc6c75 100644 --- a/Pod/vialer-pjsip-include/pjlib-util/xml.h +++ b/Pod/vialer-pjsip-include/pjlib-util/xml.h @@ -1,4 +1,4 @@ -/* $Id: xml.h 5697 2017-11-17 04:07:43Z ming $ */ +/* $Id: xml.h 3553 2011-05-05 06:14:19Z nanang $ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono @@ -73,12 +73,9 @@ struct pj_xml_node * XML comments ("