[Home]

Summary:ASTERISK-15625: Asterisk does not honor the bindport.
Reporter:adam dahlquist (adahlquist)Labels:
Date Opened:2010-02-15 11:58:20.000-0600Date Closed:2011-06-07 14:08:27
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I have run into an issue similar to the one seen here https://issues.asterisk.org/view.php?id=16351.

I am upgrading from asterisk 1.4 to 1.6.2.2.

My provider bandtel requires us to specify the port that they communicate with to be included in the contact header portion of the registration. In 1.4 i solved this by adding bindport=506X in my sip_general_custom.conf (i am using freepbx). As soon as i upgraded to 1.6.2.2 (installing from source and copying /etc/asterisk from 1.4) i noticed that their invites were coming in on 5060 (default port) so i checked the contact header, and sure enough it has reverted to blank (default 5060). I also noticed that the via has changed to 5060 as well which seems to be causing cattelan (the similar issue linked above) problems.

Is there another way to get the port number into the contact header to satisfy bandtel, or is this an Asterisk 1.6 bug?

ebroad (manager) What port do you have Asterisk listening on? Additionally, is NAT enabled?

adahlquist (reporter)Nat is enabled. With the bindport=5063 does that not mean it's listening on 5063. All of my sip phones, and our application are registered with it on 5063, and it only seems to accept invites on that port as well. Let me know if there are any configs or packets you want to see, and i can get them together.

ebroad (manager)Then it should use 5063, Ill look into why its not. In the meantime, try setting externip/host with 5063 as the port.

adahlquist (reporter)I tried that and it didnt make a difference. I also have port=5063 in peer details, and in the fromdomain i have host:5063. Also have port=5063 in sip general. Here is my registration from a 1.4 asterisk box:

User Datagram Protocol, Src Port: 5061 (5061), Dst Port: sip (5060)
Session Initiation Protocol
   Request-Line: REGISTER sip:registrar.bandtel.com SIP/2.0
   Message Header
       Via: SIP/2.0/UDP my.ip.com:5061;branch=z9hG4bK3be99106;rport
           Transport: UDP
           Sent-by Address: my.ip.com
           Sent-by port: 5061
           Branch: z9hG4bK3be99106
           RPort: rport
       From: <sip:AOR@registrar.bandtel.com>;tag=as18fc8ea9
       To: <sip:AOR@registrar.bandtel.com>
       Call-ID: 5fd472234efe1da5762da6ef2842c4ea@192.168.170.213
       CSeq: 784 REGISTER
           Sequence Number: 784
           Method: REGISTER
       User-Agent: Asterisk PBX
       Max-Forwards: 70
       Authorization: Digest username="AOR", realm="10.1.2.1", algorithm=MD5, uri="sip:registrar.bandtel.com", nonce="4b74955a810dd1992795b5b175596020aae65ca0", response="af404f1d9aa3f34704278b3786ef91e2"
           Authentication Scheme: Digest
           Username: "AOR"
           Realm: "10.1.2.1"
           Algorithm: MD5
           Authentication URI: "sip:registrar.bandtel.com"
           Nonce Value: "4b74955a810dd1992795b5b175596020aae65ca0"
           Digest Authentication Response: "af404f1d9aa3f34704278b3786ef91e2"
       Expires: 120
       Contact: <sip:AOR@my.ip.com:5061>
       Event: registration
       Content-Length: 0

And here is one from my 1.6 box which has the same config (VM image was replicated and asterisk updated)

User Datagram Protocol, Src Port: 5063 (5063), Dst Port: sip (5060)
Session Initiation Protocol
   Request-Line: REGISTER sip:registrar.bandtel.com SIP/2.0
   Message Header
       Via: SIP/2.0/UDP my.ip.com:5060;branch=z9hG4bK14588a4e;rport
           Transport: UDP
           Sent-by Address: my.ip.com
           Sent-by port: 5060
           Branch: z9hG4bK14588a4e
           RPort: rport
       Max-Forwards: 70
       From: <sip:AOR@registrar.bandtel.com>;tag=as79b7fda4
       To: <sip:AOR@registrar.bandtel.com>
       Call-ID: 5f8d846018fe5bc579a77c025e60f8c7@192.168.170.171
       CSeq: 173 REGISTER
           Sequence Number: 173
           Method: REGISTER
       User-Agent: Asterisk PBX 1.6.2.2
       Authorization: Digest username="AOR", realm="10.1.12.1", algorithm=MD5, uri="sip:registrar.bandtel.com", nonce="4b75ac2cc400324fc2ab5f80e7d5ad072fbdfd33", response="c5cd8f5bc3a5c6b134272b6b5987e328"
           Authentication Scheme: Digest
           Username: "AOR"
           Realm: "10.1.12.1"
           Algorithm: MD5
           Authentication URI: "sip:registrar.bandtel.com"
           Nonce Value: "4b75ac2cc400324fc2ab5f80e7d5ad072fbdfd33"
           Digest Authentication Response: "c5cd8f5bc3a5c6b134272b6b5987e328"
       Expires: 120
       Contact: <sip:AOR@my.ip.com>
       Content-Length: 0

You can see that my source port is correct in both cases.

Please let me know as soon as you have an idea if this is a bug in asterisk so i can set expectations as to where the roadblock is on my end. Thanks a lot for your help and prompt replies on this issue.

ebroad (manager)Just to clarify, you are trying to contact Bandtel on 5063 as opposed to 5060? What does your register line look like?

adahlquist (reporter)I am communicating with Bandtel on their 5060, but am receiving on my 5063. They require us to specify the port that we are receiving on to be part of the contact header. Here is my register line:

AOR:password@registrar.bandtel.com/AOR

