Why incoming calls goes to default context?

've three servers:

1 - Govoipporto - version 1.2.10
2 - servirtporto - version 11.2.1
3 - viriato - version 13.10

Each time a call comes from servirtporto, the call goes successfully to the incoming-iax context.

But the calls form govoipporto goes always to default context and I wonder why?!

The Trunksips between Govoipporto and servirtporto are working well, and outgoing calls work fine.

Configuration of Trunksip to Viriato in Govoipporto and General section:

[general]
realm=Jar209Reftel.refertelecom.pt
context=default
allowoverlap=yes
srvlookup=yes
defaultexpiry=90
;qualify=yes
videosupport=yes
notifyringing = yes
notifyhold = yes
callcounter = yes
counteronpeer = yes
alwaysauthreject = yes
allowguest=no
disallow=all
allow = alaw
allow = ulaw
allow = g729
allow = gsm
rtptimeout=300
nat=no
bindaddr=0.0.0.0
bindport=5060
tos=0xb8

[TRUNKSIP-VIRIATO]
type=peer
host=10.192.230.231
context=incoming-iax
disallow=all
allow = ulaw
dtmfmode=inband
canreinvite=no
qualify=yes
nat=no
deny=0.0.0.0/0.0.0.0
permit=10.192.23.231/255.255.255.255

And in servirtporto:

[general]
realm=Jar209Reftel.refertelecom.pt
context=default
allowoverlap=yes
srvlookup=yes
defaultexpiry=90
;qualify=8000
videosupport=yes
notifyringing = yes
notifyhold = yes
callcounter = yes
counteronpeer = yes
alwaysauthreject = yes
allowguest=no
disallow=all
allow = alaw
allow = ulaw
allow = g722
allow = g729
allow = gsm
rtptimeout=300
nat=no
bindaddr=0.0.0.0
bindport=5060
tos=0xb8

[TRUNKSIP-VIRIATO]
type=peer
host=10.192.230.231
context=incoming-iax
disallow=all
allow = ulaw
dtmfmode=inband
canreinvite=no
qualify=8000
nat=no
deny=0.0.0.0/0.0.0.0
permit=10.192.230.231/255.255.255.255

And in side of viriato:

[general]
realm=Jar209Reftel.refertelecom.pt
context=default
allowoverlap=yes
srvlookup=yes
defaultexpiry=90
;qualify=8000
videosupport=yes
notifyringing = yes
notifyhold = yes
callcounter = yes
counteronpeer = yes
alwaysauthreject = yes
;allowguest=no
disallow=all
allow = alaw
allow = ulaw
;allow = g722
allow = g729
allow = gsm
rtptimeout=300
nat=no
bindaddr=0.0.0.0
bindport=5060
tos=0xb8

[TRUNKSIP-GOVOIPPORTO]
type=peer
host=10.128.9.60
context=incoming-iax
disallow=all
allow = ulaw
dtmfmode=inband
;canreinvite=no
qualify=yes
nat=no
deny=0.0.0.0/0.0.0.0
permit=10.128.9.60/255.255.255.255

[TRUNKSIP-SERVIRTPORTO]
type=peer
host=10.131.10.10
context=incoming-iax
disallow=all
allow = ulaw
dtmfmode=inband
canreinvite=no
qualify=8000
nat=no
deny=0.0.0.0/0.0.0.0
permit=10.131.10.10/255.255.255.255

Example of calls:

From Govoipporto and in Viriato:

