DID routing - how does it work?

tdnnash25

New Member
Joined
Apr 16, 2009
Messages
74
Reaction score
0
Need help setting up incoming route ...

I just purchased a DID through my sip trunk provider, voipvoip.com ... my question is: When someone dials my new DID, how does it get routed to my Asterisk Device? I have a trunk setup to them for outbound and inbound. But, doesn't *something* have to route the call to my IP address or something? Wouldn't this be something on their side?? Their support is sorta slow and I think probably closed right now ... just looking for some tips before Monday.
 
When you set up the trunk, it registers to the upstream carrier (in your case VoipVoip).

This registration tells the upstream carrier where to find you in the case of a call or other SIP request by IP address.

So when someone calls you, this is what happens.

PSTN number 610-555-1234 --> VoipVoip's upstream carrier --> VoipVoip --> VoipVoip's registration server --> Your Asterisk server --> Whatever inbound route you specify.

Hope this helps. If I got anything wrong in here, please correct me somebody.
 
I need some help setting up my incoming route ...

When you set up the trunk, it registers to the upstream carrier (in your case VoipVoip).

This registration tells the upstream carrier where to find you in the case of a call or other SIP request by IP address.

So when someone calls you, this is what happens.

PSTN number 610-555-1234 --> VoipVoip's upstream carrier --> VoipVoip --> VoipVoip's registration server --> Your Asterisk server --> Whatever inbound route you specify.

Hope this helps. If I got anything wrong in here, please correct me somebody.


Thanks ... I tailed my asterisk log (/var/log/asterisk/full) while I attempted to call my new DID. I see incoming traffic, so the DID routing is working. However, I must have something wrong in my PIAF config. I tried to set the Destination of my incoming route to one of my extensions ... I also tried sending it to a conference I setup through Meetme. However, both fail. I'm pasting my logs in case anyone can help ...

[2009-05-02 20:58:46] VERBOSE[7158] logger.c: -- Executing [5557029890@from-sip-external:1] NoOp("SIP/5557029890-09835ba0", "Received incoming SIP connection from unknown peer to 5557029890") in new stack
[2009-05-02 20:58:46] VERBOSE[7158] logger.c: -- Executing [5557029890@from-sip-external:2] Set("SIP/5557029890-09835ba0", "DID=5557029890") in new stack
[2009-05-02 20:58:46] VERBOSE[7158] logger.c: -- Executing [5557029890@from-sip-external:3] Goto("SIP/5557029890-09835ba0", "s|1") in new stack
[2009-05-02 20:58:46] VERBOSE[7158] logger.c: -- Goto (from-sip-external,s,1)
[2009-05-02 20:58:46] VERBOSE[7158] logger.c: -- Executing [s@from-sip-external:1] GotoIf("SIP/5557029890-09835ba0", "0?from-trunk|5557029890|1") in new stack
[2009-05-02 20:58:46] VERBOSE[7158] logger.c: -- Executing [s@from-sip-external:2] Set("SIP/5557029890-09835ba0", "TIMEOUT(absolute)=15") in new stack
[2009-05-02 20:58:46] VERBOSE[7158] logger.c: -- Channel will hangup at 2009-05-03 01:59:01 UTC.
[2009-05-02 20:58:46] VERBOSE[7158] logger.c: -- Executing [s@from-sip-external:3] Answer("SIP/5557029890-09835ba0", "") in new stack
[2009-05-02 20:58:46] VERBOSE[7158] logger.c: -- Executing [s@from-sip-external:4] Wait("SIP/5557029890-09835ba0", "2") in new stack
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: -- Executing [s@from-sip-external:5] Playback("SIP/5557029890-09835ba0", "ss-noservice") in new stack
[2009-05-02 20:58:48] WARNING[7158] channel.c: Unable to find a codec translation path from g729 to gsm
[2009-05-02 20:58:48] WARNING[7158] file.c: Unable to open ss-noservice (format 0x100 (g729)): No such file or directory
[2009-05-02 20:58:48] WARNING[7158] app_playback.c: ast_streamfile failed on SIP/5557029890-09835ba0 for ss-noservice
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: -- Executing [s@from-sip-external:6] PlayTones("SIP/5557029890-09835ba0", "congestion") in new stack
[2009-05-02 20:58:48] WARNING[7158] channel.c: Unable to find a codec translation path from g729 to slin
[2009-05-02 20:58:48] WARNING[7158] indications.c: Unable to set 'SIP/5557029890-09835ba0' to signed linear format (write)
[2009-05-02 20:58:48] NOTICE[7158] res_indications.c: Unable to start playtones
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: == Spawn extension (from-sip-external, s, 6) exited non-zero on 'SIP/5557029890-09835ba0'
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: -- Executing [h@from-sip-external:1] NoOp("SIP/5557029890-09835ba0", "Hangup") in new stack
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: -- Executing [h@from-sip-external:2] Set("SIP/5557029890-09835ba0", "DID=s") in new stack
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: -- Executing [h@from-sip-external:3] Goto("SIP/5557029890-09835ba0", "s|1") in new stack
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: -- Goto (from-sip-external,s,1)
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: -- Executing [s@from-sip-external:1] GotoIf("SIP/5557029890-09835ba0", "0?from-trunk|s|1") in new stack
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: -- Executing [s@from-sip-external:2] Set("SIP/5557029890-09835ba0", "TIMEOUT(absolute)=15") in new stack
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: -- Channel will hangup at 2009-05-03 01:59:03 UTC.
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: -- Executing [s@from-sip-external:3] Answer("SIP/5557029890-09835ba0", "") in new stack
[2009-05-02 20:58:48] VERBOSE[7158] logger.c: == Spawn extension (from-sip-external, s, 3) exited non-zero on 'SIP/5557029890-09835ba0'


