SIP trunking number not in service

I setup a SIP trunk and I’m trying to get incoming calls to work, but when I call my SIP DID then I get “The number you are trying to call is not in service”. For troubleshooting purposes I enabled anonymous incoming sip calls, no luck even with that.

This is a fresh install with default configuration except for incoming routes, outgoing routes, and trunks, running Distro Version Stable-1.813.210.58.

Any ideas?

Do you have an inbound route set up?

Yep, already mentioned that in the original I have inbound and outbound routes configured. I have a dial prefix of 9 setup and on outgoing calls all I get is “Your call cannot be completed as dailed”

Some logs of calls would be helpful.

I deleted my POTS trunk, disabled dialing prefixes and now I got outgoing calling working… just incoming. I’m guess it’s an auth issue with my FreePBX blocking the IP of the SIP trunk, does that make sense?

Here’s the log…

[2012-06-21 10:13:11] VERBOSE[3093] netsock2.c: == Using SIP RTP TOS bits 184 [2012-06-21 10:13:11] VERBOSE[3093] netsock2.c: == Using SIP RTP CoS mark 5 [2012-06-21 10:13:11] VERBOSE[17628] pbx.c: -- Executing [[email protected]:1] Set("SIP/2405159583-00000014", "__FROM_DID=2042729555") in new stack [2012-06-21 10:13:11] VERBOSE[17628] pbx.c: -- Executing [[email protected]:2] NoOp("SIP/2405159583-00000014", "Received an unknown call with DID set to 2042729555") in new stack [2012-06-21 10:13:11] VERBOSE[17628] pbx.c: -- Executing [[email protected]:3] Goto("SIP/2405159583-00000014", "s,a2") in new stack [2012-06-21 10:13:11] VERBOSE[17628] pbx.c: -- Goto (from-trunk,s,2) [2012-06-21 10:13:11] VERBOSE[17628] pbx.c: -- Executing [[email protected]:2] Answer("SIP/2405159583-00000014", "") in new stack [2012-06-21 10:13:11] VERBOSE[17628] pbx.c: -- Executing [[email protected]:3] Wait("SIP/2405159583-00000014", "2") in new stack [2012-06-21 10:13:14] VERBOSE[17628] pbx.c: -- Executing [[email protected]:4] Playback("SIP/2405159583-00000014", "ss-noservice") in new stack [2012-06-21 10:13:14] VERBOSE[17628] file.c: -- Playing 'ss-noservice.ulaw' (language 'en') [2012-06-21 10:13:19] VERBOSE[17628] pbx.c: -- Executing [[email protected]:5] SayAlpha("SIP/2405159583-00000014", "2042729555") in new stack [2012-06-21 10:13:19] VERBOSE[17628] file.c: -- Playing 'digits/2.ulaw' (language 'en') [2012-06-21 10:13:19] VERBOSE[17628] file.c: -- Playing 'digits/0.ulaw' (language 'en') [2012-06-21 10:13:20] VERBOSE[17628] file.c: -- Playing 'digits/4.ulaw' (language 'en')

Are your firewall and SIP settings correct?

I have all standard RIP and SIP protocalls and ports forwarded - I have one external extension which is working perfectly.

UDP ports 5060, 5061, 10000-20000 are forwarded.

My VOIP providers web site is showing that it’s registering, and outgoing calling is now working with audio going both ways.

The call is hitting you, your trunk credentials don’t match.

You can turn on anonymous inbound and define an inbound route to prove my point.

Post your trunk configs (sanitize any passwords)

Turned on anonymous inbound, still getting “The number you have dialed is not in service”

Here is my config:

Trunk Name?: LES.net
Outbound CallerID?: 2042729555
CID Options?: Allow any CID
Maximum Channels?: 1
Disable Trunk?: Unchecked
Monitor Trunk Failures?: Unchecked
Dialed Number Manipulation Rules? None defined

Outgoing Settings

Trunk Name?: 2405159583
PEER Details?:
host=did.voip.les.net
context=from-trunk
type=friend
insecure=very
nat=yes
canreinvite=no
username=2405159583
secret=*********

Incoming Settings

USER Context?: from-trunk
USER Details?:
secret=*********
context=from-trunk
type=user
insecure=very
nat=yes
canreinvite=no

Registration

Register String?:
2405159583:*********@did.voip.les.net/2405159583

Did you setup the inbound route?

“Received an unknown call with DID set to 2042729555”) in new stack

As far as your trunks delete the inbound settings all together as they are duplicate to your outbound, remote the insecure=very (only used if no trunk credentials). That should put you closer.

