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
This commit is contained in:
Torrey Searle
2017-08-21 11:28:52 +02:00
committed by Joshua Colp
parent 572b5307e0
commit 8e99969000
4 changed files with 62 additions and 1 deletions

View File

@@ -623,6 +623,23 @@ int ast_sip_session_refresh(struct ast_sip_session *session,
enum ast_sip_session_refresh_method method,
int generate_new_sdp);
/*!
* \brief Regenerate SDP Answer
*
* This method is used when an SDP offer has been received but an SDP answer
* has not been sent yet. It requests that a new local SDP be created and
* set as the SDP answer. As with any outgoing request in res_pjsip_session,
* this will call into registered supplements in case they wish to add anything.
*
* \param session The session on which the answer will be updated
* \param on_sdp_creation Callback called when SDP is created
* \param generate_new_sdp Boolean to indicate if a new SDP should be created
* \retval 0 Successfully updated the SDP answer
* \retval -1 Failure to updated the SDP answer
*/
int ast_sip_session_regenerate_answer(struct ast_sip_session *session,
ast_sip_session_sdp_creation_cb on_sdp_creation);
/*!
* \brief Send a SIP response
*