diff options
author | Torrey Searle <torrey@voxbone.com> | 2017-08-21 11:28:52 +0200 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2017-08-22 12:22:56 +0000 |
commit | 8e99969000398caefb1d7adddc3069a1b08b948d (patch) | |
tree | f6cb26dbeaf12d6b58a8d79577f77ce7b24646b3 /channels | |
parent | 572b5307e0b4f451107ee519a8fcf3a829b35dc8 (diff) |
res/res_pjsip_session: allow SDP answer to be regenerated
If an SDP answer hasn't been sent yet, it's legal to change it.
This is required for PJSIP_DTMF_MODE to work correctly, and can
also have use in the future for updating codecs too.
ASTERISK-27209 #close
Change-Id: Idbbfb7cb3f72fbd96c94d10d93540f69bd51e7a1
Diffstat (limited to 'channels')
-rw-r--r-- | channels/pjsip/dialplan_functions.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/channels/pjsip/dialplan_functions.c b/channels/pjsip/dialplan_functions.c index a382c4e0a..27bc3d782 100644 --- a/channels/pjsip/dialplan_functions.c +++ b/channels/pjsip/dialplan_functions.c @@ -1113,10 +1113,13 @@ static int dtmf_mode_refresh_cb(void *obj) struct refresh_data *data = obj; if (data->session->inv_session->state == PJSIP_INV_STATE_CONFIRMED) { - ast_debug(3, "Changing DTMF mode on channel %s after OFFER/ANSER completion. Sending session refresh\n", ast_channel_name(data->session->channel)); + ast_debug(3, "Changing DTMF mode on channel %s after OFFER/ANSWER completion. Sending session refresh\n", ast_channel_name(data->session->channel)); ast_sip_session_refresh(data->session, NULL, NULL, sip_session_response_cb, data->method, 1); + } else if (data->session->inv_session->state == PJSIP_INV_STATE_INCOMING) { + ast_debug(3, "Changing DTMF mode on channel %s during OFFER/ANSWER exchange. Updating SDP answer\n", ast_channel_name(data->session->channel)); + ast_sip_session_regenerate_answer(data->session, NULL); } return 0; |