Inbound routes not working

Hi,

I’m using Asterisk@home with an auto attendant. I’ve created inbound routes using the GUI, however they do not seem to work, as I always get the auto attendant. I’ve routed my PSTN connection to use the auto attendant for inbound calls, but I’ve created a sip trunk and wish to use the DID provided on that line to ring an extension. However, no matter what I do, the auto attendant picks up when I dial my sip DID from outside. I’ll post some of my extensions.conf so ppl can have a quick look. I think the problem may be related to the expression I use for the auto attendant (_.)? When I check the logs it’s as if the call is being intercepted by the AA macro [from-pstn-timecheck] before it makes it to the direct extension I want it to ring, and so the auto attendant answers instead.

[from-trunk]
include => from-pstn

[from-pstn]
include => from-pstn-custom
include => ext-did
include => from-pstn-timecheck
exten => fax,1,Goto(ext-fax,in_fax,1)

[from-pstn-timecheck]
exten => _.,1,Goto(s,1) ; catch-all matching for calls that have DID info (if a DID route hasn’t matched them)
exten => s,1,GotoIf($[${IN_OVERRIDE} = forcereghours]?from-pstn-reghours,s,1:)
exten => s,2,GotoIf($[${IN_OVERRIDE} = forceafthours]?from-pstn-afthours,s,1:)
exten => s,3,GotoIfTime(${REGTIME}|${REGDAYS}||?from-pstn-reghours,s,1:)
exten => s,4,Goto(from-pstn-afthours,s,1)

[from-pstn-reghours]
exten => s,1,GotoIf($[${FAX_RX} = disabled]?from-pstn-reghours-nofax,s,1:2)
exten => s,2,Answer
exten => s,3,Wait(1)
exten => s,4,SetVar(intype=${INCOMING})
exten => s,5,Cut(intype=intype,-,1)
exten => s,6,GotoIf($[${intype} = EXT]?7:9)
exten => s,7,Wait(3)
exten => s,8,Goto(ext-local,${INCOMING:4},1)
exten => s,9,GotoIf($[${intype} = GRP]?10:12)
exten => s,10,Wait(3)
exten => s,11,Goto(ext-group,${INCOMING:4},1)
exten => s,12,GotoIf($[${intype} = QUE]?13:15)
exten => s,13,Wait(3)
exten => s,14,Goto(ext-queues,${INCOMING:4},1)
exten => s,15,Goto(${INCOMING},s,1)
exten => fax,1,Goto(ext-fax,in_fax,1)
exten => h,1,Hangup

[from-pstn-reghours-nofax]
exten => s,1,SetVar(intype=${INCOMING})
exten => s,2,Cut(intype=intype,-,1)
exten => s,3,GotoIf($[${intype} = EXT]?4:5)
exten => s,4,Goto(ext-local,${INCOMING:4},1)
exten => s,5,GotoIf($[${intype} = GRP]?6:7)
exten => s,6,Goto(ext-group,${INCOMING:4},1)
exten => s,7,GotoIf($[${intype} = QUE]?8:11)
exten => s,8,Answer
exten => s,9,Wait(1)
exten => s,10,Goto(ext-queues,${INCOMING:4},1)
exten => s,11,Answer
exten => s,12,Wait(1)
exten => s,13,Goto(${INCOMING},s,1)
exten => h,1,Hangup

[from-pstn-afthours]
exten => s,1,GotoIf($[${FAX_RX} = disabled]?from-pstn-afthours-nofax,s,1:2)
exten => s,2,Answer
exten => s,3,Wait(1)
exten => s,4,SetVar(intype=${AFTER_INCOMING})
exten => s,5,Cut(intype=intype,-,1)
exten => s,6,GotoIf($[${intype} = EXT]?7:9)
exten => s,7,Wait(3)
exten => s,8,Goto(ext-local,${AFTER_INCOMING:4},1)
exten => s,9,GotoIf($[${intype} = GRP]?10:12)
exten => s,10,Wait(3)
exten => s,11,Goto(ext-group,${AFTER_INCOMING:4},1)
exten => s,12,GotoIf($[${intype} = QUE]?13:15)
exten => s,13,Wait(3)
exten => s,14,Goto(ext-queues,${AFTER_INCOMING:4},1)
exten => s,15,Goto(${AFTER_INCOMING},s,1) ; not EXT or GR1 - it’s an auto attendant
exten => fax,1,Goto(ext-fax,in_fax,1)
exten => h,1,Hangup

[from-pstn-afthours-nofax]
exten => s,1,SetVar(intype=${AFTER_INCOMING})
exten => s,2,Cut(intype=intype,-,1)
exten => s,3,GotoIf($[${intype} = EXT]?4:5) ; If INCOMING starts with EXT, then assume its an extension
exten => s,4,Goto(ext-local,${AFTER_INCOMING:4},1)
exten => s,5,GotoIf($[${intype} = GRP]?6:7) ; If INCOMING starts with GRP, then assume its a ring group
exten => s,6,Goto(ext-group,${AFTER_INCOMING:4},1)
exten => s,7,GotoIf($[${intype} = QUE]?8:11) ;queue
exten => s,8,Answer ; answer call before queue
exten => s,9,Wait(1)
exten => s,10,Goto(ext-queues,${AFTER_INCOMING:4},1)
exten => s,11,Answer ; answer call before auto attendant
exten => s,12,Wait(1)
exten => s,13,Goto(${AFTER_INCOMING},s,1) ; not EXT or GR1 - it’s an auto attendant
exten => h,1,Hangup

where does sip.conf say the call will “enter” extensions.conf ? it will either be defined for the trunk/user you have setup or in [general].

from there you can establish what information is being passed to your system by your provider and you can setup routing from there.

btw, “_.” is not good. i bet Asterisk throws a warning on every reload for that extension !