diff options
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 94 |
1 files changed, 44 insertions, 50 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index efdcb134d..da6bec7af 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -433,37 +433,37 @@ struct iax2_context { }; -#define IAX_HASCALLERID (uint64_t)(1 << 0) /*!< CallerID has been specified */ -#define IAX_DELME (uint64_t)(1 << 1) /*!< Needs to be deleted */ -#define IAX_TEMPONLY (uint64_t)(1 << 2) /*!< Temporary (realtime) */ -#define IAX_TRUNK (uint64_t)(1 << 3) /*!< Treat as a trunk */ -#define IAX_NOTRANSFER (uint64_t)(1 << 4) /*!< Don't native bridge */ -#define IAX_USEJITTERBUF (uint64_t)(1 << 5) /*!< Use jitter buffer */ -#define IAX_DYNAMIC (uint64_t)(1 << 6) /*!< dynamic peer */ -#define IAX_SENDANI (uint64_t)(1 << 7) /*!< Send ANI along with CallerID */ -#define IAX_RTSAVE_SYSNAME (uint64_t)(1 << 8) /*!< Save Systname on Realtime Updates */ -#define IAX_ALREADYGONE (uint64_t)(1 << 9) /*!< Already disconnected */ -#define IAX_PROVISION (uint64_t)(1 << 10) /*!< This is a provisioning request */ -#define IAX_QUELCH (uint64_t)(1 << 11) /*!< Whether or not we quelch audio */ -#define IAX_ENCRYPTED (uint64_t)(1 << 12) /*!< Whether we should assume encrypted tx/rx */ -#define IAX_KEYPOPULATED (uint64_t)(1 << 13) /*!< Whether we have a key populated */ -#define IAX_CODEC_USER_FIRST (uint64_t)(1 << 14) /*!< are we willing to let the other guy choose the codec? */ -#define IAX_CODEC_NOPREFS (uint64_t)(1 << 15) /*!< Force old behaviour by turning off prefs */ -#define IAX_CODEC_NOCAP (uint64_t)(1 << 16) /*!< only consider requested format and ignore capabilities*/ -#define IAX_RTCACHEFRIENDS (uint64_t)(1 << 17) /*!< let realtime stay till your reload */ -#define IAX_RTUPDATE (uint64_t)(1 << 18) /*!< Send a realtime update */ -#define IAX_RTAUTOCLEAR (uint64_t)(1 << 19) /*!< erase me on expire */ -#define IAX_RTIGNOREREGEXPIRE (uint64_t)(1 << 21) /*!< When using realtime, ignore registration expiration */ -#define IAX_TRUNKTIMESTAMPS (uint64_t)(1 << 22) /*!< Send trunk timestamps */ -#define IAX_TRANSFERMEDIA (uint64_t)(1 << 23) /*!< When doing IAX2 transfers, transfer media only */ -#define IAX_MAXAUTHREQ (uint64_t)(1 << 24) /*!< Maximum outstanding AUTHREQ restriction is in place */ -#define IAX_DELAYPBXSTART (uint64_t)(1 << 25) /*!< Don't start a PBX on the channel until the peer sends us a response, so that we've achieved a three-way handshake with them before sending voice or anything else */ -#define IAX_ALLOWFWDOWNLOAD (uint64_t)(1 << 26) /*!< Allow the FWDOWNL command? */ -#define IAX_IMMEDIATE (uint64_t)(1 << 27) /*!< Allow immediate off-hook to extension s */ -#define IAX_SENDCONNECTEDLINE (uint64_t)(1 << 28) /*!< Allow sending of connected line updates */ -#define IAX_RECVCONNECTEDLINE (uint64_t)(1 << 29) /*!< Allow receiving of connected line updates */ -#define IAX_FORCE_ENCRYPT (uint64_t)(1 << 30) /*!< Forces call encryption, if encryption not possible hangup */ -#define IAX_SHRINKCALLERID (uint64_t)(1 << 31) /*!< Turn on and off caller id shrinking */ +#define IAX_HASCALLERID (uint64_t)(1LLU << 0) /*!< CallerID has been specified */ +#define IAX_DELME (uint64_t)(1LLU << 1) /*!< Needs to be deleted */ +#define IAX_TEMPONLY (uint64_t)(1LLU << 2) /*!< Temporary (realtime) */ +#define IAX_TRUNK (uint64_t)(1LLU << 3) /*!< Treat as a trunk */ +#define IAX_NOTRANSFER (uint64_t)(1LLU << 4) /*!< Don't native bridge */ +#define IAX_USEJITTERBUF (uint64_t)(1LLU << 5) /*!< Use jitter buffer */ +#define IAX_DYNAMIC (uint64_t)(1LLU << 6) /*!< dynamic peer */ +#define IAX_SENDANI (uint64_t)(1LLU << 7) /*!< Send ANI along with CallerID */ +#define IAX_RTSAVE_SYSNAME (uint64_t)(1LLU << 8) /*!< Save Systname on Realtime Updates */ +#define IAX_ALREADYGONE (uint64_t)(1LLU << 9) /*!< Already disconnected */ +#define IAX_PROVISION (uint64_t)(1LLU << 10) /*!< This is a provisioning request */ +#define IAX_QUELCH (uint64_t)(1LLU << 11) /*!< Whether or not we quelch audio */ +#define IAX_ENCRYPTED (uint64_t)(1LLU << 12) /*!< Whether we should assume encrypted tx/rx */ +#define IAX_KEYPOPULATED (uint64_t)(1LLU << 13) /*!< Whether we have a key populated */ +#define IAX_CODEC_USER_FIRST (uint64_t)(1LLU << 14) /*!< are we willing to let the other guy choose the codec? */ +#define IAX_CODEC_NOPREFS (uint64_t)(1LLU << 15) /*!< Force old behaviour by turning off prefs */ +#define IAX_CODEC_NOCAP (uint64_t)(1LLU << 16) /*!< only consider requested format and ignore capabilities*/ +#define IAX_RTCACHEFRIENDS (uint64_t)(1LLU << 17) /*!< let realtime stay till your reload */ +#define IAX_RTUPDATE (uint64_t)(1LLU << 18) /*!< Send a realtime update */ +#define IAX_RTAUTOCLEAR (uint64_t)(1LLU << 19) /*!< erase me on expire */ +#define IAX_RTIGNOREREGEXPIRE (uint64_t)(1LLU << 21) /*!< When using realtime, ignore registration expiration */ +#define IAX_TRUNKTIMESTAMPS (uint64_t)(1LLU << 22) /*!< Send trunk timestamps */ +#define IAX_TRANSFERMEDIA (uint64_t)(1LLU << 23) /*!< When doing IAX2 transfers, transfer media only */ +#define IAX_MAXAUTHREQ (uint64_t)(1LLU << 24) /*!< Maximum outstanding AUTHREQ restriction is in place */ +#define IAX_DELAYPBXSTART (uint64_t)(1LLU << 25) /*!< Don't start a PBX on the channel until the peer sends us a response, so that we've achieved a three-way handshake with them before sending voice or anything else */ +#define IAX_ALLOWFWDOWNLOAD (uint64_t)(1LLU << 26) /*!< Allow the FWDOWNL command? */ +#define IAX_IMMEDIATE (uint64_t)(1LLU << 27) /*!< Allow immediate off-hook to extension s */ +#define IAX_SENDCONNECTEDLINE (uint64_t)(1LLU << 28) /*!< Allow sending of connected line updates */ +#define IAX_RECVCONNECTEDLINE (uint64_t)(1LLU << 29) /*!< Allow receiving of connected line updates */ +#define IAX_FORCE_ENCRYPT (uint64_t)(1LLU << 30) /*!< Forces call encryption, if encryption not possible hangup */ +#define IAX_SHRINKCALLERID (uint64_t)(1LLU << 31) /*!< Turn on and off caller id shrinking */ static int global_rtautoclear = 120; static int reload_config(int forced_reload); @@ -1430,13 +1430,6 @@ static int iax2_is_control_frame_allowed(int subtype) return is_allowed; } -static void mwi_event_cb(void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) -{ - /* The MWI subscriptions exist just so the core knows we care about those - * mailboxes. However, we just grab the events out of the cache when it - * is time to send MWI, since it is only sent with a REGACK. */ -} - static void network_change_stasis_subscribe(void) { if (!network_change_sub) { @@ -13051,7 +13044,10 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st mailbox_specific_topic = ast_mwi_topic(peer->mailbox); if (mailbox_specific_topic) { - peer->mwi_event_sub = stasis_subscribe_pool(mailbox_specific_topic, mwi_event_cb, NULL); + /* The MWI subscriptions exist just so the core knows we care about those + * mailboxes. However, we just grab the events out of the cache when it + * is time to send MWI, since it is only sent with a REGACK. */ + peer->mwi_event_sub = stasis_subscribe_pool(mailbox_specific_topic, stasis_subscription_cb_noop, NULL); } } @@ -13787,6 +13783,7 @@ static int set_config(const char *config_file, int reload, int forced) } else if (!strcasecmp(v->name, "calltokenoptional")) { if (add_calltoken_ignore(v->value)) { ast_log(LOG_WARNING, "Invalid calltokenoptional address range - '%s' line %d\n", v->value, v->lineno); + return -1; } } else if (!strcasecmp(v->name, "calltokenexpiration")) { int temp = -1; @@ -14670,7 +14667,6 @@ static void cleanup_thread_list(void *head) static int __unload_module(void) { - struct ast_context *con; int x; network_change_stasis_unsubscribe(); @@ -14747,9 +14743,7 @@ static int __unload_module(void) sched = NULL; ao2_ref(peercnts, -1); - con = ast_context_find(regcontext); - if (con) - ast_context_destroy(con, "IAX2"); + ast_context_destroy_by_name(regcontext, "IAX2"); ast_unload_realtime("iaxpeers"); ao2_ref(iax2_tech.capabilities, -1); @@ -15190,10 +15184,10 @@ static int load_module(void) } AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Inter Asterisk eXchange (Ver 2)", - .support_level = AST_MODULE_SUPPORT_CORE, - .load = load_module, - .unload = unload_module, - .reload = reload, - .load_pri = AST_MODPRI_CHANNEL_DRIVER, - .nonoptreq = "res_crypto", - ); + .support_level = AST_MODULE_SUPPORT_CORE, + .load = load_module, + .unload = unload_module, + .reload = reload, + .load_pri = AST_MODPRI_CHANNEL_DRIVER, + .nonoptreq = "res_crypto", +); |