diff options
author | zuul <zuul@gerrit.asterisk.org> | 2016-10-27 15:15:35 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-10-27 15:15:35 -0500 |
commit | 90d1b3262b4018271cd19d0853ba644721f113ac (patch) | |
tree | 8ca937a494fa39689a6881f4bf7dcde2681beb3b | |
parent | 4f45d62653a2b0e5878607df355c042ea41daa13 (diff) | |
parent | 6993f3c9c318ca65efb21e47a9f8cd20a0a621d6 (diff) |
Merge "res_pjsip_caller_id: Fix crash on session timers UPDATE on inbound calls."
-rw-r--r-- | res/res_pjsip_caller_id.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/res/res_pjsip_caller_id.c b/res/res_pjsip_caller_id.c index 16b19ec2b..7948d33be 100644 --- a/res/res_pjsip_caller_id.c +++ b/res/res_pjsip_caller_id.c @@ -523,8 +523,11 @@ static void add_pai_header(const struct ast_sip_session *session, pjsip_tx_data } } - base = tdata->msg->type == PJSIP_REQUEST_MSG ? session->saved_from_hdr : - PJSIP_MSG_TO_HDR(tdata->msg); + if (tdata->msg->type == PJSIP_REQUEST_MSG) { + base = session->saved_from_hdr ? session->saved_from_hdr : PJSIP_MSG_FROM_HDR(tdata->msg); + } else { + base = PJSIP_MSG_TO_HDR(tdata->msg); + } pai_hdr = create_new_id_hdr(&pj_pai_name, base, tdata, id); if (!pai_hdr) { @@ -629,8 +632,11 @@ static void add_rpid_header(const struct ast_sip_session *session, pjsip_tx_data } } - base = tdata->msg->type == PJSIP_REQUEST_MSG ? session->saved_from_hdr : - PJSIP_MSG_TO_HDR(tdata->msg); + if (tdata->msg->type == PJSIP_REQUEST_MSG) { + base = session->saved_from_hdr ? session->saved_from_hdr : PJSIP_MSG_FROM_HDR(tdata->msg); + } else { + base = PJSIP_MSG_TO_HDR(tdata->msg); + } rpid_hdr = create_new_id_hdr(&pj_rpid_name, base, tdata, id); if (!rpid_hdr) { |