diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-04-11 16:06:37 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-04-11 16:06:37 +0000 |
commit | 3c0b24bda8b8f31657b5cf5655f3c82ca3fe088c (patch) | |
tree | 7b0fc57049f47adcb18d06506011384fd869ebf3 /channels/chan_sip.c | |
parent | 9978dc647b928acc43073ccfc01c42f8d772b2b6 (diff) |
Merged revisions 61477 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r61477 | russell | 2007-04-11 11:05:29 -0500 (Wed, 11 Apr 2007) | 13 lines
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)
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index ed5d99495..99b156ed1 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -6000,7 +6000,8 @@ static int respprep(struct sip_request *resp, struct sip_pvt *p, const char *msg 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)) { @@ -6117,7 +6118,8 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, in 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); if (!ast_strlen_zero(p->rpid)) add_header(req, "Remote-Party-ID", p->rpid); @@ -7269,7 +7271,8 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho 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); if (!ast_strlen_zero(p->rpid)) add_header(req, "Remote-Party-ID", p->rpid); } @@ -7863,7 +7866,8 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char * 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); if (auth) /* Add auth header */ |