summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorMatthew Nicholson <mnicholson@digium.com>2011-01-18 21:44:49 +0000
committerMatthew Nicholson <mnicholson@digium.com>2011-01-18 21:44:49 +0000
commit785e3a141747d99f2ffcd603b886016468cd006e (patch)
tree7f79a9066c78fac113ec2043fd2be45cde56323b /channels/chan_sip.c
parentb1f9f1e78f8ead655dc87853c49ec80d324c8982 (diff)
Merged revisions 302314 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r302314 | mnicholson | 2011-01-18 15:43:21 -0600 (Tue, 18 Jan 2011) | 18 lines Merged revisions 302313 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r302313 | mnicholson | 2011-01-18 15:40:03 -0600 (Tue, 18 Jan 2011) | 11 lines Merged revisions 302311 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r302311 | mnicholson | 2011-01-18 15:35:03 -0600 (Tue, 18 Jan 2011) | 4 lines URI encode the user part of the contact header. ABE-2705 ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@302315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 749f7a26b..67c02af12 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11218,12 +11218,15 @@ static void extract_uri(struct sip_pvt *p, struct sip_request *req)
/*! \brief Build contact header - the contact header we send out */
static void build_contact(struct sip_pvt *p)
{
+ char tmp[SIPBUFSIZE];
+ char *user = ast_uri_encode(p->exten, tmp, sizeof(tmp), 1);
+
if (p->socket.type == SIP_TRANSPORT_UDP) {
- ast_string_field_build(p, our_contact, "<sip:%s%s%s>", p->exten,
- ast_strlen_zero(p->exten) ? "" : "@", ast_sockaddr_stringify(&p->ourip));
+ ast_string_field_build(p, our_contact, "<sip:%s%s%s>", user,
+ ast_strlen_zero(user) ? "" : "@", ast_sockaddr_stringify(&p->ourip));
} else {
- ast_string_field_build(p, our_contact, "<sip:%s%s%s;transport=%s>", p->exten,
- ast_strlen_zero(p->exten) ? "" : "@", ast_sockaddr_stringify(&p->ourip),
+ ast_string_field_build(p, our_contact, "<sip:%s%s%s;transport=%s>", user,
+ ast_strlen_zero(user) ? "" : "@", ast_sockaddr_stringify(&p->ourip),
get_transport(p->socket.type));
}
}