From: Jonathan Rose Date: Wed, 26 Mar 2014 16:15:12 +0000 (+0000) Subject: chan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325) X-Git-Tag: 13.0.0-beta1~402 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa3a2f8ecaeb5ba65ff2ff99097aa4381fbc1379;p=thirdparty%2Fasterisk.git chan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325) Prior too 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 411189 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411190 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 411193 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411194 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index dbd3903a34..231f376a8d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12645,7 +12645,6 @@ static int add_rpid(struct sip_request *req, struct sip_pvt *p) const char *fromdomain; const char *privacy = NULL; const char *screen = NULL; - const char *anonymous_string = "\"Anonymous\" "; struct ast_party_id connected_id; if (!ast_test_flag(&p->flags[0], SIP_SENDRPID)) { @@ -12671,12 +12670,11 @@ 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) { - ast_str_set(&tmp, -1, "%s", anonymous_string); - } else { - ast_str_set(&tmp, -1, "\"%s\" ", lid_name, lid_num, fromdomain); + add_header(req, "Privacy", "id"); } - 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 46af790434..2b26589d90 100644 --- a/configs/sip.conf.sample +++ b/configs/sip.conf.sample @@ -1431,7 +1431,8 @@ 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 README.callingpres for more information + ; See function CALLERPRES documentation for possible + ; values. ;[xlite1] ; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!