Hi,
I’m trying to send the Remote-Party-ID sip header with privacy=uri, but it will only send privacy=full.
Here is the code in chan_sip.c
04877 /*! \brief build_rpid: Build the Remote Party-ID & From using callingpres options ---*/
04878 static void build_rpid(struct sip_pvt *p)
04879 {
04880 int send_pres_tags = 1;
04881 const char *privacy = NULL;
04882 const char *screen = NULL;
04883 char buf[256];
04884 const char *clid = default_callerid;
04885 const char *clin = NULL;
04886 char iabuf[INET_ADDRSTRLEN];
04887 const char *fromdomain;
04888
04889 if (p->rpid || p->rpid_from)
04890 return;
04891
04892 if (p->owner && p->owner->cid.cid_num)
04893 clid = p->owner->cid.cid_num;
04894 if (p->owner && p->owner->cid.cid_name)
04895 clin = p->owner->cid.cid_name;
04896 if (ast_strlen_zero(clin))
04897 clin = clid;
04898
04899 switch (p->callingpres) {
04900 case AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED:
04901 privacy = "off";
04902 screen = "no";
04903 break;
04904 case AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN:
04905 privacy = "off";
04906 screen = "yes";
04907 break;
04908 case AST_PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN:
04909 privacy = "off";
04910 screen = "no";
04911 break;
04912 case AST_PRES_ALLOWED_NETWORK_NUMBER:
04913 privacy = "off";
04914 screen = "yes";
04915 break;
04916 case AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED:
04917 privacy = "full";
04918 screen = "no";
04919 break;
04920 case AST_PRES_PROHIB_USER_NUMBER_PASSED_SCREEN:
04921 privacy = "full";
04922 screen = "yes";
04923 break;
04924 case AST_PRES_PROHIB_USER_NUMBER_FAILED_SCREEN:
04925 privacy = "full";
04926 screen = "no";
04927 break;
04928 case AST_PRES_PROHIB_NETWORK_NUMBER:
04929 privacy = "full";
04930 screen = "yes";
04931 break;
04932 case AST_PRES_NUMBER_NOT_AVAILABLE:
04933 send_pres_tags = 0;
04934 break;
04935 default:
04936 ast_log(LOG_WARNING, "Unsupported callingpres (%d)\n", p->callingpres);
04937 if ((p->callingpres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED)
04938 privacy = "full";
04939 else
04940 privacy = "off";
04941 screen = "no";
04942 break;
04943 }
04944
04945 fromdomain = ast_strlen_zero(p->fromdomain) ? ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip) : p->fromdomain;
04946
04947 snprintf(buf, sizeof(buf), "\"%s\" <sip:%s@%s>", clin, clid, fromdomain);
04948 if (send_pres_tags)
04949 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ";privacy=%s;screen=%s", privacy, screen);
04950 p->rpid = strdup(buf);
04951
04952 snprintf(buf, sizeof(buf), "\"%s\" <sip:%s@%s>;tag=%s", clin,
04953 ast_strlen_zero(p->fromuser) ? clid : p->fromuser,
04954 fromdomain, p->tag);
04955 p->rpid_from = strdup(buf);
04956 }
And here is my sip packet with the INVITE with SetCallerPres(prohib) or SetCallerPres(prohib_passed_screen)
INVITE sip:04XXXXXXXX@XXX.XXX.XXX.XXX SIP/2.0
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;branch=z9hG4bK0fd01895;rport
From: "device" <sip:2303@XXX.XXX.XXX.XXX>;tag=as281079fd
To: <sip:04XXXXXXXX@XXX.XXX.XXX.XXX>
Contact: <sip:2303@XXX.XXX.XXX.XXX>
Call-ID: 406c119f0d6254d77c3015273e8bd9b4@XXX.XXX.XXX.XXX
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: "device" <sip:2303@XXX.XXX.XXX.XXX>;privacy=full;screen=yes
Date: Thu, 12 Feb 2009 19:27:17 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
Content-Length: 164
in sip.conf, sendrpid=yes is set.
It doesn’t look like privacy=uri is an option from the source code, does it?
Should I recompile it changing the source code to uri instead of full? OR is there a correct option?
Kind Regards,
Chris