diff options
author | Torrey Searle <torrey@voxbone.com> | 2017-08-21 11:28:52 +0200 |
---|---|---|
committer | Torrey Searle <torrey@voxbone.com> | 2017-08-25 14:19:55 +0200 |
commit | c5b89a390c092586cc2e2265afe49c6ca88bd57b (patch) | |
tree | b0be571247bf9865d3cd421f673a3966c1128a21 /channels/pjsip/dialplan_functions.c | |
parent | e65b4d652573840b2a8cd4d8b35478528f0a4e01 (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/pjsip/dialplan_functions.c')
-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 c89d9ca26..93875b35c 100644 --- a/channels/pjsip/dialplan_functions.c +++ b/channels/pjsip/dialplan_functions.c @@ -1241,10 +1241,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, NULL); + } 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; |