For what it's worth ... I setup my trunk's incoming settings in accordance to voipvoip's configuration guide for Asterisk. So, I'm pretty confident it isn't the problem. I think the call is hitting my server, but my server doesn't know what to do with it.
 
Do you have g729 codec installed on your server? If not, turn it off everywhere. At your provider, and all your telephones.

Check your sip_custom.conf, you should have settings something like this:

disallow=all

allow=g729
allow=gsm
allow=ulaw
allow=alaw

If your server doesn't have the g729 codec, you must not have an allow statement for it.

Check your trunk configuration - make sure you arent using g729 there.

If you do believe you have g729 on your server - you should check into your license - it might not have gotten applied correctly.
 
nothing in that config file

Do you have g729 codec installed on your server? If not, turn it off everywhere. At your provider, and all your telephones.

Check your sip_custom.conf, you should have settings something like this:

disallow=all

allow=g729
allow=gsm
allow=ulaw
allow=alaw

If your server doesn't have the g729 codec, you must not have an allow statement for it.

Check your trunk configuration - make sure you arent using g729 there.

If you do believe you have g729 on your server - you should check into your license - it might not have gotten applied correctly.


sip_custom.conf only has srvlookup = no, which I added about 30 minutes ago since I thought I needed to have it ... other than that it is empty ... how else can I find out if g729 is installed on my server ... I'm leaving the forum for the night. Hopefully I'll have something to read and try tomorrow ;) Thanks!
 
If you didnt add g729 - its not there. (Its not added by default.)

Try adding this to sip_custom.conf, then reread configs. Then, try a test call.

disallow=all
allow=gsm
allow=ulaw
allow=alaw
 
still not working

If you didnt add g729 - its not there. (Its not added by default.)

Try adding this to sip_custom.conf, then reread configs. Then, try a test call.

disallow=all
allow=gsm
allow=ulaw
allow=alaw

Alright, I tried this and it didn't work. I then reverted. Then I just removed g729 from mt trunk. Now when I call my DID, I get a message "The phone number you dialed is not in service". I can see the SIP traffic hitting my PIAF box, so I know the DID is in service. My logs:

