diff options
author | Matt Jordan <mjordan@digium.com> | 2016-08-07 09:58:59 -0500 |
---|---|---|
committer | Matt Jordan <mjordan@digium.com> | 2016-08-10 11:20:11 -0500 |
commit | 5f815f9dbaf78680fd7b21af27ed7fde900264fa (patch) | |
tree | e796124ce4a38d7422d97d3f045cb3f44d515561 /channels/chan_pjsip.c | |
parent | 5a5b949333ca9d5f2befc2c07fb5f376dbd05ec0 (diff) |
channels/chan_pjsip: Add PJSIP_SEND_SESSION_REFRESH
This patch adds a new PJSIP specific dialplan function,
PJSIP_SEND_SESSION_REFRESH. When invoked on a PJSIP channel, the media
session will be refreshed via either an UPDATE or re-INVITE request.
When used in conjunction with the PJSIP_MEDIA_OFFER dialplan function,
the formats in use on a PJSIP channel can be re-negotiated and changed
dynamically after call setup.
ASTERISK-26277 #close
Change-Id: Ib98fe09ba889aafe26d58d32f0fd1323f8fd9b1b
Diffstat (limited to 'channels/chan_pjsip.c')
-rw-r--r-- | channels/chan_pjsip.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c index 98b4cf81c..82f716f08 100644 --- a/channels/chan_pjsip.c +++ b/channels/chan_pjsip.c @@ -2384,6 +2384,11 @@ static struct ast_custom_function media_offer_function = { .write = pjsip_acf_media_offer_write }; +static struct ast_custom_function session_refresh_function = { + .name = "PJSIP_SEND_SESSION_REFRESH", + .write = pjsip_acf_session_refresh_write, +}; + /*! * \brief Load the module * @@ -2423,6 +2428,11 @@ static int load_module(void) goto end; } + if (ast_custom_function_register(&session_refresh_function)) { + ast_log(LOG_WARNING, "Unable to register PJSIP_SEND_SESSION_REFRESH dialplan function\n"); + goto end; + } + if (ast_sip_session_register_supplement(&chan_pjsip_supplement)) { ast_log(LOG_ERROR, "Unable to register PJSIP supplement\n"); goto end; @@ -2479,6 +2489,7 @@ end: pjsip_uids_onhold = NULL; ast_custom_function_unregister(&media_offer_function); ast_custom_function_unregister(&chan_pjsip_dial_contacts_function); + ast_custom_function_unregister(&session_refresh_function); ast_channel_unregister(&chan_pjsip_tech); ast_rtp_glue_unregister(&chan_pjsip_rtp_glue); @@ -2500,6 +2511,7 @@ static int unload_module(void) ast_custom_function_unregister(&media_offer_function); ast_custom_function_unregister(&chan_pjsip_dial_contacts_function); + ast_custom_function_unregister(&session_refresh_function); ast_channel_unregister(&chan_pjsip_tech); ao2_ref(chan_pjsip_tech.capabilities, -1); |