IVR : Problem with extension (send to invalid extensions)


#1

Hello @everyone,

This my IVR syntax :

exten => ${WEBMASTER_IN},1,NoOp(## Incoming Call from ${CALLERID(all)} ##)
 same => n,GotoIfTime(9:00-13:00,mon-fri,*,*?incoming-open,s,1)
 same => n,GotoIfTime(14:00-18:00,mon-fri,*,*?incoming-open,s,1)
 same => n,Goto(incoming-closed,s,1)
 same => n(incoming-open),NoOp(## Call during the hours office ##)
 same => n,Ringing()
 same => n,System(echo "--appel_sortant --- callerid : ${CALLERID(num)} ---- ${STRFTIME(${EPOCH},,%Y/%m/%d %H:%M:%S)} ----" >> /var/spool/asterisk/log/debug.txt)
 same => n,Set(REC_FILE_NAME=OUT_${NOW}_${EXTEN}_${POSTE}.wav)
 same => n,MixMonitor(${REC_FILE_NAME},b V(1))
 same => n,Dial(PJSIP/100,20)
 same => n,VoiceMail(100@default)
 same => n,Hangup()
 same => n(incoming-closed),NoOp(## Call during hours office's closed ##)
 same => n,Playback(ivr/answering_file)
 same => n,VoiceMail(100@default,u)
 same => n,Handup()

But in the CLI console I have this message :

localhost*CLI>
  == Setting global variable 'SIPDOMAIN' to '91.180.9.84'
    -- Executing [028992018@from-external:1] NoOp("PJSIP/belgium-voip-0000008e", "## Incoming Call from "Arnold" <028085449> ##") in new stack
    -- Executing [028992018@from-external:2] GotoIfTime("PJSIP/belgium-voip-0000008e", "9:00-13:00,mon-fri,*,*?incoming-open,s,1") in new stack
    -- Executing [028992018@from-external:3] GotoIfTime("PJSIP/belgium-voip-0000008e", "14:00-18:00,mon-fri,*,*?incoming-open,s,1") in new stack
    -- Goto (incoming-open,s,1)
[Sep 13 14:57:15] WARNING[13060][C-0000004c]: pbx.c:4418 __ast_pbx_run: Channel 'PJSIP/belgium-voip-0000008e' sent to invalid extension but no invalid handler: context,exten,priority=incoming-open,s,1

Someone knows what’s happen here ?


#2

This what’s I have when I use the CLI with the command “pjsip set logger on”

<--- Received SIP request (1300 bytes) from UDP:188.66.8.19:5060 --->
INVITE sip:028992018@91.180.9.84:39748 SIP/2.0
Record-Route: <sip:188.66.8.19;lr=on>
Via: SIP/2.0/UDP 188.66.8.19;branch=z9hG4bK744e.0d0ac5aa9c8dcf45bc5eb9a860ee16d0.0
Via: SIP/2.0/UDP 188.66.8.52:5060;received=188.66.8.52;branch=z9hG4bK6c8add2d;rport=5060
Max-Forwards: 69
From: "Arnold" <sip:028085449@188.66.8.52>;tag=as452d14a8
To: <sip:028992018@91.180.9.84:39748>
Contact: <sip:028085449@188.66.8.52:5060>
Call-ID: 0bb6b96a2360fad523e9e2332acf0de8@188.66.8.52:5060
CSeq: 102 INVITE
User-Agent: 3StarsNet VoipSwitch
Date: Thu, 13 Sep 2018 13:23:41 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-Enswitch-Uniqueid: 1536845021.748849
Diversion: <sip:028992018@ast29>
Content-Type: application/sdp
Content-Length: 370
X-Enswitch-RURI: sip:028992018@91.180.9.84:39748
X-Enswitch-Source: 188.66.8.52:5060
X-Enswitch-External: yes

v=0
o=root 1525355514 1525355514 IN IP4 188.66.8.26
s=3StarsNet VoipSwitch
c=IN IP4 188.66.8.26
t=0 0
m=audio 13010 RTP/AVP 8 0 18 3 9 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:3 GSM/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=sdpmangled:yes

  == Setting global variable 'SIPDOMAIN' to '91.180.9.84'
<--- Transmitting SIP response (484 bytes) to UDP:188.66.8.19:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 188.66.8.19;rport=5060;received=188.66.8.19;branch=z9hG4bK744e.0d0ac5aa9c8dcf45bc5eb9a860ee16d0.0
Via: SIP/2.0/UDP 188.66.8.52:5060;rport=5060;received=188.66.8.52;branch=z9hG4bK6c8add2d
Record-Route: <sip:188.66.8.19;lr>
Call-ID: 0bb6b96a2360fad523e9e2332acf0de8@188.66.8.52:5060
From: "Arnold" <sip:028085449@188.66.8.52>;tag=as452d14a8
To: <sip:028992018@91.180.9.84>
CSeq: 102 INVITE
Server: Asterisk PBX 13.23.0
Content-Length:  0


    -- Executing [028992018@from-external:1] NoOp("PJSIP/belgium-voip-000000ba", "## Incoming Call from "Arnold" <028085449> ##") in new stack
    -- Executing [028992018@from-external:2] GotoIfTime("PJSIP/belgium-voip-000000ba", "9:00-13:00,mon-fri,*,*?incoming-open,s,1") in new stack
    -- Executing [028992018@from-external:3] GotoIfTime("PJSIP/belgium-voip-000000ba", "14:00-18:00,mon-fri,*,*?incoming-open,s,1") in new stack
    -- Goto (incoming-open,s,1)
[Sep 13 15:23:41] WARNING[13279][C-00000065]: pbx.c:4418 __ast_pbx_run: Channel 'PJSIP/belgium-voip-000000ba' sent to invalid extension but no invalid handler: context,exten,priority=incoming-open,s,1
<--- Transmitting SIP response (549 bytes) to UDP:188.66.8.19:5060 --->
SIP/2.0 603 Decline
Via: SIP/2.0/UDP 188.66.8.19;rport=5060;received=188.66.8.19;branch=z9hG4bK744e.0d0ac5aa9c8dcf45bc5eb9a860ee16d0.0
Via: SIP/2.0/UDP 188.66.8.52:5060;rport=5060;received=188.66.8.52;branch=z9hG4bK6c8add2d
Record-Route: <sip:188.66.8.19;lr>
Call-ID: 0bb6b96a2360fad523e9e2332acf0de8@188.66.8.52:5060
From: "Arnold" <sip:028085449@188.66.8.52>;tag=as452d14a8
To: <sip:028992018@91.180.9.84>;tag=2c57843f-1b49-4f6b-82c9-e8b85540a4cd
CSeq: 102 INVITE
Server: Asterisk PBX 13.23.0
Reason: Q.850;cause=0
Content-Length:  0


<--- Received SIP request (376 bytes) from UDP:188.66.8.19:5060 --->
ACK sip:028992018@91.180.9.84:39748 SIP/2.0
Via: SIP/2.0/UDP 188.66.8.19;branch=z9hG4bK744e.0d0ac5aa9c8dcf45bc5eb9a860ee16d0.0
Max-Forwards: 69
From: "Arnold" <sip:028085449@188.66.8.52>;tag=as452d14a8
To: <sip:028992018@91.180.9.84>;tag=2c57843f-1b49-4f6b-82c9-e8b85540a4cd
Call-ID: 0bb6b96a2360fad523e9e2332acf0de8@188.66.8.52:5060
CSeq: 102 ACK
Content-Length: 0

#3

You are attempting to send the calls to another context, instead of a label. Try the following:

 same => n,GotoIfTime(9:00-13:00,mon-fri,*,*?incoming-open)
 same => n,GotoIfTime(14:00-18:00,mon-fri,*,*?incoming-open)

#4

Yes, I make the two type. I add the context [incoming-open] and [incoming-closed]

[incoming-open]  ;============================================================= Call in hours work (09:00-13:00, 14:00-18:00)

exten => _${WEBMASTER_IN},1,NoOp(## Incoming Call from ${CALLERID(all)} ##)
 same => n,Ringing()
 same => n,System(echo "--appel_sortant --- callerid : ${CALLERID(num)} ---- ${STRFTIME(${EPOCH},,%Y/%m/%d %H:%M:%S)} ----" >> /var/spool/asterisk/log/debug.txt)
 same => n,Set(REC_FILE_NAME=OUT_${NOW}_${EXTEN}_${POSTE}.wav)
 same => n,MixMonitor(${REC_FILE_NAME},b V(1))
 same => n,Dial(PJSIP/100,20)
 same => n,VoiceMail(100@default)
 same => n,Hangup()

[incoming-closed]

exten => _${WEBMASTER_IN},1,NoOp(## Incoming Call from ${CALLERID(all)} ##)
 same => n,Playback(/ivr/answering_file)
 same => n,VoiceMail(100@default,u)
 same => n,Handup()

#5

With this syntax, this is work very well, why not with the context ?


#6

You are mixing two things together. In your original configuration it used dialplan labels[1] in the same context but you were trying to go to a different context. Now you are using separate contexts. They both do the same thing - just pick what works.

[1] http://asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/asterisk-DP-Basics-SECT-1.html#DialplanBasics_id262089


#7

I made this syntax:

exten => ${WEBMASTER_IN},1,NoOp(## Incoming Call from ${CALLERID(all)} ##)
 same => n,GotoIfTime(9:00-13:00,mon-fri,*,*?incoming-open,s,1)
 same => n,GotoIfTime(14:00-18:00,mon-fri,*,*?incoming-open,s,1)
 same => n,Goto(incoming-closed,s,1)
 same => n,Hangup()

This is will work with the contexts ? I try it, but not.


#8

Yes, it should work with separate contexts. If it doesn’t then you need to provide console output showing exactly what is going on.


#9

Actually you are using a variable for the extension… you most likely want to use “s”.

I’d also suggest reviewing dialplan basics.


#10

He do not change the “s” exten by the DID ?


#11

In the case of the incoming-open and incoming-closed context you are telling the logic to go to extension “s”. You don’t have an extension “s” currently in those contexts. This is basic dialplan fundamentals that you need to understand in order to really use Asterisk.


#12

So, if I replace the “s” by the ${WEBMASTER_IN}, this can be work. Good.


#13

Thank you for your advises @jcolp