[asterisk-commits] russell: branch 1.4 r61477 - in /branches/1.4: ./ channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 11 09:05:30 MST 2007


Author: russell
Date: Wed Apr 11 11:05:29 2007
New Revision: 61477

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61477
Log:
Merged revisions 61476 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61476 | russell | 2007-04-11 11:01:25 -0500 (Wed, 11 Apr 2007) | 5 lines

If someone sets the "useragent" option in sip.conf to be empty, then don't add
the User-Agent header at all.  It is an optional header, anyway.  Also, the bug
report says that some of Japan's SIP providers don't allow it for some weird
reason.  (issue #9488, reported by makoto, fixed by me)

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/channels/chan_sip.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=61477&r1=61476&r2=61477
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Wed Apr 11 11:05:29 2007
@@ -5596,7 +5596,8 @@
 	add_header(resp, "To", ot);
 	copy_header(resp, req, "Call-ID");
 	copy_header(resp, req, "CSeq");
-	add_header(resp, "User-Agent", global_useragent);
+	if (!ast_strlen_zero(global_useragent))
+		add_header(resp, "User-Agent", global_useragent);
 	add_header(resp, "Allow", ALLOWED_METHODS);
 	add_header(resp, "Supported", SUPPORTED_EXTENSIONS);
 	if (msg[0] == '2' && (p->method == SIP_SUBSCRIBE || p->method == SIP_REGISTER)) {
@@ -5711,7 +5712,8 @@
 	copy_header(req, orig, "Call-ID");
 	add_header(req, "CSeq", tmp);
 
-	add_header(req, "User-Agent", global_useragent);
+	if (!ast_strlen_zero(global_useragent))
+		add_header(req, "User-Agent", global_useragent);
 	add_header(req, "Max-Forwards", DEFAULT_MAX_FORWARDS);
 
 	if (!ast_strlen_zero(p->rpid))
@@ -6755,7 +6757,8 @@
 	add_header(req, "Contact", p->our_contact);
 	add_header(req, "Call-ID", p->callid);
 	add_header(req, "CSeq", tmp);
-	add_header(req, "User-Agent", global_useragent);
+	if (!ast_strlen_zero(global_useragent))
+		add_header(req, "User-Agent", global_useragent);
 	add_header(req, "Max-Forwards", DEFAULT_MAX_FORWARDS);
 	if (!ast_strlen_zero(p->rpid))
 		add_header(req, "Remote-Party-ID", p->rpid);
@@ -7343,7 +7346,8 @@
 	add_header(&req, "To", to);
 	add_header(&req, "Call-ID", p->callid);
 	add_header(&req, "CSeq", tmp);
-	add_header(&req, "User-Agent", global_useragent);
+	if (!ast_strlen_zero(global_useragent))
+		add_header(&req, "User-Agent", global_useragent);
 	add_header(&req, "Max-Forwards", DEFAULT_MAX_FORWARDS);
 
 	



More information about the asterisk-commits mailing list