summaryrefslogtreecommitdiff
path: root/channels/chan_pjsip.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2014-12-12 13:05:15 +0000
committerJoshua Colp <jcolp@digium.com>2014-12-12 13:05:15 +0000
commit0c9fbb449f272b826e022499dddda39bc12dda7e (patch)
tree395256dbbf4ad0c321fb8fd91bf77ab402342917 /channels/chan_pjsip.c
parent61fe4f10d230d09b5246c97675637810ffed2fa2 (diff)
res_pjsip_session: Delay sending BYE if a re-INVITE transaction is in progress.
Given the scenario where a PJSIP channel is in a native RTP bridge with direct media and the channel is then hung up the code will currently re-INVITE the channel back to Asterisk and send a BYE at the same time. Many SIP implementations dislike this greatly. This change makes it so that if a re-INVITE transaction is in progress the BYE is queued to occur after the completion of the transaction (be it through normal means or a timeout). Review: https://reviewboard.asterisk.org/r/4248/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_pjsip.c')
-rw-r--r--channels/chan_pjsip.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index 7b95f879b..63229f38f 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -1687,22 +1687,7 @@ static int hangup(void *data)
struct ast_sip_session *session = channel->session;
int cause = h_data->cause;
- if (!session->defer_terminate) {
- pj_status_t status;
- pjsip_tx_data *packet = NULL;
-
- if (session->inv_session->state == PJSIP_INV_STATE_NULL) {
- pjsip_inv_terminate(session->inv_session, cause ? cause : 603, PJ_TRUE);
- } else if (((status = pjsip_inv_end_session(session->inv_session, cause ? cause : 603, NULL, &packet)) == PJ_SUCCESS)
- && packet) {
- if (packet->msg->type == PJSIP_RESPONSE_MSG) {
- ast_sip_session_send_response(session, packet);
- } else {
- ast_sip_session_send_request(session, packet);
- }
- }
- }
-
+ ast_sip_session_terminate(session, cause);
clear_session_and_channel(session, ast, pvt);
ao2_cleanup(channel);
ao2_cleanup(h_data);