chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)
authorRichard Mudgett <rmudgett@digium.com>
Thu, 7 Dec 2017 23:51:08 +0000 (17:51 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 12 Dec 2017 19:46:42 +0000 (13:46 -0600)
commit22810fc63558bcc9e1af248f48480c2ba10faf99
tree53552c6eaf37c3c3ca23c60b108cb3215d1628b7
parentc2ec82bf36b66b758f968c8d62865705c351a280
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
channels/chan_pjsip.c
channels/pjsip/dialplan_functions.c
include/asterisk/res_pjsip_session.h
res/res_pjsip_session.c