summaryrefslogtreecommitdiff
path: root/channels/chan_pjsip.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2017-12-07 17:51:08 -0600
committerRichard Mudgett <rmudgett@digium.com>2017-12-12 13:46:42 -0600
commit22810fc63558bcc9e1af248f48480c2ba10faf99 (patch)
tree53552c6eaf37c3c3ca23c60b108cb3215d1628b7 /channels/chan_pjsip.c
parentc2ec82bf36b66b758f968c8d62865705c351a280 (diff)
chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)
This patch does three things associated with the initial incoming INVITE request URI. 1) Add access to the full initial incoming INVITE request URI. 2) We were not setting DNID on incoming PJSIP channels. The DNID is the user portion of the initial incoming INVITE Request-URI. The value is accessed by reading CALLERID(dnid). 3) Fix CHANNEL(pjsip,target_uri) documentation. * The initial incoming INVITE request URI is now available using CHANNEL(pjsip,request_uri). * Set the DNID on PJSIP channel creation so CALLERID(dnid) can return the initial incoming INVITE request URI user portion. * CHANNEL(pjsip,target_uri) now correctly documents that the target URI is the contact URI. * Refactored print_escaped_uri() out of channel_read_pjsip() to handle pjsip_uri_print() error condition when the buffer is too small. ASTERISK-27478 Change-Id: I512e60d1f162395c946451becb37af3333337b33
Diffstat (limited to 'channels/chan_pjsip.c')
-rw-r--r--channels/chan_pjsip.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index e4e8fa586..69bcc187f 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -605,6 +605,11 @@ static struct ast_channel *chan_pjsip_new(struct ast_sip_session *session, int s
ast_party_id_copy(&ast_channel_caller(chan)->id, &session->id);
ast_party_id_copy(&ast_channel_caller(chan)->ani, &session->id);
+ if (!ast_strlen_zero(exten)) {
+ /* Set provided DNID on the new channel. */
+ ast_channel_dialed(chan)->number.str = ast_strdup(exten);
+ }
+
ast_channel_priority_set(chan, 1);
ast_channel_callgroup_set(chan, session->endpoint->pickup.callgroup);