From: Mark Spencer Date: Thu, 15 Jul 2004 14:31:20 +0000 (+0000) Subject: Build contact without @ sign if there is no extension X-Git-Tag: 1.0.0-rc1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e9d4faf6140b8ebefb04f046afe0bab9d6a2216;p=thirdparty%2Fasterisk.git Build contact without @ sign if there is no extension git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3440 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index bca25b6900..7037ee6d1d 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3590,9 +3590,9 @@ static void build_contact(struct sip_pvt *p) char iabuf[INET_ADDRSTRLEN]; /* Construct Contact: header */ if (ourport != 5060) - snprintf(p->our_contact, sizeof(p->our_contact), "", p->exten, ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip), ourport); + snprintf(p->our_contact, sizeof(p->our_contact), "", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip), ourport); else - snprintf(p->our_contact, sizeof(p->our_contact), "", p->exten, ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip)); + snprintf(p->our_contact, sizeof(p->our_contact), "", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip)); } /*--- initreqprep: Initiate SIP request to peer/user ---*/