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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@411193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jonathan Rose
2014-03-26 16:07:31 +00:00
parent a90c190c87
commit fc7faefe55
2 changed files with 6 additions and 7 deletions

View File

@@ -12667,7 +12667,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\" <sip:anonymous@anonymous.invalid>";
struct ast_party_id connected_id;
if (!ast_test_flag(&p->flags[0], SIP_SENDRPID)) {
@@ -12693,12 +12692,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)) {
if ((lid_pres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED) {
ast_str_set(&tmp, -1, "%s", anonymous_string);
} else {
ast_str_set(&tmp, -1, "\"%s\" <sip:%s@%s>", lid_name, lid_num, fromdomain);
}
ast_str_set(&tmp, -1, "\"%s\" <sip:%s@%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");
}
} else {
ast_str_set(&tmp, -1, "\"%s\" <sip:%s@%s>;party=%s", lid_name, lid_num, fromdomain, p->outgoing_call ? "calling" : "called");