dect
/
asterisk
Archived
13
0
Fork 0

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: http://svn.digium.com/svn/asterisk/trunk@302315 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
mnicholson 2011-01-18 21:44:49 +00:00
parent 2ed3724d11
commit b2ef846588
1 changed files with 7 additions and 4 deletions

View File

@ -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));
}
}