fix issue with build_contact introduced by the "SIP trasnport type issues" commit
authorDavid Vossel <dvossel@digium.com>
Tue, 16 Jun 2009 22:29:30 +0000 (22:29 +0000)
committerDavid Vossel <dvossel@digium.com>
Tue, 16 Jun 2009 22:29:30 +0000 (22:29 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201223 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 4fd774b..5cbf028 100644 (file)
@@ -10266,14 +10266,14 @@ static void build_contact(struct sip_pvt *p)
        /* only add port if it's non-standard for the transport type */
        if (!sip_standard_port(p->socket.type, ourport)) {
                if (p->socket.type == SIP_TRANSPORT_UDP)
-                       ast_string_field_build(p, our_contact, "<sip:%s%s%s:%d>", p->exten, S_OR(p->exten, "@"), ast_inet_ntoa(p->ourip.sin_addr), ourport);
+                       ast_string_field_build(p, our_contact, "<sip:%s%s%s:%d>", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(p->ourip.sin_addr), ourport);
                else
-                       ast_string_field_build(p, our_contact, "<sip:%s%s%s:%d;transport=%s>", p->exten, S_OR(p->exten, "@"), ast_inet_ntoa(p->ourip.sin_addr), ourport, get_transport(p->socket.type));
+                       ast_string_field_build(p, our_contact, "<sip:%s%s%s:%d;transport=%s>", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(p->ourip.sin_addr), ourport, get_transport(p->socket.type));
        } else {
                if (p->socket.type == SIP_TRANSPORT_UDP)
-                       ast_string_field_build(p, our_contact, "<sip:%s%s%s>", p->exten, S_OR(p->exten, "@"), ast_inet_ntoa(p->ourip.sin_addr));
+                       ast_string_field_build(p, our_contact, "<sip:%s%s%s>", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(p->ourip.sin_addr));
                else
-                       ast_string_field_build(p, our_contact, "<sip:%s%s%s;transport=%s>", p->exten, S_OR(p->exten, "@"), ast_inet_ntoa(p->ourip.sin_addr), get_transport(p->socket.type));
+                       ast_string_field_build(p, our_contact, "<sip:%s%s%s;transport=%s>", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(p->ourip.sin_addr), get_transport(p->socket.type));
        }
 }