From 1d1cc62fba39dbb29f20f444e8fdc17c0d3583ed Mon Sep 17 00:00:00 2001 From: Jonathan Rose Date: Tue, 15 Apr 2014 15:40:01 +0000 Subject: [PATCH] Reverting r411189 so that it can be put up for public review --- r411189 | jrose | 2014-03-26 10:50:48 -0500 (Wed, 26 Mar 2014) | 12 lines chan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325) Prior to this patch, the P-Asserted-Identity header would include anonymous caller id information which seems to go against the point of the P-Asserted-Identity header. Now the real caller ID information will be included in this header. Also, no privacy header would be included. This patch adds 'Privacy: id' to outgoing SIP messages that include the P-Asserted-Identity header. (closes issue AST-1301) --- ........ Merged revisions 412328 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@412329 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 8 +++++--- configs/sip.conf.sample | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 82feb21003..04fd266de0 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12503,6 +12503,7 @@ static int add_rpid(struct sip_request *req, struct sip_pvt *p) const char *privacy = NULL; const char *screen = NULL; struct ast_party_id connected_id; + const char *anonymous_string = "\"Anonymous\" "; if (!ast_test_flag(&p->flags[0], SIP_SENDRPID)) { return 0; @@ -12527,11 +12528,12 @@ static int add_rpid(struct sip_request *req, struct sip_pvt *p) lid_num = ast_uri_encode(lid_num, tmp2, sizeof(tmp2), ast_uri_sip_user); if (ast_test_flag(&p->flags[0], SIP_SENDRPID_PAI)) { - ast_str_set(&tmp, -1, "\"%s\" ", lid_name, lid_num, fromdomain); - add_header(req, "P-Asserted-Identity", ast_str_buffer(tmp)); if ((lid_pres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED) { - add_header(req, "Privacy", "id"); + ast_str_set(&tmp, -1, "%s", anonymous_string); + } else { + ast_str_set(&tmp, -1, "\"%s\" ", lid_name, lid_num, fromdomain); } + add_header(req, "P-Asserted-Identity", ast_str_buffer(tmp)); } else { ast_str_set(&tmp, -1, "\"%s\" ;party=%s", lid_name, lid_num, fromdomain, p->outgoing_call ? "calling" : "called"); diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample index b32c2e8183..5042bab1be 100644 --- a/configs/sip.conf.sample +++ b/configs/sip.conf.sample @@ -1414,8 +1414,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls ;allow=g723.1 ; Asterisk only supports g723.1 pass-thru! ;allow=g729 ; Pass-thru only unless g729 license obtained ;callingpres=allowed_passed_screen ; Set caller ID presentation - ; See function CALLERPRES documentation for possible - ; values. + ; See README.callingpres for more information ;[xlite1] ; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)! -- 2.47.2