[asterisk-bugs] [JIRA] (ASTERISK-24767) Regression - fromdomain port ingnored in some situations

Tony Jago (JIRA) noreply at issues.asterisk.org
Sun Feb 8 00:55:34 CST 2015


Tony Jago created ASTERISK-24767:
------------------------------------

             Summary: Regression - fromdomain port ingnored in some situations
                 Key: ASTERISK-24767
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24767
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Channels/chan_sip/General
    Affects Versions: SVN
         Environment: Any
            Reporter: Tony Jago


Revision 421720 has a side affect of allowing asterisk to sent the from domain port to a different value than is specified in the configuration file. This happens when the user is running asterisk on a non-standard sip port but has the fromdomain's port set to be the sip standard. Sample configuration:

udpbindaddr=192.168.1.2:50000
tcpbindaddr=192.168.1.2:50000
fromdomain=sip.mysuperserver.com:5060

Should emit: From: <sip:6111111111 at sip.convoitec.com:5060>;tag=as16cce70e

Does emit: 
From: <sip:6111111111 at sip.convoitec.com:50000>;tag=as16cce70e

Previous to the 421720 revision, the code would simply assign the port as the user requested -

ourport = (p->fromdomainport) ? p->fromdomainport : ast_sockaddr_port(&p->ourip);

this was changed to:

ourport = (p->fromdomainport && (p->fromdomainport != STANDARD_SIP_PORT)) ? p->fromdomainport : ast_sockaddr_port(&p->ourip);

The (p->fromdomainport != STANDARD_SIP_PORT)) is FALSE so instead of setting the fromdomain port to what the user has requested, it is set to ast_sockaddr_port(&p->ourip);

Clearly, the correct operation is to emit the port number that has been set in the configuration file - this happens in all cases except when you try and set that port to 5060 AND your bound sip port is not 5060.




--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list