Is your inbound DID set to 2042729555? The call is hitting you and from the logs the DID is 2042729555 (assuming you did not reproduce the entire log as I only see 204 spoken back to you in the log)

Cleared the settings that were suggested, went to inbound routes and cleared all DID and CID information (so it would match to any) and it works now. Also I disabled allowing anonymous incoming SIP calls and it still works!

Any idea why having the DID information in the inbound route prevents it from working?

What do you have in the DID and CID field? Must be making a simple mistake.

I assume when you say it is working you have a “catch all” route with bland DID and CID?

20427295555 in both fields, which I see is my error now because the caller ID didn’t match with the incoming call. For some reason I thought it was asking for the CID of the line. Hovering over the help tip might have saved some time.

Thanks for all your help everyone!

I have check and triple check all my setting…

Here is my cli log

I have inbound issues only no matter what i change or tweak it wont work.

The only way i get it to work is to do allow ANY DID in the inbound then it work

Here is the CLI with the DID

-- Executing [[email protected]:1] Set("SIP/VitelityINBOUND-00000006", "__FROM_DID=2673508770") in new stack
-- Executing [[email protected]:2] NoOp("SIP/VitelityINBOUND-00000006", "Received an unknown call with DID set to 2673508770") in new stack
-- Executing [[email protected]:3] Goto("SIP/VitelityINBOUND-00000006", "s,a2") in new stack
-- Goto (from-trunk,s,2)
-- Executing [[email protected]:2] Answer("SIP/VitelityINBOUND-00000006", "") in new stack
-- Executing [[email protected]:3] Wait("SIP/VitelityINBOUND-00000006", "2") in new stack
-- Executing [[email protected]:4] Playback("SIP/VitelityINBOUND-00000006", "ss-noservice") in new stack
-- <SIP/VitelityINBOUND-00000006> Playing 'ss-noservice.ulaw' (language 'en')

