Error with incoming calls "any DID / any CID"

Hey guys im having a problem with the incoming route any did / any cid.
When I make an incoming call the server says that the incoming call cannot be completed and no answer, it hangs up.

Here is the complete log that I see in the console:

-- Accepting call from '1155557500' to '2658' on channel 0/30, span 1
-- Executing Set("Zap/30-1", "DID=2658") in new stack
-- Executing Goto("Zap/30-1", "s|1") in new stack
-- Goto (from-zaptel,s,1)
-- Executing NoOp("Zap/30-1", "Entering from-zaptel with DID == 2658") in new stack
-- Executing Ringing("Zap/30-1", "") in new stack
-- Executing Set("Zap/30-1", "DID=2658") in new stack
-- Executing NoOp("Zap/30-1", "DID is now 2658") in new stack
-- Executing GotoIf("Zap/30-1", "1?zapok:notzap") in new stack
-- Goto (from-zaptel,s,8)
-- Executing NoOp("Zap/30-1", "Is a Zaptel Channel") in new stack
-- Executing Set("Zap/30-1", "CHAN=30-1") in new stack
-- Executing Set("Zap/30-1", "CHAN=30") in new stack
-- Executing Macro("Zap/30-1", "from-zaptel-30|2658|1") in new stack

Apr 16 16:53:13 WARNING[18046]: app_macro.c:208 macro_exec: No such context ‘macro-from-zaptel-30’ for macro ‘from-zaptel-30’
– Executing NoOp(“Zap/30-1”, “Returned from Macro from-zaptel-30”) in new stack
– Executing Goto(“Zap/30-1”, “from-pstn|2658|1”) in new stack
– Goto (from-pstn,2658,1)
– Executing ResetCDR(“Zap/30-1”, “”) in new stack
– Executing NoCDR(“Zap/30-1”, “”) in new stack
Apr 16 16:53:13 NOTICE[18046]: cdr.c:443 ast_cdr_free: CDR on channel ‘Zap/30-1’ not posted
Apr 16 16:53:13 NOTICE[18046]: cdr.c:445 ast_cdr_free: CDR on channel ‘Zap/30-1’ lacks end
– Executing Wait(“Zap/30-1”, “1”) in new stack
– Executing Playback(“Zap/30-1”, “silence/1&cannot-complete-as-dialed&check-number-dial-again|noanswer”) in new stack
– Playing ‘silence/1’ (language ‘es’)
– Playing ‘cannot-complete-as-dialed’ (language ‘es’)

Another problem is that the 7777 extension to test incoming calls is not working too.
Log:

– Executing Goto(“SIP/9001-09d0e720”, “from-pstn|7777|1”) in new stack
– Goto (from-pstn,7777,1)
– Executing Goto(“SIP/9001-09d0e720”, “from-pstn|7777|1”) in new stack
– Goto (from-pstn,7777,1)
… (it repets until I hang up the phone)

Please help, I don´t know if it is a bug o I am doing something wrong
I have just made an update and now have a FreePBX 2.7.0.1 with Trixbox 2.2.4
Zaptel 1.4.5, and a E1 Digium TE120P card

for starters, these are coming in on a PRI which is sending you DIDs so don’t send them to from-zaptel, set your context to from-pstn.

From there, if you have an any/any inbound route they should work. (They should either way but doing the above will clean things up and give you a clearer picture as to what is going on.).

If that change doesn’t help things, then you can post the new CLI trace with the from-zaptel stuff out of the picture to get a more clear idea what is going on.

try making a single context (probably type=peer), make sure you have the host= setup (and for security, you may want to sue permit/deny settings). You may need secure=port,invite on the configuration.

Hi, I am having the same problem, after changing in zapata.conf the parameter “context=from-zaptel” to "context=from-pstn"
does I need to change the context in other configuration files than zapata.conf?

Here is the CLI log after the change:

-- Accepting call from '1155557500' to '2658' on channel 0/5, span 1
-- Executing ResetCDR("Zap/5-1", "") in new stack
-- Executing NoCDR("Zap/5-1", "") in new stack

