Inbound calls to voicemail introducing other issue

Thanks to @longqvo & @lgaetz for all the work getting external calls to classrooms routed to voicemail during school hours!

However, this extensions_custom.conf seems to break the ability to test inbound routes with 7777. I’m new to FreePBX and Asterisk so I’m curious if anyone can help with figuring this one out. When dialing 7777 I get the following in the logs:

Channel 'PJSIP/1310-00000033' sent to invalid extension but no invalid handler: context,exten,priority=from-did-direct-continue,7777,1

Here is the complete log when dialing 7777 from internal extension 1310:

43403	[2023-12-07 11:54:16] VERBOSE[28281] netsock2.c: Using SIP RTP Audio TOS bits 184	
43404	[2023-12-07 11:54:16] VERBOSE[28281] netsock2.c: Using SIP RTP Audio TOS bits 184 in TCLASS field.	
43405	[2023-12-07 11:54:16] VERBOSE[28281] netsock2.c: Using SIP RTP Audio CoS mark 5	
43406	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [7777@from-internal:1] Macro("PJSIP/1310-00000035", "user-callerid,") in new stack	
43407	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:1] Set("PJSIP/1310-00000035", "TOUCH_MONITOR=1701968056.107") in new stack	
43408	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:2] Set("PJSIP/1310-00000035", "CHANCONTEXT=") in new stack	
43409	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:3] Progress("PJSIP/1310-00000035", "") in new stack	
43410	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:4] Set("PJSIP/1310-00000035", "CHANCONTEXT=") in new stack	
43411	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:5] Set("PJSIP/1310-00000035", "CHANEXTENCONTEXT=1310-00000035") in new stack	
43412	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:6] Set("PJSIP/1310-00000035", "CHANEXTEN=1310-00000035") in new stack	
43413	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:7] Set("PJSIP/1310-00000035", "CALLERID(number)=1310") in new stack	
43414	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:8] Set("PJSIP/1310-00000035", "AMPUSER=1310") in new stack	
43415	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:9] Set("PJSIP/1310-00000035", "HOTDESCKCHAN=1310-00000035") in new stack	
43416	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:10] Set("PJSIP/1310-00000035", "HOTDESKEXTEN=1310") in new stack	
43417	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:11] Set("PJSIP/1310-00000035", "HOTDESKCALL=0") in new stack	
43418	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:12] ExecIf("PJSIP/1310-00000035", "0?Set(HOTDESKCALL=1)") in new stack	
43419	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:13] ExecIf("PJSIP/1310-00000035", "0?Set(CALLERID(name)=)") in new stack	
43420	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:14] GotoIf("PJSIP/1310-00000035", "0?report") in new stack	
43421	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:15] ExecIf("PJSIP/1310-00000035", "1?Set(REALCALLERIDNUM=1310)") in new stack	
43422	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:16] Set("PJSIP/1310-00000035", "AMPUSER=1310") in new stack	
43423	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:17] GotoIf("PJSIP/1310-00000035", "0?limit") in new stack	
43424	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:18] Set("PJSIP/1310-00000035", "AMPUSERCIDNAME=Alix Greenawalt") in new stack	
43425	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:19] ExecIf("PJSIP/1310-00000035", "0?Set(__CIDMASQUERADING=TRUE)") in new stack	
43426	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:20] GotoIf("PJSIP/1310-00000035", "0?report") in new stack	
43427	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:21] Set("PJSIP/1310-00000035", "AMPUSERCID=1310") in new stack	
43428	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:22] Set("PJSIP/1310-00000035", "__DIAL_OPTIONS=HhTtr") in new stack	
43429	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:23] Set("PJSIP/1310-00000035", "CALLERID(all)="Alix Greenawalt" <1310>") in new stack	
43430	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:24] ExecIf("PJSIP/1310-00000035", "0?Set(CUSDIAL=)") in new stack	
43431	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:25] ExecIf("PJSIP/1310-00000035", "0?Set(CALLERID(all)="Alix Greenawalt" <1310>)") in new stack	
43432	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:26] GotoIf("PJSIP/1310-00000035", "0?limit") in new stack	
43433	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:27] ExecIf("PJSIP/1310-00000035", "0?Set(GROUP(concurrency_limit)=1310)") in new stack	
43434	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:28] ExecIf("PJSIP/1310-00000035", "0?Set(CHANNEL(language)=)") in new stack	
43435	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:29] NoOp("PJSIP/1310-00000035", "Macro Depth is 1") in new stack	
43436	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:30] GotoIf("PJSIP/1310-00000035", "1?report2:macroerror") in new stack	
43437	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx_builtins.c: Goto (macro-user-callerid,s,31)	
43438	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:31] GotoIf("PJSIP/1310-00000035", "0?continue") in new stack	
43439	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:32] ExecIf("PJSIP/1310-00000035", "1?Set(__CALLEE_ACCOUNCODE=)") in new stack	
43440	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:33] Set("PJSIP/1310-00000035", "__TTL=64") in new stack	
43441	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:34] GotoIf("PJSIP/1310-00000035", "1?continue") in new stack	
43442	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx_builtins.c: Goto (macro-user-callerid,s,50)	
43443	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:50] Set("PJSIP/1310-00000035", "CALLERID(number)=1310") in new stack	
43444	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:51] Set("PJSIP/1310-00000035", "CALLERID(name)=Alix Greenawalt") in new stack	
43445	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:52] GotoIf("PJSIP/1310-00000035", "0?cnum") in new stack	
43446	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:53] Set("PJSIP/1310-00000035", "__MCNUM=1310") in new stack	
43447	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:54] Set("PJSIP/1310-00000035", "__MCNAME=Alix Greenawalt") in new stack	
43448	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:55] Set("PJSIP/1310-00000035", "__MCEXTEN=1310") in new stack	
43449	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:56] Set("PJSIP/1310-00000035", "__MCORGCHAN=PJSIP/1310-00000035") in new stack	
43450	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:57] Set("PJSIP/1310-00000035", "CDR(cnam)=Alix Greenawalt") in new stack	
43451	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:58] Set("PJSIP/1310-00000035", "CDR(cnum)=1310") in new stack	
43452	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-user-callerid:59] Set("PJSIP/1310-00000035", "CHANNEL(language)=en") in new stack	
43453	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [7777@from-internal:2] Goto("PJSIP/1310-00000035", "from-pstn,7777,1") in new stack	
43454	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx_builtins.c: Goto (from-pstn,7777,1)	
43455	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [7777@from-pstn:1] Answer("PJSIP/1310-00000035", "") in new stack	
43456	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [7777@from-pstn:2] Set("PJSIP/1310-00000035", "CALLER_ACCOUNTCODE=") in new stack	
43457	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [7777@from-pstn:3] Set("PJSIP/1310-00000035", "classroom_hours=NOT_INUSE") in new stack	
43458	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [7777@from-pstn:4] Set("PJSIP/1310-00000035", "acctcode=0") in new stack	
43459	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [7777@from-pstn:5] GotoIf("PJSIP/1310-00000035", "1?SkipForwardVM") in new stack	
43460	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx_builtins.c: Goto (from-pstn,7777,9)	
43461	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [7777@from-pstn:9] Goto("PJSIP/1310-00000035", "from-did-direct-continue,7777,1") in new stack	
43462	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx_builtins.c: Goto (from-did-direct-continue,7777,1)	
43463	[2023-12-07 11:54:16] WARNING[24049][C-00000023] pbx.c: Channel 'PJSIP/1310-00000035' sent to invalid extension but no invalid handler: context,exten,priority=from-did-direct-continue,7777,1	
43464	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [h@from-did-direct-continue:1] Macro("PJSIP/1310-00000035", "hangupcall,") in new stack	
43465	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-hangupcall:1] Set("PJSIP/1310-00000035", "__MCVMSTATUS=") in new stack	
43466	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-hangupcall:2] Gosub("PJSIP/1310-00000035", "app-missedcall-hangup,s,1()") in new stack	
43467	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@app-missedcall-hangup:1] NoOp("PJSIP/1310-00000035", "Dialed: s") in new stack	
43468	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@app-missedcall-hangup:2] NoOp("PJSIP/1310-00000035", "Caller: 1310") in new stack	
43469	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@app-missedcall-hangup:3] GotoIf("PJSIP/1310-00000035", "0?exit") in new stack	
43470	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@app-missedcall-hangup:4] Set("PJSIP/1310-00000035", "EXTENNUM=s") in new stack	
43471	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@app-missedcall-hangup:5] Set("PJSIP/1310-00000035", "FEXTENNUM=s") in new stack	
43472	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@app-missedcall-hangup:6] GotoIf("PJSIP/1310-00000035", "0?exit") in new stack	
43473	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@app-missedcall-hangup:7] AGI("PJSIP/1310-00000035", "agi://127.0.0.1/missedcallnotify.php,s,,s,0,,PJSIP/1310-00000035,,,,") in new stack	
43474	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] res_agi.c: <PJSIP/1310-00000035>AGI Script agi://127.0.0.1/missedcallnotify.php completed, returning 0	
43475	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@app-missedcall-hangup:8] Return("PJSIP/1310-00000035", "") in new stack	
43476	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-hangupcall:3] GotoIf("PJSIP/1310-00000035", "1?theend") in new stack	
43477	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx_builtins.c: Goto (macro-hangupcall,s,5)	
43478	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-hangupcall:5] ExecIf("PJSIP/1310-00000035", "0?Set(CDR(recordingfile)=)") in new stack	
43479	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Executing [s@macro-hangupcall:6] Hangup("PJSIP/1310-00000035", "") in new stack	
43480	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] app_macro.c: Spawn extension (macro-hangupcall, s, 6) exited non-zero on 'PJSIP/1310-00000035' in macro 'hangupcall'	
43481	[2023-12-07 11:54:16] VERBOSE[24049][C-00000023] pbx.c: Spawn extension (from-did-direct-continue, h, 1) exited non-zero on 'PJSIP/1310-00000035'