Webmeetme
[2009-05-04 09:28:29] VERBOSE[3692] logger.c: -- Executing [s@from-sip-external:3] Answer("SIP/5557029890-093baba8", "") in new stack
[2009-05-04 09:28:29] VERBOSE[3692] logger.c: -- Executing [s@from-sip-external:4] Wait("SIP/5557029890-093baba8", "2") in new stack
[2009-05-04 09:28:31] VERBOSE[3692] logger.c: -- Executing [s@from-sip-external:5] Playback("SIP/5557029890-093baba8", "ss-noservice") in new stack
[2009-05-04 09:28:31] VERBOSE[3692] logger.c: -- <SIP/5557029890-093baba8> Playing 'ss-noservice' (language 'en')
[2009-05-04 09:28:36] VERBOSE[3692] logger.c: -- Executing [s@from-sip-external:6] PlayTones("SIP/5557029890-093baba8", "congestion") in new stack
[2009-05-04 09:28:36] VERBOSE[3692] logger.c: -- Executing [s@from-sip-external:7] Congestion("SIP/5557029890-093baba8", "5") in new stack
[2009-05-04 09:28:40] VERBOSE[3692] logger.c: == Spawn extension (from-sip-external, s, 7) exited non-zero on 'SIP/5557029890-093baba8'
[2009-05-04 09:28:40] VERBOSE[3692] logger.c: -- Executing [h@from-sip-external:1] NoOp("SIP/5557029890-093baba8", "Hangup") in new stack
[2009-05-04 09:28:40] VERBOSE[3692] logger.c: -- Executing [h@from-sip-external:2] Set("SIP/5557029890-093baba8", "DID=s") in new stack
[2009-05-04 09:28:40] VERBOSE[3692] logger.c: -- Executing [h@from-sip-external:3] Goto("SIP/5557029890-093baba8", "s|1") in new stack
[2009-05-04 09:28:40] VERBOSE[3692] logger.c: -- Goto (from-sip-external,s,1)
[2009-05-04 09:28:40] VERBOSE[3692] logger.c: -- Executing [s@from-sip-external:1] GotoIf("SIP/5557029890-093baba8", "0?from-trunk|s|1") in new stack
[2009-05-04 09:28:40] VERBOSE[3692] logger.c: -- Executing [s@from-sip-external:2] Set("SIP/5557029890-093baba8", "TIMEOUT(absolute)=15") in new stack
[2009-05-04 09:28:40] VERBOSE[3692] logger.c: -- Channel will hangup at 2009-05-04 14:28:55 UTC.
[2009-05-04 09:28:40] VERBOSE[3692] logger.c: -- Executing [s@from-sip-external:3] Answer("SIP/5557029890-093baba8", "") in new stack
 
confused

Maybe I just don't have a dialplan setup for this? I'm still very new to Asterisk, so I don't know for sure.
 
from-sip-external

If you didnt add g729 - its not there. (Its not added by default.)

Try adding this to sip_custom.conf, then reread configs. Then, try a test call.

disallow=all
allow=gsm
allow=ulaw
allow=alaw


Could my problem be in here somewhere? This is from extensions.conf ... there isn't anything in extensions_custom.conf for from-sip-external ... should there be?

[from-sip-external]
;give external sip users congestion and hangup
; Yes. This is _really_ meant to be _. - I know asterisk whinges about it, but
; I do know what I'm doing. This is correct.
exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN})
exten => _.,n,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})})
exten => _.,n,Goto(s,1)
exten => s,1,GotoIf($["${ALLOW_SIP_ANON}"="yes"]?from-trunk,${DID},1)
exten => s,n,Set(TIMEOUT(absolute)=15)
exten => s,n,Answer
exten => s,n,Wait(2)
exten => s,n,Playback(ss-noservice)
exten => s,n,Playtones(congestion)
exten => s,n,Congestion(5)
exten => h,1,NoOp(Hangup)
exten => i,1,NoOp(Invalid)
exten => t,1,NoOp(Timeout)
 
My view, based on your previous post and this one (which probably says the same thing but your log snippet starts a few lines too late) is the "call from an unknown peer" is causing this. What you fixed with the codec allows you to now hear the message it was trying to send before.

We've established that you are "registered" with your provider. Did you create an "Inbound Route" for this DID? If not, go to the "Inbound Routes" tab in FreePBX and create one for the DID you received. In that route setting, just point it to an extension on your system. Then submit it, reload, and try again. (All you need for a simple route is the DID and an extension to ring.)

Your thread is titled "DID routing - how does it work?" - the answer is in the Inbound Routes tab.

Jeff
 
My view, based on your previous post and this one (which probably says the same thing but your log snippet starts a few lines too late) is the "call from an unknown peer" is causing this. What you fixed with the codec allows you to now hear the message it was trying to send before.

We've established that you are "registered" with your provider. Did you create an "Inbound Route" for this DID? If not, go to the "Inbound Routes" tab in FreePBX and create one for the DID you received. In that route setting, just point it to an extension on your system. Then submit it, reload, and try again. (All you need for a simple route is the DID and an extension to ring.)

Your thread is titled "DID routing - how does it work?" - the answer is in the Inbound Routes tab.

Jeff

Okay, I've got some more information for you. If "allow anonymous calls" is checked I receive the call to my extension. If it is not checked, I get the "Phone number not in service...." error message. I did create an inbound route. For the DID I've tried my actual DID as well as my account number with my VSP, but neither worked. As for making sure I have the Incoming Route correct, all I did was click "Inbound Routes" > Set the DID > and set the extension for it to ring to > Clicked Submit > Reloaded > I even did an amportal restart .... any other ideas?
 

Members online

No members online now.

Forum statistics

Threads
26,686
Messages
174,407
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top