Apr 22 13:27:41 NOTICE[7115]: cdr.c:443 ast_cdr_free: CDR on channel ‘Zap/5-1’ no
t posted
Apr 22 13:27:41 NOTICE[7115]: cdr.c:445 ast_cdr_free: CDR on channel ‘Zap/5-1’ la
cks end
– Executing Wait(“Zap/5-1”, “1”) in new stack
– Executing Playback(“Zap/5-1”, “silence/1&cannot-complete-as-dialed&check-n
umber-dial-again|noanswer”) in new stack
– Playing ‘silence/1’ (language ‘es’)
– Playing ‘cannot-complete-as-dialed’ (language ‘es’)
– Playing ‘check-number-dial-again’ (language ‘es’)
– Executing Wait(“Zap/5-1”, “1”) in new stack
– Executing Congestion(“Zap/5-1”, “20”) in new stack

first off your trunk configuration does not appear to be right since the call is coming in as an anonymous SIP call so you probably want to fix that.

beyond that, the DID is coming in as 7810 and you don’t have an inbound route setup to receive 7810 so it is being rejected.

I am sorry but I don’t know the problem with my trunk, can you help because I am new to freepbx.
I just created a SIP trunk in the outgoing settings peer details,peer settings:
Trunk Name patton
username=
type=peer
secret=
host=192.168.19.119 (IP of the SmartNode)
and in the incoming settings:
user context PRI
type=user
secret=
context=from-trunk
regarding the DID inbound route what exactly you mean by that, should I create an inbound route and extension for every DID (meaning 30 Inbound routes and extensions)or what? please help???
on the other side, the Patton SmartNode 4960,should I configure something else to go to the SIP trunk I created?

Dear all;
can any body help me in finding the problem in my case, I have PRI line connected to Patton SmartNode 4960 and then to TrixBox2.6 with Asterisk 1.4.
I can make call from the trixbox outside but cannot receive incoming calls from outside.this is the output:

-- Executing [[email protected]:1] NoOp("SIP/5060-b7700468", "Received incoming SIP connection from unknown peer to 7810") in new stack
-- Executing [[email protected]:2] Set("SIP/5060-b7700468", "DID=7810") in new stack
-- Executing [[email protected]:3] Goto("SIP/5060-b7700468", "s|1") in new stack
-- Goto (from-sip-external,s,1)
-- Executing [[email protected]:1] GotoIf("SIP/5060-b7700468", "0?from-trunk|7810|1") in new stack
-- Executing [[email protected]:2] Set("SIP/5060-b7700468", "TIMEOUT(absolute)=15") in new stack
-- Channel will hangup at 2010-05-16 16:46:02 UTC.
-- Executing [[email protected]:3] Answer("SIP/5060-b7700468", "") in new stack
-- Executing [[email protected]:4] Wait("SIP/5060-b7700468", "2") in new stack
-- Executing [[email protected]:5] Playback("SIP/5060-b7700468", "ss-noservice") in new stack
-- <SIP/5060-b7700468> Playing 'ss-noservice' (language 'en')
-- Executing [[email protected]:6] PlayTones("SIP/5060-b7700468", "congestion") in new stack
-- Executing [[email protected]:7] Congestion("SIP/5060-b7700468", "5") in new stack