== Spawn extension (from-trunk, s, 4) exited non-zero on ‘SIP/VitelityINBOUND-00000006’
– Executing [[email protected]:1] Macro(“SIP/VitelityINBOUND-00000006”, “hangupcall,”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/VitelityINBOUND-00000006”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [[email protected]:3] ExecIf(“SIP/VitelityINBOUND-00000006”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [[email protected]:4] Hangup(“SIP/VitelityINBOUND-00000006”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/VitelityINBOUND-00000006’ in macro ‘hangupcall’
== Spawn extension (from-trunk, h, 1) exited non-zero on ‘SIP/VitelityINBOUND-00000006’

Here is the CLI with ANY DID

– Executing [[email protected]:1] NoOp(“SIP/VitelityINBOUND-00000007”, “Catch-All DID Match - Found 2673508770 - You probably want a DID for this.”) in new stack
– Executing [[email protected]:2] Goto(“SIP/VitelityINBOUND-00000007”, “ext-did,s,1”) in new stack
– Goto (ext-did,s,1)
– Executing [[email protected]:1] ExecIf(“SIP/VitelityINBOUND-00000007”, “1?Set(__FROM_DID=s)”) in new stack
– Executing [[email protected]:2] Gosub(“SIP/VitelityINBOUND-00000007”, “app-blacklist-check,s,1()”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/VitelityINBOUND-00000007”, “0?blacklisted”) in new stack
– Executing [[email protected]:2] Set(“SIP/VitelityINBOUND-00000007”, “CALLED_BLACKLIST=1”) in new stack
– Executing [[email protected]:3] Return(“SIP/VitelityINBOUND-00000007”, “”) in new stack
– Executing [[email protected]:3] Set(“SIP/VitelityINBOUND-00000007”, “CDR(did)=s”) in new stack
– Executing [[email protected]:4] ExecIf(“SIP/VitelityINBOUND-00000007”, “0 ?Set(CALLERID(name)=2152710800)”) in new stack
– Executing [[email protected]:5] Set(“SIP/VitelityINBOUND-00000007”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
– Executing [[email protected]:6] Set(“SIP/VitelityINBOUND-00000007”, “CALLERPRES()=allowed_not_screened”) in new stack
– Executing [[email protected]:7] Goto(“SIP/VitelityINBOUND-00000007”, “app-blackhole,musiconhold,1”) in new stack
– Goto (app-blackhole,musiconhold,1)
– Executing [[email protected]:1] NoOp(“SIP/VitelityINBOUND-00000007”, “Blackhole Dest: Put caller on hold forever”) in new stack
– Executing [[email protected]:2] Answer(“SIP/VitelityINBOUND-00000007”, “”) in new stack
– Executing [[email protected]:3] MusicOnHold(“SIP/VitelityINBOUND-00000007”, “”) in new stack

If you can get “ANY/ANY” to work, your problem is obviously an error in the DID field. You need to make sure your DID entry matches EXACTLY what the carrier is sending and you leave the CID field blank.

BF

Hi, I have the same problem.
In “ANY/ANY” Woorks OK, but when is with DID the call doesn’t work.

There is a stranger thing when I configure a Incoming Route in the debuggingand is the next.
To: sip:[email protected];user=phone;tag=as9999612a
That IP-Address “10.7.1.49” I don’t know from where come.
The IP-Address of my server is another and of the voip provider another too.

When is “ANY/ANY” that line is the next:
To: sip:[email protected];user=phone;tag=as9999612a

Does anybody know something about that IP?

Thanks and regards!!!

Hi, I have the same problem.
In “ANY/ANY” Woorks OK, but when is with DID the call doesn’t work.

There is a stranger thing when I configure a Incoming Route in the debuggingand is the next.
To: sip:004936479123123(a)10.7.1.49;user=phone;tag=as9999612a
That IP-Address “10.7.1.49” I don’t know from where come.
The IP-Address of my server is another and of the voip provider another too.

When is “ANY/ANY” that line is the next:
To: sip:004936479123123(a)sip.provider.net;user=phone;tag=as9999612a

Does anybody know something about that IP?

Thanks and regards!!!

whois 10.7.1.49

The following results may also be obtained via:

http://whois.arin.net/rest/nets;q=10.7.1.49?showDetails=true&showARIN=false&ext=netref2

NetRange: 10.0.0.0 - 10.255.255.255
CIDR: 10.0.0.0/8
OriginAS:
NetName: PRIVATE-ADDRESS-ABLK-RFC1918-IANA-RESERVED
NetHandle: NET-10-0-0-0-1
Parent:
NetType: IANA Special Use
Comment: This block is used as private address space.
Comment: Traffic from these addresses does not come from IANA.
Comment: IANA has simply reserved these numbers in its database
Comment: and does not use or operate them. We are not the source
Comment: of activity you may see on logs or in e-mail records.
Comment: Please refer to http://www.iana.org/abuse/
Comment:
Comment: Addresses from this block can be used by
Comment: anyone without any need to coordinate with
Comment: IANA or an Internet registry. Addresses from
Comment: this block are used in multiple, separately
Comment: operated networks.
Comment:
Comment: This block was assigned by the IETF in the
Comment: Best Current Practice document, RFC 1918
Comment: which can be found at:
Comment:
Comment: http://www.rfc-editor.org/rfc/rfc1918.txt
RegDate:
Updated: 2011-04-12
Ref: http://whois.arin.net/rest/net/NET-10-0-0-0-1

OrgName: Internet Assigned Numbers Authority
OrgId: IANA
Address: 12025 Waterfront Drive
Address: Suite 300
City: Los Angeles
StateProv: CA
PostalCode: 90292
Country: US
RegDate:
Updated: 2012-08-31
Ref: http://whois.arin.net/rest/org/IANA

OrgTechHandle: IANA-IP-ARIN
OrgTechName: Internet Corporation for Assigned Names and Number
OrgTechPhone: +1-310-301-5820
OrgTechEmail: [email protected]
OrgTechRef: http://whois.arin.net/rest/poc/IANA-IP-ARIN

OrgAbuseHandle: IANA-IP-ARIN
OrgAbuseName: Internet Corporation for Assigned Names and Number
OrgAbusePhone: +1-310-301-5820
OrgAbuseEmail: [email protected]
OrgAbuseRef: http://whois.arin.net/rest/poc/IANA-IP-ARIN

ARIN WHOIS data and services are subject to the Terms of Use

available at: https://www.arin.net/whois_tou.html

It is an address used for private networks and is not routable. Check with your VSP

Hi to all.

Thanks dicko for your report, but this didn’t helped to me anything. This is like if I ask why there is a egg in my fridge, when I haven’t put it there and you send me a copy of what is a egg from wikipedia…

Going to the important, I have found a posible solution to this problem, and normally, this is caused because the provider DON’T send the DID number.

The solution is adding the next to /etc/asterisk/extensions_custom.conf:

[custom-get-did-from-sip]
exten => s,1,Noop(Fixing DID using information from SIP TO header)
exten => s,n,Set(pseudodid=${SIP_HEADER(To)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,:,2)})
exten => s,n,Goto(from-trunk,${pseudodid},1)

In this moment I only have configured one sip account from the provider. I don’t know if with more accounts functions. I will test it and report.