From what I can tell, here are where the logs differ when I remove the extensions_custom.conf and 7777 is working:

44282	[2023-12-07 12:08:09] VERBOSE[29125][C-00000025] pbx_builtins.c: Goto (from-pstn,7777,1)	
44283	[2023-12-07 12:08:09] VERBOSE[29125][C-00000025] pbx.c: Executing [7777@from-pstn:1] NoOp("PJSIP/1310-00000037", "Catch-All DID Match - Found 7777 - You probably want a DID for this.") in new stack	
44284	[2023-12-07 12:08:09] VERBOSE[29125][C-00000025] pbx.c: Executing [7777@from-pstn:2] Set("PJSIP/1310-00000037", "__FROM_DID=7777") in new stack	
44285	[2023-12-07 12:08:09] VERBOSE[29125][C-00000025] pbx.c: Executing [7777@from-pstn:3] Goto("PJSIP/1310-00000037", "ext-did,s,1") in new stack	
44286	[2023-12-07 12:08:09] VERBOSE[29125][C-00000025] pbx_builtins.c: Goto (ext-did,s,1)	
44287	[2023-12-07 12:08:09] VERBOSE[29125][C-00000025] pbx.c: Executing [s@ext-did:1] Set("PJSIP/1310-00000037", "__DIRECTION=INBOUND") in new stack	
44288	[2023-12-07 12:08:09] VERBOSE[29125][C-00000025] pbx.c: Executing [s@ext-did:2] Gosub("PJSIP/1310-00000037", "sub-record-check,s,1(in,s,dontcare)") in new stack

Early in the custom dialplan add a line to intercept calls to 7777 like this:

[from-internal-custom]
exten => 7777,1,Goto(ext-test,7777,1)
exten => _XXXX,1,Answer()
   same => n,Set(CALLER_ACCOUNTCODE=${DB(AMPUSER/${EXTEN}/accountcode)})
   same => n,Set(holiday=${EXTENSION_STATE(*273@from-internal)})
*snip*

Any other 4 digit feature codes will be similarly affected.

When I add that, I got a message stating that there was “an error with call forwarding”, which also sounded very choppy on my hardphone. However, it hit me that I don’t have any extensions starting with 7, so I set the first digit in the dialplan like so:

exten => _1XXX,1,Answer()

So far this seems to be working!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.