== Spawn extension (from-sip-external, s, 7) exited non-zero on ‘SIP/5060-b7700468’
– Executing [[email protected]:1] NoOp(“SIP/5060-b7700468”, “Hangup”) in new stack
– Executing [[email protected]:2] Set(“SIP/5060-b7700468”, “DID=s”) in new stack
– Executing [[email protected]:3] Goto(“SIP/5060-b7700468”, “s|1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [[email protected]:1] GotoIf(“SIP/5060-b7700468”, “0?from-trunk|s|1”) in new stack
– Executing [[email protected]:2] Set(“SIP/5060-b7700468”, “TIMEOUT(absolute)=15”) in new stack
– Channel will hangup at 2010-05-16 16:46:15 UTC.
– Executing [[email protected]:3] Answer(“SIP/5060-b7700468”, “”) in new stack
== Spawn extension (from-sip-external, s, 3) exited non-zero on 'SIP/5060-b7700468’
can any body help???

Dose any one have the SN4960 full configuration text file they can send me I cant get the incoming call to work but out going is fine.

I also had problems, but had to make changes in both the Patton and Trunk.

Trunk in Peer only:

username=patton
type=friend
secret= (your PW)
qualify=1200
insecure=very
host=192.168.51.10
dtmfmode=RFC2833
disallow=all
context=from-pstn
canreinvite=no
allow=ulaw

In Patton config for registration:

context cs switch
no shutdown

authentication-service AUTH_ASTERISK
realm 1 192.168.51.nnn (freepbx ip)
username patton password (your password)

location-service LOC_ASTERISK
domain 1 192.168.51.nnn 5060 (freepbx ip)

identity patton

authentication inbound
  authenticate 1 authentication-service AUTH_ASTERISK username patton

context sip-gateway GW_SIP

interface IF_GW_SIP
bind interface LAN context router port 5060

context sip-gateway GW_SIP
bind location-service LOC_ASTERISK
no shutdown

Hi all,

This is my PIAF and SmartNode config.

Cheers,

1* My IPPBX info:

.PBX in a Flash Version = 1.7.5.6 Running on HARDWARE

  • FreePBX Version = 2.8.1.4
  • Running Asterisk Version = 1.8.5.0
  • Asterisk Source Version = 1.8.5.0
  • Dahdi Source Version = 2.5.0+2.5.0
  • Libpri Source Version = 1.4.12
  • IP Address = 192.168.1.250 on eth0
  • Operating System = CentOS release 5.6 (Final)
  • Kernel Version = 2.6.18-238.9.1.el5 - 32 Bit

.Gateway SmartNode SN4524/2JS2JO/EUI

  • R5.7 2011-01-17 H323 SIP FXS FXO

2* Install step by step:

2.1** Trunk to SmartNode config:

  • Trunk Name: Trunk_PSTN
  • Outbound Caller ID: <012345678>
  • Dialed number Manipulation Rules: “9.” in box “match patten”
  • Trunk Name: SmartNode
    PEER Details:
  • canreinvite=no
  • context=from-pstn
  • dtmfmode=rfc2833
  • host=192.168.1.254
  • insecure=port,invite
  • qualify=yes
  • nat=no
  • port=5060
  • type=peer
  • allow=g729&ulaw
  • disallow=all

2.2** Outbound Routes config:

  • Route Name: PSTN_Outgoing
  • Dial Patterns that will use this Route: “9.” in box “match patten”
  • Trunk Sequence for Matched Routes: Trunk_PSTN

2.3** Inbound Routes config:

  • Description: PSTN_Incomming
  • Set Destination: Extensions 601 or IVR

2.4** Asterisk Sip Settings Settings:

  • NAT: Yes
  • IP Configuration: Static IP
  • SIP address remapping: Enabled using externaddr
  • External IP: 43.54.xxx.xxx (Public IP)
  • Localnet: 192.168.1.0/255.255.255.0
  • Codecs: ulaw,gsm,g729
  • Another config leave at default.

2.5** SmartNode config:

#----------------------------------------------------------------#

SN4524/2JS2JO/EUI

R5.7 2011-01-17 H323 SIP FXS FXO

2011-08-19T16:08:11

SN/00A0BA041C56

Generated configuration file

#----------------------------------------------------------------#

cli version 3.20
clock local default-offset +07:00
dns-client server 8.8.8.8
dns-relay
webserver port 80 language en
sntp-client
sntp-client server primary 129.132.2.21 port 123 version 4

system

ic voice 0
low-bitrate-codec g729

profile napt NAPT

profile ppp default

profile tone-set default

profile voip default
codec 1 g729 rx-length 20 tx-length 20
codec 2 g711ulaw64k rx-length 20 tx-length 20

profile pstn default
output-gain 5
input-gain 5

profile ringing-cadence default
play 1 1000
pause 2 4000

profile sip default
no autonomous-transitioning

profile dhcp-server DHCP
network 172.16.3.0 255.255.255.0
include 1 172.16.3.10 172.16.3.99
lease 2 hours
default-router 1 172.16.3.1
domain-name-server 1 172.16.3.1

profile aaa default
method 1 local
method 2 none

context ip router

interface eth0
ipaddress 192.168.1.254 255.255.255.0
use profile napt NAPT
tcp adjust-mss rx mtu
tcp adjust-mss tx mtu

interface eth1
ipaddress 172.16.3.1 255.255.255.0
tcp adjust-mss rx mtu
tcp adjust-mss tx mtu

context ip router
dhcp-server use profile DHCP
route 0.0.0.0 0.0.0.0 192.168.1.1 0

context cs switch
digit-collection timeout 2
address-completion timeout 5

routing-table called-e164 RT_FROM_PIAF
route 6004 dest-interface IF_FXS_00
route 6005 dest-interface IF_FXS_01
route 901.T3 dest-service HG_FXO DEL_9
route 908.T3 dest-service HG_FXO DEL_9
route 99… dest-service HG_FXO DEL_9
route 919.T3 dest-service HG_FXO DEL_9
route 9[2-7].T3 dest-service HG_FXO DEL_9
route 90[2-7].T3 dest-service HG_FXO ADD_686

routing-table called-e164 RT_TO_PAIF
route default dest-interface IF_SIP_PIAF

routing-table called-e164 RT_FROM_FXS
route .T3 dest-interface IF_SIP_PIAF

mapping-table called-e164 to called-e164 DEL_9
map 9(.%) to \1

mapping-table called-e164 to called-e164 ADD_686
map 9(.%) to 686\1

interface sip IF_SIP_PIAF
bind context sip-gateway Trunk_PIAF
route call dest-table RT_FROM_PIAF
remote 192.168.1.250 5060
early-connect
early-disconnect

interface fxs IF_FXS_00
route call dest-table RT_FROM_FXS
no call-hold
no call-waiting
caller-id-presentation mid-ring
subscriber-number 6004

interface fxs IF_FXS_01
route call dest-table RT_FROM_FXS
no call-hold
no call-waiting
caller-id-presentation mid-ring
subscriber-number 6005

interface fxo IF_FXO_00
route call dest-table RT_TO_PAIF
disconnect-signal battery-reversal
disconnect-signal loop-break
disconnect-signal busy-tone
dial-after timeout 1
mute-dialing

interface fxo IF_FXO_01
route call dest-table RT_TO_PAIF
disconnect-signal battery-reversal
disconnect-signal loop-break
disconnect-signal busy-tone
dial-after timeout 1
mute-dialing

service hunt-group HG_FXO
drop-cause normal-unspecified
drop-cause no-circuit-channel-available
drop-cause network-out-of-order
drop-cause temporary-failure
drop-cause switching-equipment-congestion
drop-cause access-info-discarded
drop-cause circuit-channel-not-available
drop-cause resources-unavailable
drop-cause user-busy
route call 1 dest-interface IF_FXO_00
route call 2 dest-interface IF_FXO_01

context cs switch
no shutdown

authentication-service AUS_Exts
username 6004 password 6004abcd
username 6005 password 6005abcd

location-service LS_Exts
domain 1 192.168.1.250 5060

identity-group default

registration outbound
  registrar 192.168.1.250 5060
  proxy 1 192.168.1.250 5060
  lifetime 3600
  register auto
  retry-timeout on-system-error 10
  retry-timeout on-client-error 10
  retry-timeout on-server-error 10

identity 6004 inherits default

authentication outbound
  authenticate 1 authentication-service AUS_Exts username 6004

identity 6005 inherits default

authentication outbound
  authenticate 1 authentication-service AUS_Exts username 6005

context sip-gateway Trunk_PIAF

interface PIAF_Sip_Interface
bind interface eth0 context router port 5060

context sip-gateway Trunk_PIAF
bind location-service LS_Exts
no shutdown

port ethernet 0 0
medium auto
encapsulation ip
bind interface eth0 router
no shutdown

port ethernet 0 1
medium auto
encapsulation ip
bind interface eth1 router
no shutdown

port fxs 0 0
encapsulation cc-fxs
bind interface IF_FXS_00 switch
no shutdown

port fxs 0 1
encapsulation cc-fxs
bind interface IF_FXS_01 switch
no shutdown

port fxo 0 0
encapsulation cc-fxo
bind interface IF_FXO_00 switch
no shutdown

port fxo 0 1
encapsulation cc-fxo
bind interface IF_FXO_01 switch
no shutdown