summaryrefslogtreecommitdiff
path: root/channels/chan_pjsip.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2016-08-07 09:58:59 -0500
committerMatt Jordan <mjordan@digium.com>2016-08-10 11:30:01 -0500
commitc315460abbb6ce30423c4d5bb092f4ac17ef2cc2 (patch)
treed60b3af5496e77ac148269a1cec112f134ebfdbb /channels/chan_pjsip.c
parentd78fe8fed0d0a76e11b2884a65b66e82b28a6019 (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 (cherry picked from commit eec60dd77394f0519895fc6abce3a6f90f6470f1)
Diffstat (limited to 'channels/chan_pjsip.c')
-rw-r--r--channels/chan_pjsip.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index 2e87393a6..02da0db35 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -2433,6 +2433,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
*
@@ -2472,6 +2477,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;
@@ -2528,6 +2538,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);
@@ -2549,6 +2560,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);