aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-17 16:16:35 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-17 16:16:35 +0000
commit7a427641dd166e497848a69bc58f53c89c8c30d6 (patch)
tree1242209ce10629a1e398322e87d5e4d5bc790439 /channels
parentc0019b6b22bf354e1352768c04cfdfd4dc797f75 (diff)
Merged revisions 206939 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r206939 | dvossel | 2009-07-17 11:13:22 -0500 (Fri, 17 Jul 2009) | 20 lines Merged revisions 206938 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r206938 | dvossel | 2009-07-17 11:05:06 -0500 (Fri, 17 Jul 2009) | 14 lines SIP incorrect From: header information when callpres is prohib Some ITSP make use of the "Anonymous" display name to detect a requirement to withhold caller id across the PSTN. This does not work if the display name is "Unknown". (closes issue #14465) Reported by: Nick_Lewis Patches: chan_sip.c-callerpres.patch uploaded by Nick (license 657) chan_sip.c-callerpres_trunk.patch uploaded by dvossel (license 671) Tested by: Nick_Lewis, dvossel ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@206941 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 502d395a9..53d448a05 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -247,7 +247,8 @@ static int default_expiry = DEFAULT_DEFAULT_EXPIRY;
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
-#define CALLERID_UNKNOWN "Unknown"
+#define CALLERID_UNKNOWN "Anonymous"
+#define FROMDOMAIN_INVALID "anonymous.invalid"
#define DEFAULT_MAXMS 2000 /*!< Qualification: Must be faster than 2 seconds by default */
#define DEFAULT_QUALIFYFREQ 60 * 1000 /*!< Qualification: How often to check for the host to be up */
@@ -9575,6 +9576,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
char tmp_l[SIPBUFSIZE/2]; /* build a local copy of 'l' if needed */
const char *l = NULL; /* XXX what is this, exactly ? */
const char *n = NULL; /* XXX what is this, exactly ? */
+ const char *d = NULL; /* domain in from header */
const char *urioptions = "";
int ourport;
@@ -9600,6 +9602,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
snprintf(p->lastmsg, sizeof(p->lastmsg), "Init: %s", sip_methods[sipmethod].text);
+ d = S_OR(p->fromdomain, ast_inet_ntoa(p->ourip.sin_addr));
if (p->owner) {
l = p->owner->cid.cid_num;
n = p->owner->cid.cid_name;
@@ -9609,6 +9612,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
((p->callingpres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED)) {
l = CALLERID_UNKNOWN;
n = l;
+ d = FROMDOMAIN_INVALID;
}
if (ast_strlen_zero(l))
l = default_callerid;
@@ -9635,9 +9639,9 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
ourport = ntohs(p->ourip.sin_port);
if (!sip_standard_port(p->socket.type, ourport) && ast_strlen_zero(p->fromdomain))
- snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s:%d>;tag=%s", n, l, ast_inet_ntoa(p->ourip.sin_addr), ourport, p->tag);
+ snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s:%d>;tag=%s", n, l, d, ourport, p->tag);
else
- snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s>;tag=%s", n, l, S_OR(p->fromdomain, ast_inet_ntoa(p->ourip.sin_addr)), p->tag);
+ snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s>;tag=%s", n, l, d, p->tag);
/* If we're calling a registered SIP peer, use the fullcontact to dial to the peer */
if (!ast_strlen_zero(p->fullcontact)) {