Unable to route inbound calls to IVR

Hi,

I am using Asterisk 1.4.22 and FreePBX 2.5.1.0 to configure it.
I am able to make outbound calls but when an inbound calls arrives
it plays the anouncement "the number is not in service, see log below.

– Executing [7323204343@from-sip-external:1] NoOp(“SIP/5060-b7909450”, “Received incoming SIP connection from unknown peer to 7323204343”) in new stack
– Executing [7323204343@from-sip-external:2] Set(“SIP/5060-b7909450”, “DID=7323204343”) in new stack
– Executing [7323204343@from-sip-external:3] Goto(“SIP/5060-b7909450”, “s|1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [s@from-sip-external:1] GotoIf(“SIP/5060-b7909450”, “0?from-trunk|7323204343|1”) in new stack
– Executing [s@from-sip-external:2] Set(“SIP/5060-b7909450”, “TIMEOUT(absolute)=15”) in new stack
– Channel will hangup at 2008-12-19 17:26:12 UTC.
– Executing [s@from-sip-external:3] Answer(“SIP/5060-b7909450”, “”) in new stack
– Executing [s@from-sip-external:4] Wait(“SIP/5060-b7909450”, “2”) in new stack
– Executing [s@from-sip-external:5] Playback(“SIP/5060-b7909450”, “ss-noservice”) in new stack
– <SIP/5060-b7909450> Playing ‘ss-noservice’ (language ‘en’)
– Executing [s@from-sip-external:6] PlayTones(“SIP/5060-b7909450”, “congestion”) in new stack
– Executing [s@from-sip-external:7] Congestion(“SIP/5060-b7909450”, “5”) in new stack
== Spawn extension (from-sip-external, s, 7) exited non-zero on ‘SIP/5060-b7909450’
– Executing [h@from-sip-external:1] NoOp(“SIP/5060-b7909450”, “Hangup”) in new stack
– Executing [h@from-sip-external:2] Set(“SIP/5060-b7909450”, “DID=s”) in new stack
– Executing [h@from-sip-external:3] Goto(“SIP/5060-b7909450”, “s|1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [s@from-sip-external:1] GotoIf(“SIP/5060-b7909450”, “0?from-trunk|s|1”) in new stack
– Executing [s@from-sip-external:2] Set(“SIP/5060-b7909450”, “TIMEOUT(absolute)=15”) in new stack
– Channel will hangup at 2008-12-19 17:26:20 UTC.
– Executing [s@from-sip-external:3] Answer(“SIP/5060-b7909450”, “”) in new stack
== Spawn extension (from-sip-external, s, 3) exited non-zero on ‘SIP/5060-b7909450’

I have a basic IVR configured through FreePBX to which I would like to route the call.

Appreciate your help!!!

Thanks,
Irfan

do you have a SIP/5060 endpoint?

You need se setup an inbound route for the number 7323204343 otherwise it will try to find an extension with the same number. 5060 is the UDP/IP port used for the SIP control traffic.

I do have two inbound routes

(1) any DID/any CID
(2) 7323204343/any CID

Both are point to a basic IVR which I want to selecting pass to internal
extensions, 1- for admin , 2 - for IT …

The extension are all SIP with context as from-internal

[2001]
type=friend
secret=cbus2001
qualify=yes
port=5060
pickupgroup=
nat=yes
mailbox=2001@device
host=dynamic
dtmfmode=rfc2833
dial=SIP/2001
context=from-internal
canreinvite=no
callgroup=
callerid=device <2001>
accountcode=
call-limit=50

[2002]
type=friend
secret=cbus2002
qualify=yes
port=5060
pickupgroup=
nat=yes
mailbox=2002@default
host=dynamic
dtmfmode=rfc2833
dial=SIP/2002
context=from-internal
canreinvite=no
callgroup=
callerid=device <2002>
accountcode=
call-limit=50

The seems to be in from-sip-external context and the IVR does not have any context , so the question is , what do I have to do in the FreePBX GUI
to get it to route correctly.

I am sure somebody new must have definitely seen something lke this before.

Appreciate your help.

Thanks,
Irfan

It seems the problem with the authentication . Please go through this line…

Received incoming SIP connection from unknown peer to 7323204343")

Post your general section of sip.conf …

Thanks,
Agni

Agni,

I think this is somehow related to dialing plan , but anyway here is the sip.conf.

I am using FreePBX to manage the box so you will see that sip.conf
will just have include which have the real information.

File : sip.conf
#include sip_general_additional.conf
#include sip_nat.conf

File: sip_general_additional.conf

vmexten=*97
disallow=all
allow=ulaw
allow=alaw
context=from-sip-external
callerid=Unknown
notifyringing=yes
notifyhold=yes
limitonpeers=yes
tos_sip=cs3
tos_audio=ef
tos_video=af41

File: sip_nat.conf

localnet=X.Y.Z.42/255.255.255.0
externhost=A.B.C.com
externrefresh=10
fromdomain=B.C.com
nat=yes
qualify=yes
canreinvite

If possible add the bindaddr = 0.0.0.0 to sip general section of sip.conf and let me know the status.

Thanks,
Agni.

Actually the following lines in extensions.conf is causing the problem.
But I dont know how to fix it fro two reasons.

  1. I am using FreePBX so I have to fix thorugh FreePBX other the entries will get erased if I directly modify here.

  2. Second even when I find where to fix in FreePBX GUI I dont what is the right fix for this problem.

Appreciate your attention.
Thanks,

[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)

Did you verified this option: freepbx, general setting, allow anonymous SIP in=yes

Thanks

Agni,

Thanks a lot setting the Anonymous SIP to yes works.

Appreciate your help.

B.T.W a work-around I found on the FreePBX mailing list also works.
It is a poor fix which I dont understand what it exactly does but here it is.

Add the following below the [from-sip-external] context

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

Here is a link to complete details.

freepbx.org/support/document … nd-it-and-