summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-10-08 13:48:14 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-10-08 13:48:14 -0500
commit1c799b1f1ecc37b7fb39dd205a35720e16fe37d7 (patch)
tree387b6dfb59223806edca2fc6f9936a37c034f62d /channels
parent3329c714f7c32f0aa0bc923e0b2dd599c0ecc5d5 (diff)
parent426263a64dc5dc80a51b6950ee0cb6b46f5f052c (diff)
Merge "chan_pjsip: Fix crash on reINVITE before initial INVITE completes." into 13
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_pjsip.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index 2a815a837..6195d1032 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -2085,7 +2085,8 @@ static int chan_pjsip_incoming_request(struct ast_sip_session *session, struct p
return 0;
}
- if (session->inv_session->state >= PJSIP_INV_STATE_CONFIRMED) {
+ /* Check for a to-tag to determine if this is a reinvite */
+ if (rdata->msg_info.to->tag.slen) {
/* Weird case. We've received a reinvite but we don't have a channel. The most
* typical case for this happening is that a blind transfer fails, and so the
* transferer attempts to reinvite himself back into the call. We already got
@@ -2132,8 +2133,9 @@ static int call_pickup_incoming_request(struct ast_sip_session *session, pjsip_r
struct ast_features_pickup_config *pickup_cfg;
struct ast_channel *chan;
- /* We don't care about reinvites */
- if (session->inv_session->state >= PJSIP_INV_STATE_CONFIRMED) {
+ /* Check for a to-tag to determine if this is a reinvite */
+ if (rdata->msg_info.to->tag.slen) {
+ /* We don't care about reinvites */
return 0;
}
@@ -2180,8 +2182,9 @@ static int pbx_start_incoming_request(struct ast_sip_session *session, pjsip_rx_
{
int res;
- /* We don't care about reinvites */
- if (session->inv_session->state >= PJSIP_INV_STATE_CONFIRMED) {
+ /* Check for a to-tag to determine if this is a reinvite */
+ if (rdata->msg_info.to->tag.slen) {
+ /* We don't care about reinvites */
return 0;
}