You can see above that my 1.4 box has the bindport (5061 in this case) in the contact header and the via line whereas my 1.6 box does not. You can see that the src port is 5061 in the 1.4 packet and 5063 in the 1.6.
Comments:By: Elazar Broad (ebroad) 2010-02-15 12:06:15.000-0600

Thanks for opening a new issue!

I tested this on my box, Asterisk SVN trunk(recent, within the past 24 hours) and when I set externhost=myhost:5063, I get the following when Asterisk registers:
---
REGISTER sip:xxx.xxx.net SIP/2.0
Via: SIP/2.0/UDP xx.xx.xxx.10:5063;branch=z9hG4bK3f04e870
Max-Forwards: 70
From: <sip:mynumber@xxx.xxx.net>;tag=as303681c4
To: <sip:mynumber@xxx.xxx.net>
Call-ID: 15f6eef03e6126f838d0533437edf31d@mypbx
CSeq: 102 REGISTER
User-Agent: Asterisk PBX
Expires: 120
Contact: <sip:mynumber@xx.xx.xxx.10:5063>
Content-Length: 0
---

As you can see, the port is included in Contact and Via. Can you set externhost and report back? With that said, if externhost is not set, Asterisk should use the bindport. Ill try to test 1.6.2.2 later on today.

By: adam dahlquist (adahlquist) 2010-02-15 14:32:38.000-0600

I tried externhost and did not get the same result. Could there be some issue with using my 1.4 config files with 1.6.  This was my upgrade install procedure:

cd /usr/src/asterisk-1.X.X
make clean
./configure --disable-xmldoc
make
make install
make progdocs
make config
chkconfig asterisk on

wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.X-current.tar.gz
tar zxvf asterisk-addons-1.X-current.tar.gz
cd asterisk-addons-1.X-current
./configure
make
make install

service asterisk start

After doing that it appeared that none of my config files (/etc/asterisk) had been touched.  It seems to be using my existing config for everything else as i stated my trunk is still active and all extensions are available.  Is there any file that might be over writting this setting that is new to 1.6?



By: adam dahlquist (adahlquist) 2010-02-16 16:07:47.000-0600

Any update?

By: Elazar Broad (ebroad) 2010-02-16 17:13:37.000-0600

Can you post your sip.conf?

By: adam dahlquist (adahlquist) 2010-02-16 18:40:19.000-0600

We use free pbx.

sip_general_additional.conf (here i tried externhost:port and externip:port and fromdomain:port)
===========================
context=from-sip-external
callerid=Unknown
notifyringing=yes
notifyhold=yes
limitonpeers=yes
tos_sip=cs3
tos_audio=ef
tos_video=af41
alwaysauthreject=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm
jbenable=no
rtptimeout=30
maxexpiry=3600
allowguest=yes
defaultexpiry=120
minexpiry=60
srvlookup=no
registerattempts=0
registertimeout=20
notifyhold=yes
g726nonstandard=no
t38pt_udptl=no
videosupport=no
maxcallbitrate=384
canreinvite=no
rtpholdtimeout=300
rtpkeepalive=0
checkmwi=10
notifyringing=yes
nat=yes
externip=my.ip
localnet=192.168.168.0/255.255.255.0

sip_general_custom.conf (the commented out stuff is tests i was trying)
=======================
bindport=5063
;port=5063
;bindaddr=0.0.0.0:5063
callerid=AOR
relaxdtmf=yes
rfc2833compensate=yes

Trunks from sip_additional.conf
===============================
[bandtel-trunk-1]
disallow=all
username=AOR
type=peer
secret=secret
qualify=no
outboundproxy=proxy1.bandtel.com
nat=yes
insecure=port,invite
host=proxy1.bandtel.com
fromdomain=my.ip:5063
dtmfmode=auto
context=from-trunk
canreinvite=no
allow=ulaw
allow=alaw
port=5063

[bandtel-trunk-2]
disallow=all
username=AOR
type=peer
secret=secret
qualify=no
outboundproxy=proxy1.bandtel.com
nat=yes
insecure=port,invite
host=proxy1.bandtel.com
fromdomain=my.ip:5063
dtmfmode=auto
context=from-trunk
canreinvite=no
allow=ulaw
allow=alaw
port=5063

[BandtelE]
type=peer
qualify=no
nat=yes
insecure=port,invite
host=bandtel.ip
dtmfmode=rfc2833
context=from-trunk
canreinvite=no
allow=ulaw
allow=alaw

[BandtelW]
type=peer
qualify=no
nat=yes
insecure=port,invite
host=bandtel.ip
dtmfmode=rfc2833
context=from-trunk
canreinvite=no
allow=ulaw
allow=alaw



By: adam dahlquist (adahlquist) 2010-02-17 10:04:13.000-0600

Is my upgrade path supported?  Compiling and re installing over top of 1.4.

By: adam dahlquist (adahlquist) 2010-02-17 12:20:00.000-0600

Confirmed that bindport does not work on a fresh 1.6 install.  I now have the contact header fixed by using externip on both my fresh 1.6 and my upgraded system.

By: Elazar Broad (ebroad) 2010-02-17 12:55:01.000-0600

In 1.6 it is <udp/tcp/tls>bindaddr=ip:port.

By: Leif Madsen (lmadsen) 2010-02-17 14:19:46.000-0600

Can you reproduce this on a stock version of Asterisk? Using FreePBX could introduce several issues that are not immediately apparent due to the way it generates the configuration.

Does FreePBX support 1.6.x configurations yet?

I am going to guess this issue comes down to the way sip.conf etc... are being generated, the the bindport settings are just different enough to cause confusion with how FreePBX is generating the configurations.

By: Leif Madsen (lmadsen) 2010-03-23 12:35:30

Closed due to lack of response from the reporter.