Connected to Asterisk 13.10.0 currently running on viriato (pid = 20431)
== Using SIP RTP CoS mark 5
– Executing [27757@default:1] Ringing(“SIP/10.128.8.250-00003928”, “”) in new stack
– Executing [27757@default:2] Set(“SIP/10.128.8.250-00003928”, “numero=”) in new stack
– Executing [27757@default:3] GotoIf(“SIP/10.128.8.250-00003928”, “1?6:4”) in new stack
– Goto (default,27757,6)
– Executing [27757@default:6] Dial(“SIP/10.128.8.250-00003928”, “SIP/27757,60,tT”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/27757

From servirtporto and in Viriato

Using SIP RTP CoS mark 5
– Executing [27757@incoming-iax:1] Ringing(“SIP/TRUNKSIP-SERVIRTPORTO-0000393a”, “”) in new stack
– Executing [27757@incoming-iax:2] Set(“SIP/TRUNKSIP-SERVIRTPORTO-0000393a”, “numero=”) in new stack
– Executing [27757@incoming-iax:3] GotoIf(“SIP/TRUNKSIP-SERVIRTPORTO-0000393a”, “1?6:4”) in new stack
– Goto (incoming-iax,27757,6)
– Executing [27757@incoming-iax:6] Dial(“SIP/TRUNKSIP-SERVIRTPORTO-0000393a”, “SIP/27757,60,tT”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/27757
– SIP/27757-0000393b is ringing

Hi
First, I do not see the reason to specify ACL when you have a static IP address in peer host= definition.
but In case ACL rules permit/allow matches your incoming peer IP addresses, then try to add

insecure=port

option to peer at Vriato , under ‘Govoipporto’ definition
"insecure=port ; Allow matching of peer by IP address without matching port number"

On your trunk configuration, you have defined host=10.128.9.60 and call is comming from this IP 10.128.8.250-, also you have on you general sections guest calls enabled (because are enabled by defaults ) and also the default context for unauthenticated define on your general section is default

1 Like

Thanks for your reply! It didn’t work either…

Using SIP RTP CoS mark 5
– Executing [27757@default:1] Ringing(“SIP/10.128.8.250-00003cc9”, “”) in new stack
– Executing [27757@default:2] Set(“SIP/10.128.8.250-00003cc9”, “numero=”) in new stack
– Executing [27757@default:3] GotoIf(“SIP/10.128.8.250-00003cc9”, “1?6:4”) in new stack
– Goto (default,27757,6)

The configurarion below:
[TRUNKSIP-GOVOIPPORTO]
type=peer
host=10.128.9.60
context=incoming-iax
disallow=all
allow = ulaw
dtmfmode=inband
;canreinvite=no
qualify=yes
nat=no
insecure=port
deny=0.0.0.0/0.0.0.0
permit=10.128.9.60/255.255.255.255

Hi, Thanks for your reply!

That’s it!

[root@govoip ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:06:5B:F6:EF:85
inet addr:10.128.9.60 Bcast:10.128.9.63 Mask:255.255.255.192
inet6 addr: fe80::206:5bff:fef6:ef85/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3588253984 errors:0 dropped:0 overruns:0 frame:1572864
TX packets:26472836 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:54469400 (51.9 MiB) TX bytes:475908747 (453.8 MiB)
Interrupt:193

eth1 Link encap:Ethernet HWaddr 00:06:5B:F6:EF:86
inet addr:10.128.8.250 Bcast:10.128.8.255 Mask:255.255.255.0
inet6 addr: 2a02:8f0:3400:105:206:5bff:fef6:ef86/64 Scope:Global
inet6 addr: fe80::206:5bff:fef6:ef86/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:131319702 errors:0 dropped:0 overruns:0 frame:1343488
TX packets:2936836545 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1794759841 (1.6 GiB) TX bytes:371973422 (354.7 MiB)
Interrupt:201

I’m going to investigate why all of a sudden the calls have come through the other Ethernet port

since asterisk binds to both IP addresses, and selects one of them by some reason(routing?), you can force asterisk to use certain one,

change to
bindaddr=10.128.9.60

Hi,

But here in the last two rows, i’ve already doing this, right?

[TRUNKSIP-GOVOIPPORTO]
type=peer
host=10.128.9.60
context=incoming-iax
disallow=all
allow = ulaw
dtmfmode=inband
canreinvite=no
qualify=yes
nat=no
deny=0.0.0.0/0.0.0.0
permit=10.128.9.60/255.255.255.255

Allow and deny are about the remote address. bind is about the local one (the example given was wrong).

It is the OS, not Asterisk which decides which interface to use when a wildcard is used. Asterisk simply does some trickery to find out what the OS will do.

1 Like

OK. Thanks for your explanation. The default GW wasn’t correctly defined im the GovoipPorto server.