"The number you have dialed is not in service" once in a while

Hello,

I have configured a “Ring Group” with 2 extensions, and defined to “Play Recording” in the “Destination if no answer” field.

When no extension are online it plays the recording but once in a while we get the classical “The number you have dialed is not in service. Please check the number and try again.” with logs like these:

2018-07-10 13:49:26] VERBOSE[9187][C-00000001] netsock2.c: Using SIP RTP TOS bits 184
[2018-07-10 13:49:26] VERBOSE[9187][C-00000001] netsock2.c: Using SIP RTP CoS mark 5
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx.c: Executing [41123456789@from-sip-external:1] NoOp("SIP/xxx.xxx.xxx.xxx-00000001", "Received incoming SIP connection from unknown peer to 41123456789") in new stack
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx.c: Executing [41123456789@from-sip-external:2] Set("SIP/xxx.xxx.xxx.xxx-00000001", "DID=41123456789") in new stack
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx.c: Executing [41123456789@from-sip-external:3] Goto("SIP/xxx.xxx.xxx.xxx-00000001", "s,1") in new stack
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx_builtins.c: Goto (from-sip-external,s,1)
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx.c: Executing [s@from-sip-external:1] GotoIf("SIP/xxx.xxx.xxx.xxx-00000001", "1?setlanguage:checkanon") in new stack
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx_builtins.c: Goto (from-sip-external,s,2)
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx.c: Executing [s@from-sip-external:2] Set("SIP/xxx.xxx.xxx.xxx-00000001", "CHANNEL(language)=fr") in new stack
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx.c: Executing [s@from-sip-external:3] GotoIf("SIP/xxx.xxx.xxx.xxx-00000001", "1?noanonymous") in new stack
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx_builtins.c: Goto (from-sip-external,s,5)
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx.c: Executing [s@from-sip-external:5] Set("SIP/xxx.xxx.xxx.xxx-00000001", "TIMEOUT(absolute)=15") in new stack
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] func_timeout.c: Channel will hangup at 2018-07-10 13:49:41.293 CEST.
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx.c: Executing [s@from-sip-external:6] Log("SIP/xxx.xxx.xxx.xxx-00000001", "WARNING,"Rejecting unknown SIP connection from xxx.xxx.xxx.xxx"") in new stack
[2018-07-10 13:49:26] WARNING[9335][C-00000001] Ext. s: "Rejecting unknown SIP connection from xxx.xxx.xxx.xxx"
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx.c: Executing [s@from-sip-external:7] Answer("SIP/xxx.xxx.xxx.xxx-00000001", "") in new stack
[2018-07-10 13:49:26] VERBOSE[9335][C-00000001] pbx.c: Executing [s@from-sip-external:8] Wait("SIP/xxx.xxx.xxx.xxx-00000001", "2") in new stack
[2018-07-10 13:49:28] VERBOSE[9335][C-00000001] pbx.c: Executing [s@from-sip-external:9] Playback("SIP/xxx.xxx.xxx.xxx-00000001", "ss-noservice") in new stack
[2018-07-10 13:49:28] VERBOSE[9335][C-00000001] file.c: <SIP/xxx.xxx.xxx.xxx-00000001> Playing 'ss-noservice.alaw' (language 'fr')
[2018-07-10 13:49:33] VERBOSE[9335][C-00000001] pbx.c: Executing [s@from-sip-external:10] PlayTones("SIP/xxx.xxx.xxx.xxx-00000001", "congestion") in new stack
[2018-07-10 13:49:33] VERBOSE[9335][C-00000001] pbx.c: Executing [s@from-sip-external:11] Congestion("SIP/xxx.xxx.xxx.xxx-00000001", "5") in new stack

It looks like it happens randomly, does anybody have an idea why?

Thanks for help,

The inbound SIP INVITE is not matching a configured trunk on your system, and is being treated as anonymous. It is probably originating from an IP other than what you have configured.

2 Likes

Thank you for your answer.

It is strange because I have set “srvlookup=yes” in “/etc/asterisk/sip_general_additional.conf” and configured the trunk like this:

[trunk]
type=peer
language=fr
host=provider.host
context=from-trunk
qualify=yes

I’ve cheched the SRV record “_sip._udp.provider.host” and it returns the IP that is rejected above.

Any idea ?

I wouldn’t rely on SRV working properly with chan_sip trunks. Either have separate chan_sip trunks for each record, or try PJSP with Asterisk 15 which does a better job with SRV.

Many of us have been bitten by the limitations of Chan_SIP when it comes to IP addresses. I’ve seen (in the past) where an IP addressed host would go down and lock up the PBX, even though there were other hosts available and working.

The practice I always advocate (it’s not “best”, it just works for me) is to set up a trunk definition for every possible inbound IP address for Chan_SIP. Chan_SIP doesn’t like to “reconnect” with a different address - it’s kind of “one and done”, so relying on anything other than a configured IP address isn’t always going to work, and your experience seems to mimic that.

Thank you, the solution was to create a trunk for every possible inbound IP address !

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.