aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-11 16:56:45 +0000
committerautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-11 16:56:45 +0000
commit834fc211a9273c0bd1f2694b63243161f53cedcc (patch)
treee1c7fdd7b61115ace0c4c563f4004dddded933b8
parentcf5239978887bb848de7e345a075ff2dd40985ac (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@61521 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 3f8834459..6f366add9 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4206,7 +4206,8 @@ static int respprep(struct sip_request *resp, struct sip_pvt *p, char *msg, stru
add_header(resp, "To", ot);
copy_header(resp, req, "Call-ID");
copy_header(resp, req, "CSeq");
- add_header(resp, "User-Agent", default_useragent);
+ if (!ast_strlen_zero(default_useragent))
+ add_header(resp, "User-Agent", default_useragent);
add_header(resp, "Allow", ALLOWED_METHODS);
if (msg[0] == '2' && (p->method == SIP_SUBSCRIBE || p->method == SIP_REGISTER)) {
/* For registration responses, we also need expiry and
@@ -4319,7 +4320,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", default_useragent);
+ if (!ast_strlen_zero(default_useragent))
+ add_header(req, "User-Agent", default_useragent);
add_header(req, "Max-Forwards", DEFAULT_MAX_FORWARDS);
if (p->rpid)
@@ -5145,7 +5147,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", default_useragent);
+ if (!ast_strlen_zero(default_useragent))
+ add_header(req, "User-Agent", default_useragent);
add_header(req, "Max-Forwards", DEFAULT_MAX_FORWARDS);
if (p->rpid)
add_header(req, "Remote-Party-ID", p->rpid);
@@ -5758,7 +5761,8 @@ static int transmit_register(struct sip_registry *r, int sipmethod, char *auth,
add_header(&req, "To", to);
add_header(&req, "Call-ID", p->callid);
add_header(&req, "CSeq", tmp);
- add_header(&req, "User-Agent", default_useragent);
+ if (!ast_strlen_zero(default_useragent))
+ add_header(&req, "User-Agent", default_useragent);
add_header(&req, "Max-Forwards", DEFAULT_MAX_FORWARDS);