diff --git a/CHANGES b/CHANGES index bd1a7a794f1cf78043c55643c6852b55b2186372..5bfdc5411c417f437849e1cc8314fe5c8b5937c5 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,17 @@ === ============================================================================== +------------------------------------------------------------------------------ +--- Functionality changes from Asterisk 16 to Asterisk 17 -------------------- +------------------------------------------------------------------------------ + +chan_sip +------------------ + * The chan_sip module is now deprecated, users should migrate to the + replacement module chan_pjsip. See guides at the Asterisk Wiki: + https://wiki.asterisk.org/wiki/x/tAHOAQ + https://wiki.asterisk.org/wiki/x/hYCLAQ + ------------------------------------------------------------------------------ --- Functionality changes from Asterisk 16.0.0 to Asterisk 16.1.0 ------------ ------------------------------------------------------------------------------ diff --git a/UPGRADE.txt b/UPGRADE.txt index 7506af2e2fa68545462a3e78ce3dfd6ff4721713..3cf8e2784f981cc665a3254d7d93e2621620623b 100644 --- a/UPGRADE.txt +++ b/UPGRADE.txt @@ -27,6 +27,12 @@ New in 17.0.0: +chan_sip: + - The chan_sip module is now deprecated, users should migrate to the + replacement module chan_pjsip. See guides at the Asterisk Wiki: + https://wiki.asterisk.org/wiki/x/tAHOAQ + https://wiki.asterisk.org/wiki/x/hYCLAQ + func_callerid: - The CALLERPRES() dialplan function, deprecated in Asterisk 1.8, has been removed. diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 5097d468605628df9fbd56b2f850f43a99a939d4..3aae905bf8a86d2028ef91186c682ecded2fc957 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -176,7 +176,7 @@ /*** MODULEINFO <use type="module">res_crypto</use> <use type="module">res_http_websocket</use> - <support_level>extended</support_level> + <support_level>deprecated</support_level> ***/ /*! \page sip_session_timers SIP Session Timers in Asterisk Chan_sip @@ -35321,6 +35321,37 @@ static const struct ast_sip_api_tech chan_sip_api_provider = { .sipinfo_send = sipinfo_send, }; +static void deprecation_notice(void) +{ + ast_log(LOG_WARNING, "chan_sip has no official maintainer and is deprecated. Migration to\n"); + ast_log(LOG_WARNING, "chan_pjsip is recommended. See guides at the Asterisk Wiki:\n"); + ast_log(LOG_WARNING, "https://wiki.asterisk.org/wiki/x/tAHOAQ\n"); + ast_log(LOG_WARNING, "https://wiki.asterisk.org/wiki/x/hYCLAQ\n"); +} + +/*! \brief Event callback which indicates we're fully booted */ +static void startup_event_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message) +{ + struct ast_json_payload *payload; + const char *type; + + if (stasis_message_type(message) != ast_manager_get_generic_type()) { + return; + } + + payload = stasis_message_data(message); + type = ast_json_string_get(ast_json_object_get(payload->json, "type")); + + if (strcmp(type, "FullyBooted")) { + return; + } + + deprecation_notice(); + + stasis_unsubscribe(sub); +} + + static int unload_module(void); /*! @@ -35534,6 +35565,12 @@ static int load_module(void) ast_websocket_add_protocol("sip", sip_websocket_callback); } + if (ast_fully_booted) { + deprecation_notice(); + } else { + stasis_subscribe_pool(ast_manager_get_topic(), startup_event_cb, NULL); + } + return AST_MODULE_LOAD_SUCCESS; } @@ -35751,7 +35788,7 @@ static int unload_module(void) } AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Session Initiation Protocol (SIP)", - .support_level = AST_MODULE_SUPPORT_CORE, + .support_level = AST_MODULE_SUPPORT_DEPRECATED, .load = load_module, .unload = unload_module, .reload = reload, diff --git a/channels/sip/config_parser.c b/channels/sip/config_parser.c index 211f60016782ec104cda6e4a68b16a86e2475f27..64cb66af5949d299456e2cfb056fb58b6fc35f80 100644 --- a/channels/sip/config_parser.c +++ b/channels/sip/config_parser.c @@ -20,7 +20,7 @@ */ /*** MODULEINFO - <support_level>extended</support_level> + <support_level>deprecated</support_level> ***/ #include "asterisk.h" diff --git a/channels/sip/dialplan_functions.c b/channels/sip/dialplan_functions.c index 09804ce8a2aed5ac6b9677ee720882649e8ce9e4..7c34fc9023ef530ff97f3b7d4b9e371d3f640481 100644 --- a/channels/sip/dialplan_functions.c +++ b/channels/sip/dialplan_functions.c @@ -20,7 +20,7 @@ */ /*** MODULEINFO - <support_level>extended</support_level> + <support_level>deprecated</support_level> ***/ /*** DOCUMENTATION diff --git a/channels/sip/reqresp_parser.c b/channels/sip/reqresp_parser.c index 4d914460044969a8d970629b0988c7fddc52e361..b43bed61e9ca097aa961ef4a81743f0d9476a595 100644 --- a/channels/sip/reqresp_parser.c +++ b/channels/sip/reqresp_parser.c @@ -20,7 +20,7 @@ */ /*** MODULEINFO - <support_level>extended</support_level> + <support_level>deprecated</support_level> ***/ #include "asterisk.h" diff --git a/channels/sip/route.c b/channels/sip/route.c index 584b46b7043c11f57fd99434aa923d99b6c70799..916c3afe439e67270eb9311d8fd266292aad4e42 100644 --- a/channels/sip/route.c +++ b/channels/sip/route.c @@ -20,7 +20,7 @@ */ /*** MODULEINFO - <support_level>extended</support_level> + <support_level>deprecated</support_level> ***/ #include "asterisk.h" diff --git a/channels/sip/security_events.c b/channels/sip/security_events.c index 86ba413d3c02210ac1ba26060bad70c8944291e6..eabc9045f4446910df68b281779f912b82bd1dec 100644 --- a/channels/sip/security_events.c +++ b/channels/sip/security_events.c @@ -25,7 +25,7 @@ */ /*** MODULEINFO - <support_level>extended</support_level> + <support_level>deprecated</support_level> ***/ #include "asterisk.h" diff --git a/channels/sip/utils.c b/channels/sip/utils.c index 45a41283b49dbc93cf788fbb21afbd46206b461a..d53316cf15cfbcbcb21244fe68b1c932dd6d2464 100644 --- a/channels/sip/utils.c +++ b/channels/sip/utils.c @@ -22,7 +22,7 @@ */ /*** MODULEINFO - <support_level>extended</support_level> + <support_level>deprecated</support_level> ***/ #include "asterisk.h" diff --git a/configs/samples/modules.conf.sample b/configs/samples/modules.conf.sample index c6c0dbc2b6bbb81e58b710b20d105fd31f52b15c..793245dc9ba121ebb29a25b4c499ecae0b389a6a 100644 --- a/configs/samples/modules.conf.sample +++ b/configs/samples/modules.conf.sample @@ -41,4 +41,6 @@ noload => chan_console.so noload => res_hep.so noload => res_hep_pjsip.so noload => res_hep_rtcp.so -; + +; Do not load chan_sip by default, it may conflict with res_pjsip. +noload => chan_sip.so