Summary:ASTERISK-13713: SIP dial ignores destination port
Reporter:Alistair Cunningham (acunningham)Labels:
Date Opened:2009-03-08 21:05:15Date Closed:2009-03-10 08:33:00
Versions:Frequency of
Description:When sending this from an AGI to Asterisk

EXEC Dial SIP/phone_123456@,3600,ot

The Asterisk console reports:

   -- AGI Script Executing Application: (Dial) Options: (SIP/phone_123456@,3600,ot)

but then sends to 5060:

Reliably Transmitting (NAT) to
INVITE sip:phone_123456@ SIP/2.0

Do I have the wrong format for the Dial?
Comments:By: Joshua C. Colp (jcolp) 2009-03-09 08:47:41

I've just confirmed under both and 1.6.0 branch that the Dial line specified with port works as expected. Is it perhaps configured in sip.conf? Can you provide the complete console output?

By: Alistair Cunningham (acunningham) 2009-03-09 08:53:00

The destination machine has both OpenSER (listening on 5060) and Asterisk (listening on 5070) running. There's an entry in sip.conf for OpenSER but not Asterisk.

Perhaps the sip.conf entry is being matched even though the port is different? I previously reported a very similar problem on Asterisk 1.4 in ticket ASTERISK-12625. Perhaps the same fix needs applied to 1.6?

By: Alistair Cunningham (acunningham) 2009-03-09 08:55:36

Here's the entry in sip.conf:

host =
port = 5060
fromdomain =
type = friend
insecure = port,invite
context = from-internal
canreinvite = no
nat = yes

I'll see if I can get a full console trace, but I doubt if it's going to show much. All the complexity is hidden in an AGI script which ends up doing the EXEC Dial.

By: Joshua C. Colp (jcolp) 2009-03-09 08:57:52

Have you tried simplifying things and tried it outside the scope of all of that with another IP address/port?

By: Alistair Cunningham (acunningham) 2009-03-09 08:58:26

Yes, most addresses work correctly.

By: Joshua C. Colp (jcolp) 2009-03-09 12:30:36

Okay, if it was totally broken then all addresses would fail to use the port.

By: Alistair Cunningham (acunningham) 2009-03-09 19:43:24

After doing some more testing, I'm pretty sure that this is the same problem as ASTERISK-12625, but for Asterisk 1.6 rather than 1.4. Calling any other IP address than the one in sip.conf works correctly.

Would it be possible to have the patch in ASTERISK-12625 ported to 1.6 and applied?

By: Digium Subversion (svnbot) 2009-03-10 08:33:00

Repository: asterisk
Revision: 180799

U   branches/1.6.0/channels/chan_sip.c

r180799 | file | 2009-03-10 08:32:59 -0500 (Tue, 10 Mar 2009) | 5 lines

If a port is specified when dialing a peer then use it.

(closes issue ASTERISK-13713)
Reported by: acunningham