Route issues with recognizing additional digits

I am using this PBX in a test/lab environment. It’s use is internal only with no connectivity to PSTN. Also, I have/had a working configuration, but wanted to test my documentation and ran into issues.

We are using it to connect to an appliance via SIP to launch broadcasts and other media related events through a PBX.

Basic functionality works with phones being able to call each other. I have valid Trunk connectivity both ways to my appliance, and no FW restrictions.
As evident with my tests and with Wireshark and previous VM.

My current setup dictates that for a certain prefix, the PBX should route the call to my appliance for further processing. If I just dial the prefix, the call gets routed appropriately. Once I dial, any other digits along with it, the call does not get routed and I receive the following output: "
[2012-12-04 08:33:49] VERBOSE[3532] netsock2.c: == Using SIP RTP TOS bits 184
[2012-12-04 08:33:49] VERBOSE[3532] netsock2.c: == Using SIP RTP CoS mark 5
[2012-12-04 08:33:49] VERBOSE[4397] pbx.c: – Executing [[email protected]:1] ResetCDR(“SIP/201-00000006”, “”) in new stack
[2012-12-04 08:33:49] VERBOSE[4397] pbx.c: – Executing [[email protected]:2] NoCDR(“SIP/201-00000006”, “”) in new stack
[2012-12-04 08:33:49] VERBOSE[4397] pbx.c: – Executing [[email protected]:3] Progress(“SIP/201-00000006”, “”) in new stack
[2012-12-04 08:33:49] VERBOSE[4397] pbx.c: – Executing [[email protected]:4] Wait(“SIP/201-00000006”, “1”) in new stack
[2012-12-04 08:33:50] VERBOSE[4397] pbx.c: – Executing [[email protected]:5] Progress(“SIP/201-00000006”, “”) in new stack
[2012-12-04 08:33:50] VERBOSE[4397] pbx.c: – Executing [[email protected]:6] Playback(“SIP/201-00000006”, “silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer”) in new stack
[2012-12-04 08:33:50] VERBOSE[4397] file.c: – <SIP/201-00000006> Playing ‘silence/1.ulaw’ (language ‘en’)
[2012-12-04 08:33:51] VERBOSE[4397] file.c: – <SIP/201-00000006> Playing ‘cannot-complete-as-dialed.gsm’ (language ‘en’)
[2012-12-04 08:33:53] VERBOSE[4397] pbx.c: == Spawn extension (from-internal, 6742, 6) exited non-zero on ‘SIP/201-00000006’
[2012-12-04 08:33:53] VERBOSE[4397] pbx.c: – Executing [[email protected]:1] Hangup(“SIP/201-00000006”, “”) in new stack
[2012-12-04 08:33:53] VERBOSE[4397] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/201-00000006

Dialing just the prefix (in this case (67). I get the following output. Which appears to be processing the request appropriately.
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:1] Macro(“SIP/201-00000004”, “user-callerid,LIMIT,”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:1] Set(“SIP/201-00000004”, “AMPUSER=201”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:2] GotoIf(“SIP/201-00000004”, “0?report”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:3] ExecIf(“SIP/201-00000004”, “1?Set(REALCALLERIDNUM=201)”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:4] Set(“SIP/201-00000004”, “AMPUSER=201”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:5] Set(“SIP/201-00000004”, “AMPUSERCIDNAME=EXT-201”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:6] GotoIf(“SIP/201-00000004”, “0?report”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:7] Set(“SIP/201-00000004”, “AMPUSERCID=201”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:8] Set(“SIP/201-00000004”, “CALLERID(all)=“EXT-201” <201>”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:9] GotoIf(“SIP/201-00000004”, “0?limit”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:10] ExecIf(“SIP/201-00000004”, “1?Set(GROUP(concurrency_limit)=201)”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:11] GotoIf(“SIP/201-00000004”, “1?continue”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Goto (macro-user-callerid,s,24)
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:24] Set(“SIP/201-00000004”, “CALLERID(number)=201”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:25] Set(“SIP/201-00000004”, “CALLERID(name)=EXT-201”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:26] Set(“SIP/201-00000004”, “CHANNEL(language)=en”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:2] Set(“SIP/201-00000004”, “INTRACOMPANYROUTE=YES”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:3] Set(“SIP/201-00000004”, “MOHCLASS=default”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:4] Set(“SIP/201-00000004”, “_NODEST=”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:5] Gosub(“SIP/201-00000004”, “sub-record-check,s,1(out,67,)”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:1] GotoIf(“SIP/201-00000004”, “1?check”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Goto (sub-record-check,s,6)
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:6] Set(“SIP/201-00000004”, “__MON_FMT=wav”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:7] GotoIf(“SIP/201-00000004”, “1?next”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Goto (sub-record-check,s,10)
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:10] ExecIf(“SIP/201-00000004”, “0?Return()”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:11] GotoIf(“SIP/201-00000004”, “0?out,1”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:12] Set(“SIP/201-00000004”, “__REC_STATUS=INITIALIZED”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:13] ExecIf(“SIP/201-00000004”, “0?Set(__REC_POLICY_MODE=)”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:14] Set(“SIP/201-00000004”, “NOW=1354631426”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:15] Set(“SIP/201-00000004”, “__DAY=04”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:16] Set(“SIP/201-00000004”, “__MONTH=12”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:17] Set(“SIP/201-00000004”, “__YEAR=2012”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:18] Set(“SIP/201-00000004”, “__TIMESTR=20121204-083026”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:19] Set(“SIP/201-00000004”, “__FROMEXTEN=201”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:20] Set(“SIP/201-00000004”, “__CALLFILENAME=out-67-201-20121204-083026-1354631426.4”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:21] Goto(“SIP/201-00000004”, “out,1”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Goto (sub-record-check,out,1)
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:1] ExecIf(“SIP/201-00000004”, “1?Set(__REC_POLICY_MODE=dontcare)”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:2] GosubIf(“SIP/201-00000004”, “0?record,1(exten,67,201)”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:3] Return(“SIP/201-00000004”, “”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:6] Macro(“SIP/201-00000004”, “dialout-trunk,2,”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:1] Set(“SIP/201-00000004”, “DIAL_TRUNK=2”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:2] GosubIf(“SIP/201-00000004”, “0?sub-pincheck,s,1()”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:3] GotoIf(“SIP/201-00000004”, “0?disabletrunk,1”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:4] Set(“SIP/201-00000004”, “DIAL_NUMBER=”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:5] Set(“SIP/201-00000004”, “DIAL_TRUNK_OPTIONS=”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:6] Set(“SIP/201-00000004”, “OUTBOUND_GROUP=OUT_2”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:7] GotoIf(“SIP/201-00000004”, “1?nomax”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Goto (macro-dialout-trunk,s,9)
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:9] GotoIf(“SIP/201-00000004”, “1?skipoutcid”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Goto (macro-dialout-trunk,s,12)
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:12] GosubIf(“SIP/201-00000004”, “0?sub-flp-2,s,1()”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:13] Set(“SIP/201-00000004”, “OUTNUM=”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:14] Set(“SIP/201-00000004”, “custom=SIP/Daks-69-out”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:15] ExecIf(“SIP/201-00000004”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:16] ExecIf(“SIP/201-00000004”, “0?Set(DIAL_TRUNK_OPTIONS=M(confirm))”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:17] Macro(“SIP/201-00000004”, “dialout-trunk-predial-hook,”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:1] MacroExit(“SIP/201-00000004”, “”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:18] GotoIf(“SIP/201-00000004”, “0?bypass,1”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:19] ExecIf(“SIP/201-00000004”, “1?Set(CONNECTEDLINE(num,i)=)”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:20] ExecIf(“SIP/201-00000004”, “1?Set(CONNECTEDLINE(name,i)=CID:201)”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:21] GotoIf(“SIP/201-00000004”, “0?customtrunk”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] pbx.c: – Executing [[email protected]:22] Dial(“SIP/201-00000004”, “SIP/Daks-69-out/,300,”) in new stack
[2012-12-04 08:30:26] VERBOSE[4385] netsock2.c: == Using SIP RTP TOS bits 184
[2012-12-04 08:30:26] VERBOSE[4385] netsock2.c: == Using SIP RTP CoS mark 5
[2012-12-04 08:30:26] VERBOSE[4385] app_dial.c: – Called SIP/Daks-69-out/
[2012-12-04 08:30:26] VERBOSE[4385] app_dial.c: – SIP/Daks-69-out-00000005 is ringing
[2012-12-04 08:30:26] VERBOSE[4385] app_dial.c: – SIP/Daks-69-out-00000005 answered SIP/201-00000004
[2012-12-04 08:30:57] VERBOSE[4385] pbx.c: – Executing [[email protected]:1] Macro(“SIP/201-00000004”, “hangupcall,”) in new stack
[2012-12-04 08:30:57] VERBOSE[4385] pbx.c: – Executing [[email protected]:1] GotoIf(“SIP/201-00000004”, “1?theend”) in new stack
[2012-12-04 08:30:57] VERBOSE[4385] pbx.c: – Goto (macro-hangupcall,s,3)
[2012-12-04 08:30:57] VERBOSE[4385] pbx.c: – Executing [[email protected]:3] ExecIf(“SIP/201-00000004”, “0?Set(CDR(recordingfile)=)”) in new stack
[2012-12-04 08:30:57] VERBOSE[4385] pbx.c: – Executing [[email protected]:4] Hangup(“SIP/201-00000004”, “”) in new stack
[2012-12-04 08:30:57] VERBOSE[4385] app_macro.c: == Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/201-00000004’ in macro ‘hangupcall’
[2012-12-04 08:30:57] VERBOSE[4385] features.c: == Spawn extension (macro-dialout-trunk, h, 1) exited non-zero on ‘SIP/201-00000004’
[2012-12-04 08:30:57] VERBOSE[4385] app_macro.c: == Spawn extension (macro-dialout-trunk, s, 22) exited non-zero on ‘SIP/201-00000004’ in macro ‘dialout-trunk’
[2012-12-04 08:30:57] VERBOSE[4385] pbx.c: == Spawn extension (from-internal, 67, 6) exited non-zero on ‘SIP/201-00000004’

Maybe I’m just missing something, but I’ve been through my original config a hundred times.
Lastly, if I use the good config and try to create a new trunk/route it won’t work either. It will work if I change the IP/Peer…setting on an existing trunk/route.

thanks for any help or direction you can point me.
Mike

Can you post your outbound route settings and trunk settings. It looks as if you don’t have the outbound route setup to handle digits after the “67”.

interestingly enough I added some place holders for additional digits in the dialing pattern fields and it works. However, I don’t have those in the original setup.

I attached an output from dialplan show. I already made a change to the outrt-9 to add some placeholders, for the prefix ‘67’. Originally, it would have looked like outrt-10 and prefix ‘61’.

Sorry for all the extra, I don’t know the specific command to get the trunk/route data.

FreePBXAdminApplicationsConnectivityReportsSettingsOtherLanguageLogout: admin
Asterisk CLI
Command:

[ Context ‘parkedcalls’ created by ‘features’ ]
‘700’ => 1. Park() [features]

[ Context ‘phone_context’ created by ‘digium_phone_module’ ]
‘digium_phone_module’ => 1. Set(MESSAGE(custom_data)=mark_all_outbound) [digium_phone_module]
2. Set(TMP_RESPONSE_URI=${MESSAGE_DATA(X-Digium-AppServer-Response-URI)}) [digium_phone_module]
3. Set(MESSAGE_DATA(X-Digium-AppServer-Response-URI)=) [digium_phone_module]
4. MessageSend(${TMP_RESPONSE_URI},proxy) [digium_phone_module]
‘proxy’ => 1. Set(MESSAGE(custom_data)=mark_all_outbound) [digium_phone_module]
[recvaddr] 2. Set(MESSAGE_DATA(X-Digium-AppServer-Response-URI)=sip:${MESSAGE_DATA(SIP_RECVADDR)}) [digium_phone_module]
[send] 3. MessageSend(digium_phone:blah) [digium_phone_module]

[ Context ‘app_dial_gosub_virtual_context’ created by ‘app_dial’ ]
‘s’ => 1. NoOp() [app_dial]

[ Context ‘app_queue_gosub_virtual_context’ created by ‘app_queue’ ]
‘s’ => 1. NoOp() [app_queue]

[ Context ‘macro-saydigits’ created by ‘pbx_config’ ]
‘s’ => 1. Noop(Trying custom SayDigits playback for “${ARG1}”) [pbx_config]
2. Playback(tts/custom-${MD5(${ARG1})}) [pbx_config]
3. GotoIf($["${PLAYBACKSTATUS}"=“SUCCESS”]?done) [pbx_config]
[tts] 4. Macro(tts-saydigits,${ARG1},${ARG2},${ARG3}) [pbx_config]
5. SayDigits(${ARG1}) [pbx_config]
6. Goto(done) [pbx_config]

[ Context ‘macro-saynumber’ created by ‘pbx_config’ ]
‘s’ => 1. Noop(Trying custom SayNumber playback for “${ARG1}”) [pbx_config]
2. Playback(tts/custom-${MD5(${ARG1})}) [pbx_config]
3. GotoIf($["${PLAYBACKSTATUS}"=“SUCCESS”]?done) [pbx_config]
[tts] 4. Macro(tts-saynumber,${ARG1},${ARG2},${ARG3}) [pbx_config]
5. SayNumber(${ARG1}) [pbx_config]
6. Goto(done) [pbx_config]
105. Noop(tts handled saynumber) [pbx_config]

[ Context ‘macro-sayname’ created by ‘pbx_config’ ]
‘s’ => 1. Noop(Trying custom SayName playback for “${ARG1}”) [pbx_config]
2. Playback(tts/custom-${MD5(${ARG1})}) [pbx_config]
3. GotoIf($["${PLAYBACKSTATUS}"=“SUCCESS”]?done) [pbx_config]
[tts] 4. Macro(tts-sayalpha,${ARG1},${ARG2},${ARG3}) [pbx_config]
5. SayAlpha(${ARG1}) [pbx_config]
6. Goto(done) [pbx_config]
105. Noop(tts handled sayname) [pbx_config]

[ Context ‘macro-saytext’ created by ‘pbx_config’ ]
‘s’ => 1. Noop(Trying custom SayText playback for “${ARG1}”) [pbx_config]
2. Playback(tts/custom-${MD5(${ARG1})}) [pbx_config]
3. GotoIf($["${PLAYBACKSTATUS}"=“SUCCESS”]?done) [pbx_config]
[tts] 4. Macro(tts-saytext,${ARG1},${ARG2},${ARG3}) [pbx_config]
5. Noop(No text-to-speech handler for SayText, cannot say “${ARG1}”) [pbx_config]
6. Goto(done) [pbx_config]
105. Noop(tts handled saytext) [pbx_config]

[ Context ‘macro-fixcid’ created by ‘pbx_config’ ]
‘s’ => 1. Set(CALLERID(name)=${CALLERID(name)}) [pbx_config]

[ Context ‘default’ created by ‘pbx_config’ ]
‘s’ => 1. Playback(vm-goodbye) [pbx_config]
2. Noop(ERROR: FreePBX Does not use the [default] context, confguration error) [pbx_config]
3. Macro(hangupcall) [pbx_config]
Include => ‘ext-local’ [pbx_config]

[ Context ‘macro-privacy-mgr’ created by ‘pbx_config’ ]
‘h’ => 1. Hangup() [pbx_config]
‘s’ => 1. Set(KEEPCID=${CALLERID(num)}) [pbx_config]
2. GotoIf($[“foo${CALLERID(num):0:1}”=“foo+”]?CIDTEST2:CIDTEST1) [pbx_config]
[CIDTEST1] 3. Set(TESTCID=${MATH(1+${CALLERID(num)})}) [pbx_config]
4. Goto(TESTRESULT) [pbx_config]
[CIDTEST2] 5. Set(TESTCID=${MATH(1+${CALLERID(num):1})}) [pbx_config]
[TESTRESULT] 6. GotoIf($[“foo${TESTCID}”=“foo”]?CLEARCID:PRIVMGR) [pbx_config]
[CLEARCID] 7. Set(CALLERID(num)=) [pbx_config]
[PRIVMGR] 8. PrivacyManager(${ARG1},${ARG2}) [pbx_config]
9. GotoIf($["${PRIVACYMGRSTATUS}"=“FAILED”]?fail) [pbx_config]
10. GosubIf($["${CALLED_BLACKLIST}" = “1”]?app-blacklist-check,s,1) [pbx_config]
11. SetCallerPres(allowed_passed_screen) [pbx_config]
[fail] 109. Noop(STATUS: ${PRIVACYMGRSTATUS} CID: ${CALLERID(num)} ${CALLERID(name)} CALLPRES: ${CALLLINGPRES}) [pbx_config]
110. Playback(sorry-youre-having-problems) [pbx_config]
111. Playback(goodbye) [pbx_config]
112. Playtones(congestion) [pbx_config]
113. Congestion(5) [pbx_config]

[ Context ‘macro-user-logoff’ created by ‘pbx_config’ ]
‘s’ => 1. Set(DEVICETYPE=${DB(DEVICE/${CALLERID(number)}/type)}) [pbx_config]
2. GotoIf($["${DEVICETYPE}" = “fixed”]?s-FIXED,1) [pbx_config]
3. AGI(user_login_out.agi,logout,${CALLERID(number)}) [pbx_config]
[done] 4. Playback(agent-loggedoff) [pbx_config]
‘s-FIXED’ => 1. NoOp(Device is FIXED and cannot be logged out of) [pbx_config]
2. Playback(an-error-has-occured&vm-goodbye) [pbx_config]
3. Hangup() [pbx_config]

[ Context ‘macro-user-logon’ created by ‘pbx_config’ ]
‘s’ => 1. Set(DEVICETYPE=${DB(DEVICE/${CALLERID(number)}/type)}) [pbx_config]
2. Answer() [pbx_config]
3. Wait(1) [pbx_config]
4. GotoIf($["${DEVICETYPE}" = “fixed”]?s-FIXED,1) [pbx_config]
5. Set(AMPUSER=${ARG1}) [pbx_config]
6. GotoIf($["${AMPUSER}" != “”]?gotpass) [pbx_config]
[playagain] 7. Read(AMPUSER,please-enter-your-extension-then-press-pound,4) [pbx_config]
8. GotoIf($["${AMPUSER}" = “”]?s-MAXATTEMPTS,1) [pbx_config]
[gotpass] 9. GotoIf($["${DB_EXISTS(AMPUSER/${AMPUSER}/password)}" = “0”]?s-NOUSER,1) [pbx_config]
10. Set(AMPUSERPASS=${DB_RESULT}) [pbx_config]
11. GotoIf($[${LEN(${AMPUSERPASS})} = 0]?s-NOPASSWORD,1) [pbx_config]
12. Set(DEVICEUSER=${DB(DEVICE/${CALLERID(number)}/user)}) [pbx_config]
13. GotoIf($["${DEVICEUSER}" = “${AMPUSER}”]?s-ALREADYLOGGEDON,1) [pbx_config]
14. Authenticate(${AMPUSERPASS}) [pbx_config]
15. AGI(user_login_out.agi,login,${CALLERID(number)},${AMPUSER}) [pbx_config]
16. Playback(agent-loginok) [pbx_config]
‘s-ALREADYLOGGEDON’ => 1. NoOp(This device has already been logged into by this user) [pbx_config]
2. Playback(vm-goodbye) [pbx_config]
3. Hangup() [pbx_config]
‘s-FIXED’ => 1. NoOp(Device is FIXED and cannot be logged into) [pbx_config]
2. Playback(ha/phone) [pbx_config]
3. SayDigits(${CALLERID(number)}) [pbx_config]
4. Playback(is-curntly-unavail&vm-goodbye) [pbx_config]
5. Hangup() [pbx_config]
‘s-MAXATTEMPTS’ => 1. NoOp(Too many login attempts) [pbx_config]
2. Playback(vm-goodbye) [pbx_config]
3. Hangup() [pbx_config]
‘s-NOPASSWORD’ => 1. NoOp(This extension does not exist or no password is set) [pbx_config]
2. Playback(pbx-invalid) [pbx_config]
3. Goto(s,playagain) [pbx_config]
‘s-NOUSER’ => 1. NoOp(Invalid extension ${AMPUSER} entered) [pbx_config]
2. Playback(pbx-invalid) [pbx_config]
3. Goto(s,playagain) [pbx_config]

[ Context ‘macro-dialout-trunk-predial-hook’ created by ‘pbx_config’ ]
‘s’ => 1. MacroExit() [pbx_config]

[ Context ‘macro-outisbusy’ created by ‘pbx_config’ ]
‘s’ => 1. Progress() [pbx_config]
2. Playback(all-circuits-busy-now,noanswer) [pbx_config]
3. Playback(pls-try-call-later,noanswer) [pbx_config]
4. Macro(hangupcall) [pbx_config]

[ Context ‘macro-get-vmcontext’ created by ‘pbx_config’ ]
‘s’ => 1. Set(VMCONTEXT=${DB(AMPUSER/${ARG1}/voicemail)}) [pbx_config]
2. GotoIf($[“foo${VMCONTEXT}” = “foo”]?200:300) [pbx_config]
200. Set(VMCONTEXT=default) [pbx_config]
300. NoOp() [pbx_config]

[ Context ‘macro-dial’ created by ‘pbx_config’ ]
‘ANSWER’ => 1. Noop(Call successfully answered - Hanging up now) [pbx_config]
2. Macro(hangupcall,) [pbx_config]
‘DONTCALL’ => 1. Answer() [pbx_config]
2. Wait(1) [pbx_config]
3. Zapateller() [pbx_config]
4. Playback(ss-noservice) [pbx_config]
5. Macro(hangupcall) [pbx_config]
‘NOANSWER’ => 1. Macro(vm,${SCREEN_EXTEN},BUSY,${IVR_RETVM}) [pbx_config]
2. GotoIf($["${IVR_RETVM}" != “RETURN” | “${IVR_CONTEXT}” = “”]?bye) [pbx_config]
3. Return() [pbx_config]
[bye] 4. Macro(hangupcall) [pbx_config]
‘TORTURE’ => 1. Goto(app-blackhole,musiconhold,1) [pbx_config]
2. Macro(hangupcall) [pbx_config]
‘h’ => 1. Macro(hangupcall) [pbx_config]
‘s’ => 1. GotoIf($["${MOHCLASS}" = “”]?dial) [pbx_config]
2. SetMusicOnHold(${MOHCLASS}) [pbx_config]
[dial] 3. AGI(dialparties.agi) [pbx_config]
4. NoOp(Returned from dialparties with no extensions to call and DIALSTATUS: ${DIALSTATUS}) [pbx_config]
[normdial] 7. Dial(${ds}) [pbx_config]
8. Set(DIALSTATUS=${IF($["${DIALSTATUS_CW}"!="" ]?${DIALSTATUS_CW}:${DIALSTATUS})}) [pbx_config]
9. GosubIf($[("${SCREEN}" != “” & ("${DIALSTATUS}" = “TORTURE” | “${DIALSTATUS}” = “DONTCALL”)) | “${DIALSTATUS}” = “ANSWER”]?${DIALSTATUS},1) [pbx_config]
[huntdial] 20. NoOp(Returned from dialparties with hunt groups to dial ) [pbx_config]
21. Set(HuntLoop=0) [pbx_config]
[a22] 22. GotoIf($[${HuntMembers} >= 1]?a30) [pbx_config]
23. NoOp(Returning there are no members left in the hunt group to ring) [pbx_config]
[a30] 26. Set(HuntMember=HuntMember${HuntLoop}) [pbx_config]
27. GotoIf($[$["${CALLTRACE_HUNT}" != “” ] & $[$["${RingGroupMethod}" = “hunt” ] | $["${RingGroupMethod}" = “firstavailable”] | $["${RingGroupMethod}" = “firstnotonphone”]]]?a32:a35) [pbx_config]
[a32] 28. Set(CT_EXTEN=${CUT(FILTERED_DIAL,$[${HuntLoop} + 1])}) [pbx_config]
29. Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT}) [pbx_config]
30. Goto(s,a42) [pbx_config]
[a35] 31. GotoIf($[$["${CALLTRACE_HUNT}" != “” ] & $["${RingGroupMethod}" = “memoryhunt” ]]?a36:a50) [pbx_config]
[a36] 32. Set(CTLoop=0) [pbx_config]
[a37] 33. GotoIf($[${CTLoop} > ${HuntLoop}]?a42) [pbx_config]
34. Set(CT_EXTEN=${CUT(FILTERED_DIAL,$[${CTLoop} + 1])}) [pbx_config]
35. Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT}) [pbx_config]
36. Set(CTLoop=$[1 + ${CTLoop}]) [pbx_config]
37. Goto(s,a37) [pbx_config]
[a42] 38. Dial(${${HuntMember}}${ds}) [pbx_config]
39. GotoIf($["${DIALSTATUS}" = “ANSWER”]?ANSWER,1) [pbx_config]
40. Set(HuntLoop=$[1 + ${HuntLoop}]) [pbx_config]
41. GotoIf($[$[$[“foo${RingGroupMethod}” != “foofirstavailable”] & $[“foo${RingGroupMethod}” != “foofirstnotonphone”]] | $[“foo${DialStatus}” = “fooBUSY”]]?a46) [pbx_config]
42. Set(HuntMembers=0) [pbx_config]
[a46] 43. Set(HuntMembers=$[${HuntMembers} - 1]) [pbx_config]
44. Goto(s,a22) [pbx_config]
[a50] 45. DBdel(CALLTRACE/${CT_EXTEN}) [pbx_config]
46. Goto(s,a42) [pbx_config]

[ Context ‘from-did-direct’ created by ‘pbx_config’ ]
Include => ‘ext-findmefollow’ [pbx_config]
Include => ‘ext-local’ [pbx_config]

[ Context ‘from-internal-xfer’ created by ‘pbx_config’ ]
‘h’ => 1. Macro(hangupcall) [pbx_config]
‘s’ => 1. Macro(hangupcall) [pbx_config]
Include => ‘from-internal-custom’ [pbx_config]
Include => ‘from-internal-additional’ [pbx_config]

[ Context ‘from-internal-noxfer’ created by ‘pbx_config’ ]
Include => ‘from-internal-noxfer-custom’ [pbx_config]
Include => ‘from-internal-noxfer-additional’ [pbx_config]

[ Context ‘from-internal’ created by ‘pbx_config’ ]
‘auto_hint_201’ => hint: SIP/201,CustomPresence:201 [DIGIUM_PHONE_USERS]
‘auto_hint_204’ => hint: SIP/204,CustomPresence:204 [DIGIUM_PHONE_USERS]
‘auto_hint_207’ => hint: SIP/207,CustomPresence:207 [DIGIUM_PHONE_USERS]
Include => ‘from-internal-noxfer’ [pbx_config]
Include => ‘from-internal-xfer’ [pbx_config]
Include => ‘bad-number’ [pbx_config]

[ Context ‘from-sip-external’ created by ‘pbx_config’ ]
‘h’ => 1. Hangup() [pbx_config]
‘i’ => 1. Hangup() [pbx_config]
‘s’ => 1. GotoIf($["${ALLOW_SIP_ANON}"=“yes”]?checklang:noanonymous) [pbx_config]
[checklang] 2. GotoIf($["${SIPLANG}"!=""]?setlanguage:from-trunk,${DID},1) [pbx_config]
[setlanguage] 3. Set(CHANNEL(language)=${SIPLANG}) [pbx_config]
4. Goto(from-trunk,${DID},1) [pbx_config]
[noanonymous] 5. Set(TIMEOUT(absolute)=15) [pbx_config]
6. Answer() [pbx_config]
7. Wait(2) [pbx_config]
8. Playback(ss-noservice) [pbx_config]
9. Playtones(congestion) [pbx_config]
10. Congestion(5) [pbx_config]
‘t’ => 1. Hangup() [pbx_config]
’_.’ => 1. NoOp(Received incoming SIP connection from unknown peer to ${EXTEN}) [pbx_config]
2. Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})}) [pbx_config]
3. Goto(s,1) [pbx_config]

[ Context ‘from-pstn-toheader’ created by ‘pbx_config’ ]
’_.’ => 1. Goto(from-pstn,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1) [pbx_config]

[ Context ‘from-pstn-e164-us’ created by ‘pbx_config’ ]
‘s’ (CID match ‘+1NXXNXXXXXX’) => 1. Set(CALLERID(number)=${CALLERID(number):2}) [pbx_config]
‘s’ (CID match '
+X.’) => 1. Set(CALLERID(number)=011${CALLERID(number):1}) [pbx_config]
‘s’ (CID match ‘011X.’) => 2. Goto(from-pstn,${EXTEN},1) [pbx_config]
‘s’ (CID match ‘NXXNXXXXXX’) => 2. Goto(from-pstn,${EXTEN},1) [pbx_config]
‘s’ => 1. Goto(from-pstn,${EXTEN},1) [pbx_config]
+1NXXNXXXXXX’ (CID match '
+1NXXNXXXXXX’) => 1. Set(CALLERID(number)=${CALLERID(number):2}) [pbx_config]
+1NXXNXXXXXX’ (CID match '+X.’) => 1. Set(CALLERID(number)=011${CALLERID(number):1}) [pbx_config]
+1NXXNXXXXXX’ (CID match ‘011X.’) => 2. Goto(from-pstn,${EXTEN:2},1) [pbx_config]
+1NXXNXXXXXX’ (CID match ‘NXXNXXXXXX’) => 2. Goto(from-pstn,${EXTEN:2},1) [pbx_config]
+1NXXNXXXXXX’ => 1. Goto(from-pstn,${EXTEN:2},1) [pbx_config]
[0-9+].’ (CID match ‘+1NXXNXXXXXX’) => 1. Set(CALLERID(number)=${CALLERID(number):2}) [pbx_config]
[0-9+].’ (CID match ‘+X.’) => 1. Set(CALLERID(number)=011${CALLERID(number):1}) [pbx_config]
[0-9+].’ (CID match ‘011X.’) => 2. Goto(from-pstn,${EXTEN},1) [pbx_config]
[0-9+].’ (CID match ‘NXXNXXXXXX’) => 2. Goto(from-pstn,${EXTEN},1) [pbx_config]
[0-9+].’ => 1. Goto(from-pstn,${EXTEN},1) [pbx_config]

[ Context ‘from-pstn’ created by ‘pbx_config’ ]
Include => ‘from-pstn-custom’ [pbx_config]
Include => ‘ext-did’ [pbx_config]
Include => ‘ext-did-post-custom’ [pbx_config]
Include => ‘from-did-direct’ [pbx_config]
Include => ‘ext-did-catchall’ [pbx_config]

[ Context ‘from-trunk’ created by ‘pbx_config’ ]
Include => ‘from-pstn’ [pbx_config]

[ Context ‘from-analog’ created by ‘pbx_config’ ]
Include => ‘from-dahdi’ [pbx_config]

[ Context ‘from-digital’ created by ‘pbx_config’ ]
Include => ‘from-pstn’ [pbx_config]

[ Context ‘from-internal-noxfer-additional’ created by ‘pbx_config’ ]
‘h’ => 1. Hangup() [pbx_config]
Include => ‘from-internal-noxfer-additional-custom’ [pbx_config]

[ Context ‘from-internal-additional’ created by ‘pbx_config’ ]
‘h’ => 1. Hangup() [pbx_config]
Include => ‘from-internal-additional-custom’ [pbx_config]
Include => ‘app-dialvm’ [pbx_config]
Include => ‘app-vmmain’ [pbx_config]
Include => ‘app-recordings’ [pbx_config]
Include => ‘app-calltrace’ [pbx_config]
Include => ‘app-echo-test’ [pbx_config]
Include => ‘app-speakextennum’ [pbx_config]
Include => ‘app-speakingclock’ [pbx_config]
Include => ‘app-userlogonoff’ [pbx_config]
Include => ‘ext-local-confirm’ [pbx_config]
Include => ‘findmefollow-ringallv2’ [pbx_config]
Include => ‘app-pickup’ [pbx_config]
Include => ‘app-zapbarge’ [pbx_config]
Include => ‘app-chanspy’ [pbx_config]
Include => ‘ext-test’ [pbx_config]
Include => ‘ext-local’ [pbx_config]
Include => ‘outbound-allroutes’ [pbx_config]

[ Context ‘macro-dial-one’ created by ‘pbx_config’ ]
‘cf’ => 1. Set(CFAMPUSER=${IF($["${AMPUSER}"=""]?${CALLERID(number)}:${AMPUSER})}) [pbx_config]
2. ExecIf($["${DB(CF/${DEXTEN})}"="${CFAMPUSER}" | “${DB(CF/${DEXTEN})}”="${REALCALLERIDNUM}" | “${CUT(CUT(BLINDTRANSFER,-,1),/,1)}” = “${DB(CF/${DEXTEN})}” | “${DEXTEN}”="${DB(CF/${DEXTEN})}"]?Return()) [pbx_config]
3. ExecIf($["${DB(AMPUSER/${DEXTEN}/cfringtimer)}" != “0” & “${DB(AMPUSER/${DEXTEN}/cfringtimer)}” != “”]?Set(ARG1=${IF($["${DB(AMPUSER/${DEXTEN}/cfringtimer)}"="-1"]? : ${DB(AMPUSER/${DEXTEN}/cfringtimer)})})) [pbx_config]
4. Set(DEXTEN=${IF($["${CFIGNORE}"=""]?"${DB(CF/${DEXTEN})}#":"")}) [pbx_config]
5. ExecIf($["${DEXTEN}"!=""]?Return()) [pbx_config]
6. Set(DIALSTATUS=NOANSWER) [pbx_config]
7. Return() [pbx_config]
‘ctclear’ => 1. Noop(Deleting: CALLTRACE/${DEXTEN} ${DB_DELETE(CALLTRACE/${DEXTEN})}) [pbx_config]
2. Return() [pbx_config]
‘ctset’ => 1. Set(DB(CALLTRACE/${DEXTEN})=${CALLERID(number)}) [pbx_config]
2. Return() [pbx_config]
‘dlocal’ => 1. Set(DSTRING=${IF($["${ARG1}"=""]?${DEXTEN:0:${MATH(${LEN(${DEXTEN})}-1,int)}}:Local/${DEXTEN:0:${MATH(${LEN(${DEXTEN})}-1,int)}}@from-internal/n)}) [pbx_config]
2. Set(USEGOTO=${IF($["${ARG1}"=""]?1:0)}) [pbx_config]
3. Return() [pbx_config]
‘dstring’ => 1. Set(DSTRING=) [pbx_config]
2. Set(DEVICES=${DB(AMPUSER/${DEXTEN}/device)}) [pbx_config]
3. ExecIf($["${DEVICES}"=""]?Return()) [pbx_config]
4. ExecIf($["${DEVICES:0:1}"="&"]?Set(DEVICES=${DEVICES:1})) [pbx_config]
5. Set(LOOPCNT=${FIELDQTY(DEVICES,&)}) [pbx_config]
6. Set(ITER=1) [pbx_config]
[begin] 7. Set(THISDIAL=${DB(DEVICE/${CUT(DEVICES,&,${ITER})}/dial)}) [pbx_config]
8. GosubIf($["${ASTCHANDAHDI}" = “1”]?zap2dahdi,1()) [pbx_config]
9. Set(DSTRING=${DSTRING}${THISDIAL}&) [pbx_config]
10. Set(ITER=$[${ITER}+1]) [pbx_config]
11. GotoIf($[${ITER}<=${LOOPCNT}]?begin) [pbx_config]
12. Set(DSTRING=${DSTRING:0:$[${LEN(${DSTRING})}-1]}) [pbx_config]
13. Return() [pbx_config]
‘h’ => 1. Macro(hangupcall,) [pbx_config]
‘qwait’ => 1. ExecIf($["${SAVEDCIDNAME}" = “”]?Set(__SAVEDCIDNAME=${CALLERID(name)})) [pbx_config]
2. Set(ELAPSED=${MATH($[${EPOCH}+30-${QUEUEWAIT}]/60,int)}) [pbx_config]
3. Set(CALLERID(name)=M${ELAPSED}:${SAVEDCIDNAME}) [pbx_config]
4. Return() [pbx_config]
‘s’ => 1. Set(DEXTEN=${ARG3}) [pbx_config]
2. Set(DIALSTATUS_CW=) [pbx_config]
3. GosubIf($["${FROM_DID}"!="" & “${SCREEN}”="" & “${DB(AMPUSER/${DEXTEN}/screen)}”!=""]?screen,1()) [pbx_config]
4. GosubIf($["${DB(CF/${DEXTEN})}"!=""]?cf,1()) [pbx_config]
5. GotoIf($["${DEXTEN:-1}"="#" | “${DB(DND/${DEXTEN})}”=""]?skip1) [pbx_config]
6. Set(DEXTEN=) [pbx_config]
7. Set(DIALSTATUS=BUSY) [pbx_config]
[skip1] 8. GotoIf($["${DEXTEN}"=""]?nodial) [pbx_config]
9. GotoIf($["${DEXTEN:-1}"="#"]?continue) [pbx_config]
10. Set(EXTHASCW=${IF($["${CWIGNORE}"!=""]?"":${DB(CW/${DEXTEN})})}) [pbx_config]
11. GotoIf($["${EXTHASCW}"="" | “${DB(CFB/${DEXTEN})}”!="" | “${DB(CFU/${DEXTEN})}”!=""]?next1:cwinusebusy) [pbx_config]
[next1] 12. GotoIf($["${DB(CFU/${DEXTEN})}"!="" & ("${EXTENSION_STATE(${DEXTEN})}"=“UNAVAILABLE” | “${EXTENSION_STATE(${DEXTEN})}”=“UNKNOWN”)]?docfu:skip3) [pbx_config]
[docfu] 13. Set(DEXTEN=) [pbx_config]
14. Set(DIALSTATUS=NOANSWER) [pbx_config]
15. Goto(nodial) [pbx_config]
[skip3] 16. GotoIf($["${EXTHASCW}"="" | “${DB(CFB/${DEXTEN})}”!=""]?next2:continue) [pbx_config]
[next2] 17. GotoIf($["${EXTENSION_STATE(${DEXTEN})}"=“NOT_INUSE” | “${EXTENSION_STATE(${DEXTEN})}”=“UNAVAILABLE” | “${EXTENSION_STATE(${DEXTEN})}”=“UNKNOWN”]?continue) [pbx_config]
18. ExecIf($["${DB(CFB/${DEXTEN})}"!="" & “${CFIGNORE}”=""]?Set(DIALSTATUS=BUSY)) [pbx_config]
19. GotoIf($["${EXTHASCW}"!="" | “${DEXTEN:-1}”="#"]?cwinusebusy) [pbx_config]
20. Set(DEXTEN=) [pbx_config]
21. Set(DIALSTATUS=BUSY) [pbx_config]
22. Goto(nodial) [pbx_config]
[cwinusebusy] 23. GotoIf($["${EXTHASCW}"!="" & “${CWINUSEBUSY}”=“true”]?next3:continue) [pbx_config]
[next3] 24. ExecIf($["${EXTENSION_STATE(${DEXTEN})}"!=“UNAVAILABLE” & “${EXTENSION_STATE(${DEXTEN})}”!=“NOT_INUSE” & “${EXTENSION_STATE(${DEXTEN})}”!=“UNKNOWN”]?Set(DIALSTATUS_CW=BUSY)) [pbx_config]
[continue] 25. GotoIf($["${DEXTEN}"=""]?nodial) [pbx_config]
26. GosubIf($["${DEXTEN:-1}"!="#"]?dstring,1():dlocal,1()) [pbx_config]
27. GotoIf($[${LEN(${DSTRING})}=0]?nodial) [pbx_config]
28. GotoIf($["${DEXTEN:-1}"="#"]?skiptrace) [pbx_config]
29. GosubIf($[${REGEX("^[+]?[0-9]+$" ${CALLERID(number)})} = 1]?ctset,1():ctclear,1()) [pbx_config]
[skiptrace] 30. Set(D_OPTIONS=${IF($["${NODEST}"!="" & ${REGEX("(M[(]auto-blkvm[)])" ${ARG2})} != 1]?${ARG2}M(auto-blkvm):${ARG2})}) [pbx_config]
31. ExecIf($["${ALERT_INFO}"!=""]?SIPAddHeader(Alert-Info: ${ALERT_INFO})) [pbx_config]
32. ExecIf($["${SIPADDHEADER}"!=""]?SIPAddHeader(${SIPADDHEADER})) [pbx_config]
33. ExecIf($["${MOHCLASS}"!=""]?Set(CHANNEL(musicclass)=${MOHCLASS})) [pbx_config]
34. GosubIf($["${QUEUEWAIT}"!=""]?qwait,1()) [pbx_config]
35. Set(__CWIGNORE=${CWIGNORE}) [pbx_config]
36. Set(__KEEPCID=TRUE) [pbx_config]
37. GotoIf($["${USEGOTO}"=“1”]?usegoto,1) [pbx_config]
38. GotoIf($["${DB(AMPUSER/${EXTTOCALL}/cidname)}" = “” || “${DB(AMPUSER/${AMPUSER}/cidname)}” = “”]?godial) [pbx_config]
39. Set(CONNECTEDLINE(name,i)=${DB(AMPUSER/${EXTTOCALL}/cidname)}) [pbx_config]
40. Set(CONNECTEDLINE(num)=${EXTTOCALL}) [pbx_config]
41. Set(D_OPTIONS=${D_OPTIONS}I) [pbx_config]
[godial] 42. Dial(${DSTRING},${ARG1},${D_OPTIONS}) [pbx_config]
43. ExecIf($["${DIALSTATUS_CW}"!=""]?Set(DIALSTATUS=${DIALSTATUS_CW})) [pbx_config]
44. GosubIf($[("${SCREEN}"!=""&("${DIALSTATUS}"=“TORTURE”|"${DIALSTATUS}"=“DONTCALL”))|"${DIALSTATUS}"=“ANSWER”]?s-${DIALSTATUS},1()) [pbx_config]
45. MacroExit() [pbx_config]
[nodial] 46. ExecIf($["${DIALSTATUS}" = “”]?Set(DIALSTATUS=NOANSWER)) [pbx_config]
47. Noop(Returned from dial-one with nothing to call and DIALSTATUS: ${DIALSTATUS}) [pbx_config]
48. MacroExit() [pbx_config]
‘s-BUSY’ => 1. Macro(vm,${SCREEN_EXTEN},BUSY,${IVR_RETVM}) [pbx_config]
2. ExecIf($["${IVR_RETVM}"!=“RETURN” | “${IVR_CONTEXT}”=""]?Hangup()) [pbx_config]
3. Return() [pbx_config]
‘s-CHANUNAVAIL’ => 1. Macro(vm,${SCREEN_EXTEN},BUSY,${IVR_RETVM}) [pbx_config]
2. ExecIf($["${IVR_RETVM}"!=“RETURN” | “${IVR_CONTEXT}”=""]?Hangup()) [pbx_config]
3. Return() [pbx_config]
‘s-DONTCALL’ => 1. Answer() [pbx_config]
2. Wait(1) [pbx_config]
3. Zapateller() [pbx_config]
4. Playback(ss-noservice) [pbx_config]
5. Macro(hangupcall,) [pbx_config]
‘s-NOANSWER’ => 1. Macro(vm,${SCREEN_EXTEN},BUSY,${IVR_RETVM}) [pbx_config]
2. ExecIf($["${IVR_RETVM}"!=“RETURN” | “${IVR_CONTEXT}”=""]?Hangup()) [pbx_config]
3. Return() [pbx_config]
‘s-TORTURE’ => 1. Goto(app-blackhole,musiconhold,1) [pbx_config]
2. Macro(hangupcall,) [pbx_config]
‘screen’ => 1. GotoIf($["${DB(AMPUSER/${DEXTEN}/screen)}"!=“nomemory” | “${CALLERID(number)}”=""]?memory) [pbx_config]
2. ExecIf($[${REGEX("^[0-9a-zA-Z ]+$" ${CALLERID(number)})} = 1]?System(rm -f ${ASTVARLIBDIR}/sounds/priv-callerintros/${CALLERID(number)}.*)) [pbx_config]
[memory] 3. Set(__SCREEN=${DB(AMPUSER/${DEXTEN}/screen)}) [pbx_config]
4. Set(__SCREEN_EXTEN=${DEXTEN}) [pbx_config]
5. Set(ARG2=${ARG2}p) [pbx_config]
6. Return() [pbx_config]
‘usegoto’ => 1. Set(USEGOTO=) [pbx_config]
2. Goto(from-internal,${DSTRING},1) [pbx_config]
‘zap2dahdi’ => 1. ExecIf($["${THISDIAL}" = “”]?Return()) [pbx_config]
2. Set(NEWDIAL=) [pbx_config]
3. Set(LOOPCNT2=${FIELDQTY(THISDIAL,&)}) [pbx_config]
4. Set(ITER2=1) [pbx_config]
[begin2] 5. Set(THISPART2=${CUT(THISDIAL,&,${ITER2})}) [pbx_config]
6. ExecIf($["${THISPART2:0:3}" = “ZAP”]?Set(THISPART2=DAHDI${THISPART2:3})) [pbx_config]
7. Set(NEWDIAL=${NEWDIAL}${THISPART2}&) [pbx_config]
8. Set(ITER2=$[${ITER2} + 1]) [pbx_config]
9. GotoIf($[${ITER2} <= ${LOOPCNT2}]?begin2) [pbx_config]
10. Set(THISDIAL=${NEWDIAL:0:$[${LEN(${NEWDIAL})}-1]}) [pbx_config]
11. Return() [pbx_config]
Include => ‘macro-dial-one-custom’ [pbx_config]

[ Context ‘macro-hangupcall’ created by ‘pbx_config’ ]
‘s’ => 1. GotoIf($["${USE_CONFIRMATION}"="" | “${RINGGROUP_INDEX}”="" | “${CHANNEL}”!="${UNIQCHAN}"]?theend) [pbx_config]
[delrgi] 2. Noop(Deleting: RG/${RINGGROUP_INDEX}/${CHANNEL} ${DB_DELETE(RG/${RINGGROUP_INDEX}/${CHANNEL})}) [pbx_config]
[theend] 3. ExecIf($["${ONETOUCH_RECFILE}"!="" & “${CDR(recordingfile)}”=""]?Set(CDR(recordingfile)=${ONETOUCH_RECFILE})) [pbx_config]
4. Hangup() [pbx_config]
5. MacroExit() [pbx_config]
Include => ‘macro-hangupcall-custom’ [pbx_config]

[ Context ‘macro-blkvm-check’ created by ‘pbx_config’ ]
‘s’ => 1. Set(GOSUB_RETVAL=${SHARED(BLKVM,${BLKVM_CHANNEL})}) [pbx_config]
2. ExecIf($["${GOSUB_RETVAL}"="" & “${CC_RECALL}”=“1”]?Set(GOSUB_RETVAL=TRUE)) [pbx_config]
3. MacroExit() [pbx_config]
Include => ‘macro-blkvm-check-custom’ [pbx_config]

[ Context ‘macro-blkvm-clr’ created by ‘pbx_config’ ]
‘s’ => 1. Set(SHARED(BLKVM,${BLKVM_CHANNEL})=) [pbx_config]
2. Set(GOSUB_RETVAL=) [pbx_config]
3. MacroExit() [pbx_config]
Include => ‘macro-blkvm-clr-custom’ [pbx_config]

[ Context ‘macro-blkvm-set’ created by ‘pbx_config’ ]
‘s’ => 1. ExecIf($[!${EXISTS(${BLKVM_CHANNEL})} | “{ARG1}” = “reset”]?Set(__BLKVM_CHANNEL=${CHANNEL})) [pbx_config]
2. Set(SHARED(BLKVM,${BLKVM_CHANNEL})=TRUE) [pbx_config]
3. Set(GOSUB_RETVAL=TRUE) [pbx_config]
4. MacroExit() [pbx_config]
Include => ‘macro-blkvm-set-custom’ [pbx_config]

[ Context ‘macro-blkvm-setifempty’ created by ‘pbx_config’ ]
‘s’ => 1. GotoIf($[!${EXISTS(${BLKVM_CHANNEL})}]?init) [pbx_config]
2. Set(GOSUB_RETVAL=${SHARED(BLKVM,${BLKVM_CHANNEL})}) [pbx_config]
3. MacroExit() [pbx_config]
[init] 4. Set(__BLKVM_CHANNEL=${CHANNEL}) [pbx_config]
5. Set(SHARED(BLKVM,${BLKVM_CHANNEL})=TRUE) [pbx_config]
6. Set(GOSUB_RETVAL=TRUE) [pbx_config]
7. MacroExit() [pbx_config]
Include => ‘macro-blkvm-setifempty-custom’ [pbx_config]

[ Context ‘macro-simple-dial’ created by ‘pbx_config’ ]
‘docfb’ => 1. GotoIf($["${DB(AMPUSER/${CFBEXT}/device)}" = “” ]?chlocal) [pbx_config]
2. Dial(Local/${CFBEXT}@ext-local,${RT},${DIAL_OPTIONS}) [pbx_config]
3. Return() [pbx_config]
[chlocal] 4. Dial(Local/${CFBEXT}@from-internal/n,${RT},${DIAL_OPTIONS}) [pbx_config]
5. Return() [pbx_config]
‘docfu’ => 1. GotoIf($["${DB(AMPUSER/${CFUEXT}/device)}" = “” ]?chlocal) [pbx_config]
2. Dial(Local/${CFUEXT}@ext-local,${RT},${DIAL_OPTIONS}) [pbx_config]
3. Return() [pbx_config]
[chlocal] 4. Dial(Local/${CFUEXT}@from-internal/n,${RT},${DIAL_OPTIONS}) [pbx_config]
5. Return() [pbx_config]
‘s’ => 1. Set(__EXTTOCALL=${ARG1}) [pbx_config]
2. Set(RT=${ARG2}) [pbx_config]
3. Set(CFUEXT=${DB(CFU/${EXTTOCALL})}) [pbx_config]
4. Set(CFBEXT=${DB(CFB/${EXTTOCALL})}) [pbx_config]
5. Set(CWI_TMP=${CWIGNORE}) [pbx_config]
[macrodial] 6. Macro(dial-one,${RT},${DIAL_OPTIONS},${EXTTOCALL}) [pbx_config]
7. Set(__CWIGNORE=${CWI_TMP}) [pbx_config]
8. Set(PR_DIALSTATUS=${DIALSTATUS}) [pbx_config]
[calldocfu] 9. GosubIf($["${PR_DIALSTATUS}"=“NOANSWER” & “${CFUEXT}”!=""]?docfu,1()) [pbx_config]
[calldocfb] 10. GosubIf($["${PR_DIALSTATUS}"=“BUSY” & “${CFBEXT}”!=""]?docfb,1()) [pbx_config]
11. Set(DIALSTATUS=${PR_DIALSTATUS}) [pbx_config]
12. Goto(s-${DIALSTATUS},1) [pbx_config]
’_s-.’ => 1. Noop(Extension is reporting ${EXTEN}) [pbx_config]
Include => ‘macro-simple-dial-custom’ [pbx_config]

[ Context ‘macro-exten-vm’ created by ‘pbx_config’ ]
‘docfb’ => 1. ExecIf($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"="-1"|("${ARG1}"=“novm”&${ARG4})]?StackPop()) [pbx_config]
2. GotoIf($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"="-1"|("${ARG1}"=“novm”&${ARG4})]?from-internal,${DB(CFB/${EXTTOCALL})},1) [pbx_config]
3. Set(RTCF=${IF($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"=“0”]?${RT}:${DB(AMPUSER/${EXTTOCALL}/cfringtimer)})}) [pbx_config]
4. Dial(Local/${DB(CFB/${EXTTOCALL})}@from-internal/n,${RTCF},${DIAL_OPTIONS}) [pbx_config]
5. Return() [pbx_config]
‘docfu’ => 1. ExecIf($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"="-1"|("${ARG1}"=“novm”&${ARG3})]?StackPop()) [pbx_config]
2. GotoIf($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"="-1"|("${ARG1}"=“novm”&${ARG3})]?from-internal,${DB(CFU/${EXTTOCALL})},1) [pbx_config]
3. Set(RTCF=${IF($["${DB(AMPUSER/${EXTTOCALL}/cfringtimer)}"=“0”]?${RT}:${DB(AMPUSER/${EXTTOCALL}/cfringtimer)})}) [pbx_config]
4. Dial(Local/${DB(CFU/${EXTTOCALL})}@from-internal/n,${RTCF},${DIAL_OPTIONS}) [pbx_config]
5. Return() [pbx_config]
‘exit’ => 1. Playback(beep&line-busy-transfer-menu&silence/1) [pbx_config]
2. MacroExit() [pbx_config]
‘s’ => 1. Macro(user-callerid,) [pbx_config]
2. Set(RingGroupMethod=none) [pbx_config]
3. Set(__EXTTOCALL=${ARG2}) [pbx_config]
4. Set(__PICKUPMARK=${ARG2}) [pbx_config]
5. Set(RT=${IF($["${ARG1}"!=“novm” | “${DB(CFU/${EXTTOCALL})}”!="" | “${DB(CFB/${EXTTOCALL})}”!="" | ${ARG3} | ${ARG4} | ${ARG5}]?${RINGTIMER}:)}) [pbx_config]
[checkrecord] 6. Gosub(sub-record-check,s,1(exten,${EXTTOCALL},)) [pbx_config]
[macrodial] 7. Macro(dial-one,${RT},${DIAL_OPTIONS},${EXTTOCALL}) [pbx_config]
8. Set(SV_DIALSTATUS=${DIALSTATUS}) [pbx_config]
[calldocfu] 9. GosubIf($[("${SV_DIALSTATUS}"=“NOANSWER”|"${SV_DIALSTATUS}"=“CHANUNAVAIL”) & “${DB(CFU/${EXTTOCALL})}”!="" & “${SCREEN}”=""]?docfu,1()) [pbx_config]
[calldocfb] 10. GosubIf($["${SV_DIALSTATUS}"=“BUSY” & “${DB(CFB/${EXTTOCALL})}”!="" & “${SCREEN}”=""]?docfb,1()) [pbx_config]
11. Set(DIALSTATUS=${SV_DIALSTATUS}) [pbx_config]
12. ExecIf($[("${DIALSTATUS}"=“NOANSWER”&${ARG3})|("${DIALSTATUS}"=“BUSY”&${ARG4})|("${DIALSTATUS}"=“CHANUNAVAIL”&${ARG5})]?MacroExit()) [pbx_config]
13. GotoIf($["${ARG1}"=“novm”]?s-${DIALSTATUS},1) [pbx_config]
14. Macro(vm,${ARG1},${DIALSTATUS},${IVR_RETVM}) [pbx_config]
‘s-BUSY’ => 1. GotoIf($["${IVR_RETVM}"=“RETURN” & “${IVR_CONTEXT}”!=""]?exit,1) [pbx_config]
2. Playtones(busy) [pbx_config]
3. Busy(20) [pbx_config]
’_s-!’ => 1. GotoIf($["${IVR_RETVM}"=“RETURN” & “${IVR_CONTEXT}”!=""]?exit,1) [pbx_config]
2. Playtones(congestion) [pbx_config]
3. Congestion(10) [pbx_config]
Include => ‘macro-exten-vm-custom’ [pbx_config]

[ Context ‘macro-vm’ created by ‘pbx_config’ ]
‘a’ => 1. Macro(get-vmcontext,${MEXTEN}) [pbx_config]
2. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}//ext)}" = “0”]?adef,1) [pbx_config]
3. Set(VMX_ADEST_EXT=${DB_RESULT}) [pbx_config]
4. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/
/context)}" = “1”]?acontext) [pbx_config]
5. Set(DB_RESULT=${VMX_CONTEXT}) [pbx_config]
[acontext] 6. Set(VMX_ADEST_CONTEXT=${DB_RESULT}) [pbx_config]
7. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}//pri)}" = “1”]?apri) [pbx_config]
8. Set(DB_RESULT=${VMX_PRI}) [pbx_config]
[apri] 9. Set(VMX_ADEST_PRI=${DB_RESULT}) [pbx_config]
10. Goto(${VMX_ADEST_CONTEXT},${VMX_ADEST_EXT},${VMX_ADEST_PRI}) [pbx_config]
‘adef’ => 1. VoiceMailMain(${MEXTEN}@${VMCONTEXT}) [pbx_config]
2. GotoIf($["${RETVM}" = “RETURN”]?exit-RETURN,1) [pbx_config]
3. Hangup() [pbx_config]
‘dovm’ => 1. Noop(VMX Timeout - go to voicemail) [pbx_config]
2. VoiceMail(${MEXTEN}@${VMCONTEXT},${VMX_OPTS}${VMGAIN}) [pbx_config]
3. Goto(exit-${VMSTATUS},1) [pbx_config]
‘exit-FAILED’ => 1. Playback(im-sorry&an-error-has-occured) [pbx_config]
2. GotoIf($["${RETVM}" = “RETURN”]?exit-RETURN,1) [pbx_config]
3. Hangup() [pbx_config]
‘exit-RETURN’ => 1. Noop(Returning From Voicemail because macro) [pbx_config]
‘exit-SUCCESS’ => 1. GotoIf($["${RETVM}" = “RETURN”]?exit-RETURN,1) [pbx_config]
2. Playback(goodbye) [pbx_config]
3. Hangup() [pbx_config]
‘exit-USEREXIT’ => 1. GotoIf($["${RETVM}" = “RETURN”]?exit-RETURN,1) [pbx_config]
2. Playback(goodbye) [pbx_config]
3. Hangup() [pbx_config]
‘o’ => 1. Playback(one-moment-please) [pbx_config]
2. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/0/ext)}" = “0”]?doopdef) [pbx_config]
3. Set(VMX_OPDEST_EXT=${DB_RESULT}) [pbx_config]
4. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/0/context)}" = “1”]?opcontext) [pbx_config]
5. Set(DB_RESULT=${VMX_CONTEXT}) [pbx_config]
[opcontext] 6. Set(VMX_OPDEST_CONTEXT=${DB_RESULT}) [pbx_config]
7. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/0/pri)}" = “1”]?oppri) [pbx_config]
8. Set(DB_RESULT=${VMX_PRI}) [pbx_config]
[oppri] 9. Set(VMX_OPDEST_PRI=${DB_RESULT}) [pbx_config]
10. Goto(${VMX_OPDEST_CONTEXT},${VMX_OPDEST_EXT},${VMX_OPDEST_PRI}) [pbx_config]
[doopdef] 11. GotoIf($[“x${OPERATOR_XTN}”=“x”]?nooper:from-internal,${OPERATOR_XTN},1) [pbx_config]
[nooper] 12. GotoIf($[“x${FROM_DID}”=“x”]?nodid) [pbx_config]
13. Dial(Local/${FROM_DID}@from-pstn,) [pbx_config]
14. Macro(hangup,) [pbx_config]
[nodid] 15. Dial(Local/[email protected],) [pbx_config]
16. Macro(hangup,) [pbx_config]
‘s’ => 1. Macro(user-callerid,SKIPTTL) [pbx_config]
2. Set(VMGAIN=${IF($[“foo${VM_GAIN}”!=“foo”]?“g(${VM_GAIN})”:"")}) [pbx_config]
3. Macro(blkvm-check,) [pbx_config]
4. GotoIf($["${GOSUB_RETVAL}" != “TRUE”]?vmx,1) [pbx_config]
5. Hangup() [pbx_config]
‘s-BUSY’ => 1. Noop(BUSY voicemail) [pbx_config]
2. Macro(get-vmcontext,${MEXTEN}) [pbx_config]
3. VoiceMail(${MEXTEN}@${VMCONTEXT},${VM_OPTS}b${VMGAIN}) [pbx_config]
4. Goto(exit-${VMSTATUS},1) [pbx_config]
‘s-DIRECTDIAL’ => 1. Noop(DIRECTDIAL voicemail) [pbx_config]
2. Macro(get-vmcontext,${MEXTEN}) [pbx_config]
3. VoiceMail(${MEXTEN}@${VMCONTEXT},${VM_OPTS}${VM_DDTYPE}${VMGAIN}) [pbx_config]
4. Goto(exit-${VMSTATUS},1) [pbx_config]
‘s-NOMESSAGE’ => 1. Noop(NOMESSAGE (beeb only) voicemail) [pbx_config]
2. Macro(get-vmcontext,${MEXTEN}) [pbx_config]
3. VoiceMail(${MEXTEN}@${VMCONTEXT},s${VM_OPTS}${VMGAIN}) [pbx_config]
4. Goto(exit-${VMSTATUS},1) [pbx_config]
‘t’ => 1. Hangup() [pbx_config]
‘vmx’ => 1. Set(MEXTEN=${ARG1}) [pbx_config]
2. Set(MMODE=${ARG2}) [pbx_config]
3. Set(RETVM=${ARG3}) [pbx_config]
4. Set(MODE=${IF($["${MMODE}"=“BUSY”]?busy:unavail)}) [pbx_config]
5. GotoIf($["${DB(AMPUSER/${MEXTEN}/vmx/${MODE}/state)}" != “enabled”]?chknomsg) [pbx_config]
6. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/vmxopts/timeout)}" = “0”]?chknomsg) [pbx_config]
7. Set(VM_OPTS=${DB_RESULT}) [pbx_config]
[chknomsg] 8. GotoIf($["${MMODE}"=“NOMESSAGE”]?s-${MMODE},1) [pbx_config]
9. GotoIf($["${MMODE}" != “DIRECTDIAL”]?notdirect) [pbx_config]
10. Set(MODE=${IF($["${REGEX("[b]" ${VM_DDTYPE})}" = “1”]?busy:${MODE})}) [pbx_config]
[notdirect] 11. Noop(Checking if ext ${MEXTEN} is enabled: ${DB(AMPUSER/${MEXTEN}/vmx/${MODE}/state)}) [pbx_config]
12. GotoIf($["${DB(AMPUSER/${MEXTEN}/vmx/${MODE}/state)}" != “enabled”]?s-${MMODE},1) [pbx_config]
13. Macro(get-vmcontext,${MEXTEN}) [pbx_config]
14. GotoIf($[(${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/temp.wav)} = 1) || (${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/temp.WAV)} = 1)]?tmpgreet) [pbx_config]
15. GotoIf($[(${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/${MODE}.wav)} = 0) && (${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/${MODE}.WAV)} = 0)]?nofile) [pbx_config]
16. Set(LOOPCOUNT=0) [pbx_config]
17. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/repeat)}" = “0”]?vmxtime) [pbx_config]
18. Set(VMX_REPEAT=${DB_RESULT}) [pbx_config]
[vmxtime] 19. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/timeout)}" = “0”]?vmxloops) [pbx_config]
20. Set(VMX_TIMEOUT=${DB_RESULT}) [pbx_config]
[vmxloops] 21. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/loops)}" = “0”]?vmxanswer) [pbx_config]
22. Set(VMX_LOOPS=${DB_RESULT}) [pbx_config]
[vmxanswer] 23. Answer() [pbx_config]
[loopstart] 24. Read(ACTION,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${MEXTEN}/${MODE},1,skip,${VMX_REPEAT},${VMX_TIMEOUT}) [pbx_config]
25. GotoIf($["${EXISTS(${ACTION})}" = “1”]?checkopt) [pbx_config]
[noopt] 26. Noop(Timeout: going to timeout dest) [pbx_config]
27. Set(VMX_OPTS=${VMX_OPTS_TIMEOUT}) [pbx_config]
28. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/vmxopts/timeout)}" = “0”]?chktime) [pbx_config]
29. Set(VMX_OPTS=${DB_RESULT}) [pbx_config]
[chktime] 30. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/timedest/ext)}" = “0”]?dotime) [pbx_config]
31. Set(VMX_TIMEDEST_EXT=${DB_RESULT}) [pbx_config]
32. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/timedest/context)}" = “0”]?timepri) [pbx_config]
33. Set(VMX_TIMEDEST_CONTEXT=${DB_RESULT}) [pbx_config]
[timepri] 34. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/timedest/pri)}" = “0”]?dotime) [pbx_config]
35. Set(VMX_TIMEDEST_PRI=${DB_RESULT}) [pbx_config]
[dotime] 36. Goto(${VMX_TIMEDEST_CONTEXT},${VMX_TIMEDEST_EXT},${VMX_TIMEDEST_PRI}) [pbx_config]
[checkopt] 37. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/${ACTION}/ext)}" = “1”]?doopt) [pbx_config]
38. GotoIf($["${ACTION}" = “0”]?o,1) [pbx_config]
39. GotoIf($["${ACTION}" = "
"]?adef,1) [pbx_config]
40. Set(LOOPCOUNT=$[${LOOPCOUNT} + 1]) [pbx_config]
41. GotoIf($[${LOOPCOUNT} > ${VMX_LOOPS}]?toomany) [pbx_config]
42. Playback(pm-invalid-option&please-try-again) [pbx_config]
43. Goto(loopstart) [pbx_config]
[toomany] 44. Noop(Too Many invalid entries, got to invalid dest) [pbx_config]
45. Set(VMX_OPTS=${VMX_OPTS_LOOPS}) [pbx_config]
46. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/vmxopts/loops)}" = “0”]?chkloop) [pbx_config]
47. Set(VMX_OPTS=${DB_RESULT}) [pbx_config]
[chkloop] 48. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/loopdest/ext)}" = “0”]?doloop) [pbx_config]
49. Set(VMX_LOOPDEST_EXT=${DB_RESULT}) [pbx_config]
50. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/loopdest/context)}" = “0”]?looppri) [pbx_config]
51. Set(VMX_LOOPDEST_CONTEXT=${DB_RESULT}) [pbx_config]
[looppri] 52. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/loopdest/pri)}" = “0”]?doloop) [pbx_config]
53. Set(VMX_LOOPDEST_PRI=${DB_RESULT}) [pbx_config]
[doloop] 54. Goto(${VMX_LOOPDEST_CONTEXT},${VMX_LOOPDEST_EXT},${VMX_LOOPDEST_PRI}) [pbx_config]
[doopt] 55. Noop(Got a valid option: ${DB_RESULT}) [pbx_config]
56. Set(VMX_EXT=${DB_RESULT}) [pbx_config]
57. GotoIf($["${VMX_EXT}" != “dovm”]?getdest) [pbx_config]
[vmxopts] 58. Set(VMX_OPTS=${VMX_OPTS_DOVM}) [pbx_config]
59. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/vmxopts/dovm)}" = “0”]?vmxdovm) [pbx_config]
60. Set(VMX_OPTS=${DB_RESULT}) [pbx_config]
[vmxdovm] 61. Goto(dovm,1) [pbx_config]
[getdest] 62. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/${ACTION}/context)}" = “0”]?vmxpri) [pbx_config]
63. Set(VMX_CONTEXT=${DB_RESULT}) [pbx_config]
[vmxpri] 64. GotoIf($["${DB_EXISTS(AMPUSER/${MEXTEN}/vmx/${MODE}/${ACTION}/pri)}" = “0”]?vmxgoto) [pbx_config]
65. Set(VMX_PRI=${DB_RESULT}) [pbx_config]
[vmxgoto] 66. Goto(${VMX_CONTEXT},${VMX_EXT},${VMX_PRI}) [pbx_config]
[nofile] 67. Noop(File for mode: ${MODE} does not exist, SYSTEMSTATUS: ${SYSTEMSTATUS}, going to normal voicemail) [pbx_config]
68. Goto(s-${MMODE},1) [pbx_config]
[tmpgreet] 69. Noop(Temporary Greeting Detected, going to normal voicemail) [pbx_config]
70. Goto(s-${MMODE},1) [pbx_config]
’_s-.’ => 1. Macro(get-vmcontext,${MEXTEN}) [pbx_config]
2. VoiceMail(${MEXTEN}@${VMCONTEXT},${VM_OPTS}u${VMGAIN}) [pbx_config]
3. Goto(exit-${VMSTATUS},1) [pbx_config]
Include => ‘macro-vm-custom’ [pbx_config]

[ Context ‘macro-block-cf’ created by ‘pbx_config’ ]
‘s-ANSWER’ => 1. Noop(Call successfully answered - Hanging up now) [pbx_config]
2. Macro(hangupcall,) [pbx_config]
’_X.’ => 1. Hangup() [pbx_config]
Include => ‘macro-block-cf-custom’ [pbx_config]

[ Context ‘macro-setmusic’ created by ‘pbx_config’ ]
‘s’ => 1. Set(CHANNEL(musicclass)=${ARG1}) [pbx_config]
Include => ‘macro-setmusic-custom’ [pbx_config]

[ Context ‘macro-dial-confirm’ created by ‘pbx_config’ ]
‘s’ => 1. Set(DB(RG/${ARG4}/${CHANNEL})=RINGING) [pbx_config]
2. Set(__UNIQCHAN=${CHANNEL}) [pbx_config]
3. Set(USE_CONFIRMATION=TRUE) [pbx_config]
4. Set(RINGGROUP_INDEX=${ARG4}) [pbx_config]
5. Set(FORCE_CONFIRM=) [pbx_config]
6. Set(ARG4=) [pbx_config]
7. Macro(dial,${ARG1},${ARG2},${ARG3}) [pbx_config]
8. Noop(Deleting: RG/${RINGGROUP_INDEX}/${CHANNEL} ${DB_DELETE(RG/${RINGGROUP_INDEX}/${CHANNEL})}) [pbx_config]
9. Set(USE_CONFIRMATION=) [pbx_config]
10. Set(RINGGROUP_INDEX=) [pbx_config]
Include => ‘macro-dial-confirm-custom’ [pbx_config]

[ Context ‘vm-callme’ created by ‘pbx_config’ ]
’#’ => 1. Playback(vm-goodbye) [pbx_config]
2. Hangup() [pbx_config]
’*’ => 1. Macro(get-vmcontext,${MBOX}) [pbx_config]
2. VoiceMailMain(${MBOX}@${VMCONTEXT},s) [pbx_config]
‘5’ => 1. Goto(s,repeat) [pbx_config]
‘h’ => 1. Hangup() [pbx_config]
‘i’ => 1. Playback(pm-invalid-option) [pbx_config]
2. Goto(s,repeat) [pbx_config]
‘s’ => 1. Answer() [pbx_config]
2. Wait(1) [pbx_config]
[repeat] 3. Background(${MSG}&silence/2&vm-repeat&vm-starmain) [pbx_config]
4. WaitExten(15,) [pbx_config]
‘t’ => 1. Playback(vm-goodbye) [pbx_config]
2. Hangup() [pbx_config]
Include => ‘vm-callme-custom’ [pbx_config]

[ Context ‘from-dahdi’ created by ‘pbx_config’ ]
‘s’ => 1. Noop(Entering from-dahdi with DID == ${DID}) [pbx_config]
2. Ringing() [pbx_config]
3. Set(DID=${IF($["${DID}"= “”]?s:${DID})}) [pbx_config]
4. Noop(DID is now ${DID}) [pbx_config]
5. GotoIf($["${CHANNEL:0:5}"=“DAHDI”]?dahdiok:checkzap) [pbx_config]
[checkzap] 6. GotoIf($["${CHANNEL:0:3}"=“Zap”]?zapok:neither) [pbx_config]
[neither] 7. Goto(from-pstn,${DID},1) [pbx_config]
8. Macro(Hangupcall,dummy) [pbx_config]
[dahdiok] 9. Noop(Is a DAHDi Channel) [pbx_config]
10. Set(CHAN=${CHANNEL:6}) [pbx_config]
11. Set(CHAN=${CUT(CHAN,-,1)}) [pbx_config]
12. Macro(from-dahdi-${CHAN},${DID},1) [pbx_config]
13. Noop(Returned from Macro from-dahdi-${CHAN}) [pbx_config]
14. Goto(from-pstn,${DID},1) [pbx_config]
[zapok] 15. Noop(Is a Zaptel Channel) [pbx_config]
16. Set(CHAN=${CHANNEL:4}) [pbx_config]
17. Set(CHAN=${CUT(CHAN,-,1)}) [pbx_config]
18. Macro(from-dahdi-${CHAN},${DID},1) [pbx_config]
19. Noop(Returned from Macro from-dahdi-${CHAN}) [pbx_config]
20. Goto(from-pstn,${DID},1) [pbx_config]
’_X.’ => 1. Set(DID=${EXTEN}) [pbx_config]
2. Goto(s,1) [pbx_config]
Include => ‘from-dahdi-custom’ [pbx_config]

[ Context ‘from-zaptel’ created by ‘pbx_config’ ]
‘foo’ => 1. Noop(bar) [pbx_config]
Include => ‘from-zaptel-custom’ [pbx_config]
Include => ‘from-dahdi’ [pbx_config]

[ Context ‘macro-outbound-callerid’ created by ‘pbx_config’ ]
‘s’ => 1. ExecIf($["${CALLINGPRES_SV}" != “”]?Set(CALLERPRES()=${CALLINGPRES_SV})) [pbx_config]
2. ExecIf($["${REALCALLERIDNUM:1:2}" = “”]?Set(REALCALLERIDNUM=${CALLERID(number)})) [pbx_config]
[start] 3. GotoIf($[ $["${REALCALLERIDNUM}" = “”] | $["${KEEPCID}" != “TRUE”] | $["${OUTKEEPCID_${ARG1}}" = “on”] ]?normcid) [pbx_config]
4. Set(USEROUTCID=${REALCALLERIDNUM}) [pbx_config]
5. GotoIf($[“foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}” = “foo”]?bypass) [pbx_config]
[normcid] 6. Set(USEROUTCID=${DB(AMPUSER/${AMPUSER}/outboundcid)}) [pbx_config]
[bypass] 7. Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)}) [pbx_config]
8. Set(TRUNKOUTCID=${OUTCID_${ARG1}}) [pbx_config]
9. GotoIf($["${EMERGENCYROUTE:1:2}" = “” | “${EMERGENCYCID:1:2}” = “”]?trunkcid) [pbx_config]
10. Set(CALLERID(all)=${EMERGENCYCID}) [pbx_config]
[exit] 11. MacroExit() [pbx_config]
[trunkcid] 12. ExecIf($[${LEN(${TRUNKOUTCID})} != 0]?Set(CALLERID(all)=${TRUNKOUTCID})) [pbx_config]
[usercid] 13. ExecIf($[${LEN(${USEROUTCID})} != 0]?Set(CALLERID(all)=${USEROUTCID})) [pbx_config]
14. ExecIf($[${LEN(${TRUNKCIDOVERRIDE})} != 0 | ${LEN(${FORCEDOUTCID_${ARG1}})} != 0]?Set(CALLERID(all)=${IF($[${LEN(${FORCEDOUTCID_${ARG1}})}=0]?${TRUNKCIDOVERRIDE}:${FORCEDOUTCID_${ARG1}})})) [pbx_config]
[hidecid] 15. ExecIf($["${CALLERID(name)}"=“hidden”]?Set(CALLERPRES()=prohib_passed_screen)) [pbx_config]
Include => ‘macro-outbound-callerid-custom’ [pbx_config]

[ Context ‘macro-dialout-enum’ created by ‘pbx_config’ ]
‘17’ => 1. Goto(s-BUSY,1) [pbx_config]
‘18’ => 1. Goto(s-NOANSWER,1) [pbx_config]
‘22’ => 1. Goto(s-CHANGED,1) [pbx_config]
‘23’ => 1. Goto(s-CHANGED,1) [pbx_config]
‘28’ => 1. Goto(s-INVALIDNMBR,1) [pbx_config]
‘bypass’ => 1. Noop(TRUNK: ${OUT_${DIAL_TRUNK}} BYPASSING because dialout-trunk-predial-hook) [pbx_config]
‘continue’ => 1. GotoIf($["${OUTFAIL_${ARG1}}" = “”]?noreport) [pbx_config]
2. AGI(${OUTFAIL_${ARG1}}) [pbx_config]
[noreport] 3. Noop(TRUNK Dial failed due to ${DIALSTATUS} HANGUPCAUSE: ${HANGUPCAUSE} - failing through to other trunks) [pbx_config]
4. Set(CALLERID(number)=${AMPUSER}) [pbx_config]
‘disabletrunk’ => 1. Noop(TRUNK: ${OUT_${DIAL_TRUNK}} DISABLED - falling through to next trunk) [pbx_config]
‘h’ => 1. Macro(hangupcall,) [pbx_config]
‘s’ => 1. GosubIf($[$["${ARG3}" != “”] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != “NOPASSWD”]]?sub-pincheck,s,1()) [pbx_config]
2. GotoIf($[“x${OUTDISABLE_${DIAL_TRUNK}}” = “xon”]?disabletrunk,1) [pbx_config]
3. Set(DIAL_TRUNK_OPTIONS=${DIAL_OPTIONS}) [pbx_config]
4. Set(OUTBOUND_GROUP=OUT_${ARG1}) [pbx_config]
5. GotoIf($["${OUTMAXCHANS_${ARG1}}foo" = “foo”]?nomax) [pbx_config]
6. GotoIf($[ ${GROUP_COUNT(OUT_${ARG1})} >= ${OUTMAXCHANS_${ARG1}} ]?nochans) [pbx_config]
[nomax] 7. Set(DIAL_NUMBER=${ARG2}) [pbx_config]
8. Set(DIAL_TRUNK=${ARG1}) [pbx_config]
9. GotoIf($["${INTRACOMPANYROUTE}" = “YES”]?skipoutcid) [pbx_config]
10. Set(DIAL_TRUNK_OPTIONS=${TRUNK_OPTIONS}) [pbx_config]
11. Macro(outbound-callerid,${DIAL_TRUNK}) [pbx_config]
[skipoutcid] 12. GosubIf($["${PREFIX_TRUNK_${DIAL_TRUNK}}" != “”]?sub-flp-${DIAL_TRUNK},s,1()) [pbx_config]
13. AGI(enumlookup.agi) [pbx_config]
14. ExecIf($["${DB(AMPUSER/${AMPUSER}/cidname)}" != “”]?Set(CONNECTEDLINE(num,i)=${DIAL_NUMBER})) [pbx_config]
15. ExecIf($["${DB(AMPUSER/${AMPUSER}/cidname)}" != “”]?Set(CONNECTEDLINE(name,i)=CID:${CALLERID(number)})) [pbx_config]
[dialloop] 16. GotoIf($[“foo${DIALARR}”=“foo”]?s-${DIALSTATUS},1) [pbx_config]
17. ExecIf($["${MOHCLASS}"!=“default” & “${MOHCLASS}”!="" & “${FORCE_CONFIRM}”="" ]?Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS})) [pbx_config]
18. ExecIf($["${FORCE_CONFIRM}"!="" ]?Set(DIAL_TRUNK_OPTIONS=M(confirm)${DIAL_TRUNK_OPTIONS})) [pbx_config]
19. Set(TRYDIAL=${CUT(DIALARR,%,1)}) [pbx_config]
20. Set(DIALARR=${CUT(DIALARR,%,2-)}) [pbx_config]
21. Dial(${TRYDIAL},${DIAL_TRUNK_OPTIONS}) [pbx_config]
22. GotoIf($[ $[ “${DIALSTATUS}” = “CHANUNAVAIL” ] | $[ “${DIALSTATUS}” = “CONGESTION” ] ]?dialloop:s-${DIALSTATUS},1) [pbx_config]
[nochans] 23. Noop(max channels used up) [pbx_config]
‘s-ANSWER’ => 1. Noop(Call successfully answered - Hanging up now) [pbx_config]
2. Macro(hangupcall,) [pbx_config]
‘s-BUSY’ => 1. Noop(Dial failed due to trunk reporting BUSY - giving up) [pbx_config]
2. Playtones(busy) [pbx_config]
3. Busy(20) [pbx_config]
‘s-CHANGED’ => 1. Noop(Dial failed due to trunk reporting Number Changed - giving up) [pbx_config]
2. Playtones(busy) [pbx_config]
3. Busy(20) [pbx_config]
‘s-INVALIDNMBR’ => 1. Noop(Dial failed due to trunk reporting Address Incomplete - giving up) [pbx_config]
2. Progress() [pbx_config]
3. Playback(ss-noservice,noanswer) [pbx_config]
4. Busy(20) [pbx_config]
‘s-NOANSWER’ => 1. Noop(Dial failed due to trunk reporting NOANSWER - giving up) [pbx_config]
2. Progress() [pbx_config]
3. Playback(number-not-answering,noanswer) [pbx_config]
4. Congestion(20) [pbx_config]
’_s-.’ => 1. Set(RC=${IF($[${ISNULL(${HANGUPCAUSE})}]?0:${HANGUPCAUSE})}) [pbx_config]
2. Goto(${RC},1) [pbx_config]
’_X.’ => 1. Goto(continue,1) [pbx_config]
’_X’ => 1. Goto(continue,1) [pbx_config]
Include => ‘macro-dialout-enum-custom’ [pbx_config]

[ Context ‘macro-user-callerid’ created by ‘pbx_config’ ]
‘h’ => 1. Macro(hangupcall,) [pbx_config]
‘s’ => 1. Set(AMPUSER=${IF($[“foo${AMPUSER}” = “foo”]?${CALLERID(number)}:${AMPUSER})}) [pbx_config]
2. GotoIf($["${CUT(CHANNEL,@,2):5:5}"=“queue” | ${LEN(${AMPUSERCIDNAME})}]?report) [pbx_config]
3. ExecIf($["${REALCALLERIDNUM:1:2}" = “”]?Set(REALCALLERIDNUM=${CALLERID(number)})) [pbx_config]
4. Set(AMPUSER=${DB(DEVICE/${REALCALLERIDNUM}/user)}) [pbx_config]
5. Set(AMPUSERCIDNAME=${DB(AMPUSER/${AMPUSER}/cidname)}) [pbx_config]
6. GotoIf($[“x${AMPUSERCIDNAME:1:2}” = “x”]?report) [pbx_config]
7. Set(AMPUSERCID=${IF($["${DB_EXISTS(AMPUSER/${AMPUSER}/cidnum)}" = “1”]?${DB_RESULT}:${AMPUSER})}) [pbx_config]
8. Set(CALLERID(all)="${AMPUSERCIDNAME}" <${AMPUSERCID}>) [pbx_config]
9. GotoIf($["${ARG1}"=“LIMIT” & ${LEN(${AMPUSER})} & “${DB(AMPUSER/${AMPUSER}/concurrency_limit)}”>“0” & “${GROUP_COUNT(${AMPUSER}@concurrency_limit)}”>="${DB(AMPUSER/${AMPUSER}/concurrency_limit)}"]?limit) [pbx_config]
10. ExecIf($["${ARG1}"=“LIMIT” & ${LEN(${AMPUSER})}]?Set(GROUP(concurrency_limit)=${AMPUSER})) [pbx_config]
[report] 11. GotoIf($[ “${ARG1}” = “SKIPTTL” | “${ARG1}” = “LIMIT” ]?continue) [pbx_config]
[report2] 12. Set(__TTL=${IF($[“foo${TTL}” = “foo”]?64:$[ ${TTL} - 1 ])}) [pbx_config]
13. GotoIf($[ ${TTL} > 0 ]?continue) [pbx_config]
14. Wait(${RINGTIMER}) [pbx_config]
15. Answer() [pbx_config]
16. Wait(1) [pbx_config]
17. Playback(im-sorry&an-error-has-occured&with&call-forwarding) [pbx_config]
18. Macro(hangupcall,) [pbx_config]
[limit] 19. Answer() [pbx_config]
20. Wait(1) [pbx_config]
21. Playback(beep&im-sorry&your&simul-call-limit-reached&goodbye) [pbx_config]
22. Macro(hangupcall,) [pbx_config]
23. Congestion(20) [pbx_config]
[continue] 24. Set(CALLERID(number)=${CALLERID(number):0:40}) [pbx_config]
25. Set(CALLERID(name)=${CALLERID(name):0:40}) [pbx_config]
26. Set(CHANNEL(language)=${MASTER_CHANNEL(CHANNEL(language))}) [pbx_config]
Include => ‘macro-user-callerid-custom’ [pbx_config]

[ Context ‘macro-dialout-dundi’ created by ‘pbx_config’ ]
‘17’ => 1. Goto(s-BUSY,1) [pbx_config]
‘18’ => 1. Goto(s-NOANSWER,1) [pbx_config]
‘22’ => 1. Goto(s-CHANGED,1) [pbx_config]
‘23’ => 1. Goto(s-CHANGED,1) [pbx_config]
‘28’ => 1. Goto(s-INVALIDNMBR,1) [pbx_config]
‘bypass’ => 1. Noop(TRUNK: ${OUT_${DIAL_TRUNK}} BYPASSING because dialout-dundi-predial-hook) [pbx_config]
‘continue’ => 1. GotoIf($["${OUTFAIL_${ARG1}}" = “”]?noreport) [pbx_config]
2. AGI(${OUTFAIL_${ARG1}}) [pbx_config]
[noreport] 3. Noop(TRUNK Dial failed due to ${DIALSTATUS} HANGUPCAUSE: ${HANGUPCAUSE} - failing through to other trunks) [pbx_config]
4. Set(CALLERID(number)=${AMPUSER}) [pbx_config]
‘disabletrunk’ => 1. Noop(TRUNK: ${OUT_${DIAL_TRUNK}} DISABLED - falling through to next trunk) [pbx_config]
‘h’ => 1. Macro(hangupcall,) [pbx_config]
‘s’ => 1. Set(DIAL_TRUNK=${ARG1}) [pbx_config]
2. GosubIf($[$["${ARG3}" != “”] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != “NOPASSWD”]]?sub-pincheck,s,1()) [pbx_config]
3. GotoIf($[“x${OUTDISABLE_${DIAL_TRUNK}}” = “xon”]?disabletrunk,1) [pbx_config]
4. Set(DIAL_NUMBER=${ARG2}) [pbx_config]
5. Set(DIAL_TRUNK_OPTIONS=${DIAL_OPTIONS}) [pbx_config]
6. Set(OUTBOUND_GROUP=OUT_${DIAL_TRUNK}) [pbx_config]
7. GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}foo" = “foo”]?nomax) [pbx_config]
8. GotoIf($[ ${GROUP_COUNT(OUT_${DIAL_TRUNK})} >= ${OUTMAXCHANS_${DIAL_TRUNK}} ]?chanfull) [pbx_config]
[nomax] 9. GotoIf($["${INTRACOMPANYROUTE}" = “YES”]?skipoutcid) [pbx_config]
10. Set(DIAL_TRUNK_OPTIONS=${TRUNK_OPTIONS}) [pbx_config]
11. Macro(outbound-callerid,${DIAL_TRUNK}) [pbx_config]
[skipoutcid] 12. GosubIf($["${PREFIX_TRUNK_${DIAL_TRUNK}}" != “”]?sub-flp-${DIAL_TRUNK},s,1()) [pbx_config]
13. Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER}) [pbx_config]
14. ExecIf($["${MOHCLASS}"!=“default” & “${MOHCLASS}”!="" & “${FORCE_CONFIRM}”="" ]?Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS})) [pbx_config]
15. ExecIf($["${FORCE_CONFIRM}"!="" ]?Set(DIAL_TRUNK_OPTIONS=${DIAL_TRUNK_OPTIONS}M(confirm))) [pbx_config]
[gocall] 16. Macro(dialout-dundi-predial-hook,) [pbx_config]
17. GotoIf($["${PREDIAL_HOOK_RET}" = “BYPASS”]?bypass,1) [pbx_config]
18. ExecIf($["${DB(AMPUSER/${AMPUSER}/cidname)}" != “”]?Set(CONNECTEDLINE(num,i)=${DIAL_NUMBER})) [pbx_config]
19. ExecIf($["${DB(AMPUSER/${AMPUSER}/cidname)}" != “”]?Set(CONNECTEDLINE(name,i)=CID:${CALLERID(number)})) [pbx_config]
20. Macro(dundi-${DIAL_TRUNK},${OUTNUM}) [pbx_config]
21. Goto(s-${DIALSTATUS},1) [pbx_config]
[chanfull] 22. Noop(max channels used up) [pbx_config]
‘s-ANSWER’ => 1. Noop(Call successfully answered - Hanging up now) [pbx_config]
2. Macro(hangupcall,) [pbx_config]
‘s-BUSY’ => 1. Noop(Dial failed due to trunk reporting BUSY - giving up) [pbx_config]
2. Playtones(busy) [pbx_config]
3. Busy(20) [pbx_config]
‘s-CHANGED’ => 1. Noop(Dial failed due to trunk reporting Number Changed - giving up) [pbx_config]
2. Playtones(busy) [pbx_config]
3. Busy(20) [pbx_config]
‘s-INVALIDNMBR’ => 1. Noop(Dial failed due to trunk reporting Address Incomplete - giving up) [pbx_config]
2. Progress() [pbx_config]
3. Playback(ss-noservice,noanswer) [pbx_config]
4. Busy(20) [pbx_config]
‘s-NOANSWER’ => 1. Noop(Dial failed due to trunk reporting NOANSWER - giving up) [pbx_config]
2. Progress() [pbx_config]
3. Playback(number-not-answering,noanswer) [pbx_config]
4. Congestion(20) [pbx_config]
’_s-.’ => 1. Set(RC=${IF($[${ISNULL(${HANGUPCAUSE})}]?0:${HANGUPCAUSE})}) [pbx_config]
2. Goto(${RC},1) [pbx_config]
’_X.’ => 1. Goto(continue,1) [pbx_config]
’_X’ => 1. Goto(continue,1) [pbx_config]
Include => ‘macro-dialout-dundi-custom’ [pbx_config]

[ Context ‘macro-dialout-trunk’ created by ‘pbx_config’ ]
‘17’ => 1. Goto(s-BUSY,1) [pbx_config]
‘18’ => 1. Goto(s-NOANSWER,1) [pbx_config]
‘22’ => 1. Goto(s-CHANGED,1) [pbx_config]
‘23’ => 1. Goto(s-CHANGED,1) [pbx_config]
‘28’ => 1. Goto(s-INVALIDNMBR,1) [pbx_config]
‘bypass’ => 1. Noop(TRUNK: ${OUT_${DIAL_TRUNK}} BYPASSING because dialout-trunk-predial-hook) [pbx_config]
‘continue’ => 1. GotoIf($["${OUTFAIL_${ARG1}}" = “”]?noreport) [pbx_config]
2. AGI(${OUTFAIL_${ARG1}}) [pbx_config]
[noreport] 3. Noop(TRUNK Dial failed due to ${DIALSTATUS} HANGUPCAUSE: ${HANGUPCAUSE} - failing through to other trunks) [pbx_config]
4. Set(CALLERID(number)=${AMPUSER}) [pbx_config]
‘disabletrunk’ => 1. Noop(TRUNK: ${OUT_${DIAL_TRUNK}} DISABLED - falling through to next trunk) [pbx_config]
‘h’ => 1. Macro(hangupcall,) [pbx_config]
‘s’ => 1. Set(DIAL_TRUNK=${ARG1}) [pbx_config]
2. GosubIf($[$["${ARG3}" != “”] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != “NOPASSWD”]]?sub-pincheck,s,1()) [pbx_config]
3. GotoIf($[“x${OUTDISABLE_${DIAL_TRUNK}}” = “xon”]?disabletrunk,1) [pbx_config]
4. Set(DIAL_NUMBER=${ARG2}) [pbx_config]
5. Set(DIAL_TRUNK_OPTIONS=${DIAL_OPTIONS}) [pbx_config]
6. Set(OUTBOUND_GROUP=OUT_${DIAL_TRUNK}) [pbx_config]
7. GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}foo" = “foo”]?nomax) [pbx_config]
8. GotoIf($[ ${GROUP_COUNT(OUT_${DIAL_TRUNK})} >= ${OUTMAXCHANS_${DIAL_TRUNK}} ]?chanfull) [pbx_config]
[nomax] 9. GotoIf($["${INTRACOMPANYROUTE}" = “YES”]?skipoutcid) [pbx_config]
10. Set(DIAL_TRUNK_OPTIONS=${TRUNK_OPTIONS}) [pbx_config]
11. Macro(outbound-callerid,${DIAL_TRUNK}) [pbx_config]
[skipoutcid] 12. GosubIf($["${PREFIX_TRUNK_${DIAL_TRUNK}}" != “”]?sub-flp-${DIAL_TRUNK},s,1()) [pbx_config]
13. Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER}) [pbx_config]
14. Set(custom=${CUT(OUT_${DIAL_TRUNK},:,1)}) [pbx_config]
15. ExecIf($["${MOHCLASS}"!=“default” & “${MOHCLASS}”!="" & “${FORCE_CONFIRM}”="" ]?Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS})) [pbx_config]
16. ExecIf($["${FORCE_CONFIRM}"!="" ]?Set(DIAL_TRUNK_OPTIONS=${DIAL_TRUNK_OPTIONS}M(confirm))) [pbx_config]
[gocall] 17. Macro(dialout-trunk-predial-hook,) [pbx_config]
18. GotoIf($["${PREDIAL_HOOK_RET}" = “BYPASS”]?bypass,1) [pbx_config]
19. ExecIf($["${DB(AMPUSER/${AMPUSER}/cidname)}" != “”]?Set(CONNECTEDLINE(num,i)=${DIAL_NUMBER})) [pbx_config]
20. ExecIf($["${DB(AMPUSER/${AMPUSER}/cidname)}" != “”]?Set(CONNECTEDLINE(name,i)=CID:${CALLERID(number)})) [pbx_config]
21. GotoIf($["${custom}" = “AMP”]?customtrunk) [pbx_config]
22. Dial(${OUT_${DIAL_TRUNK}}/${OUTNUM},300,${DIAL_TRUNK_OPTIONS}) [pbx_config]
23. Noop(Dial failed for some reason with DIALSTATUS = ${DIALSTATUS} and HANGUPCAUSE = ${HANGUPCAUSE}) [pbx_config]
24. Goto(s-${DIALSTATUS},1) [pbx_config]
[customtrunk] 25. Set(pre_num=${CUT(OUT_${DIAL_TRUNK},$,1)}) [pbx_config]
26. Set(the_num=${CUT(OUT_${DIAL_TRUNK},$,2)}) [pbx_config]
27. Set(post_num=${CUT(OUT_${DIAL_TRUNK},$,3)}) [pbx_config]
28. GotoIf($["${the_num}" = “OUTNUM”]?outnum:skipoutnum) [pbx_config]
[outnum] 29. Set(the_num=${OUTNUM}) [pbx_config]
[skipoutnum] 30. Dial(${pre_num:4}${the_num}${post_num},300,${DIAL_TRUNK_OPTIONS}) [pbx_config]
31. Noop(Dial failed for some reason with DIALSTATUS = ${DIALSTATUS} and HANGUPCAUSE = ${HANGUPCAUSE}) [pbx_config]
32. Goto(s-${DIALSTATUS},1) [pbx_config]
[chanfull] 33. Noop(max channels used up) [pbx_config]
‘s-ANSWER’ => 1. Noop(Call successfully answered - Hanging up now) [pbx_config]
2. Macro(hangupcall,) [pbx_config]
‘s-BUSY’ => 1. Noop(Dial failed due to trunk reporting BUSY - giving up) [pbx_config]
2. Playtones(busy) [pbx_config]
3. Busy(20) [pbx_config]
‘s-CHANGED’ => 1. Noop(Dial failed due to trunk reporting Number Changed - giving up) [pbx_config]
2. Playtones(busy) [pbx_config]
3. Busy(20) [pbx_config]
‘s-INVALIDNMBR’ => 1. Noop(Dial failed due to trunk reporting Address Incomplete - giving up) [pbx_config]
2. Progress() [pbx_config]
3. Playback(ss-noservice,noanswer) [pbx_config]
4. Busy(20) [pbx_config]
‘s-NOANSWER’ => 1. Noop(Dial failed due to trunk reporting NOANSWER - giving up) [pbx_config]
2. Progress() [pbx_config]
3. Playback(number-not-answering,noanswer) [pbx_config]
4. Congestion(20) [pbx_config]
’_s-.’ => 1. Set(RC=${IF($[${ISNULL(${HANGUPCAUSE})}]?0:${HANGUPCAUSE})}) [pbx_config]
2. Goto(${RC},1) [pbx_config]
’_X.’ => 1. Goto(continue,1) [pbx_config]
’_X’ => 1. Goto(continue,1) [pbx_config]
Include => ‘macro-dialout-trunk-custom’ [pbx_config]

[ Context ‘sub-pincheck’ created by ‘pbx_config’ ]
‘s’ => 1. Authenticate(${ARG3},) [pbx_config]
2. ResetCDR() [pbx_config]
3. Return() [pbx_config]
Include => ‘sub-pincheck-custom’ [pbx_config]

[ Context ‘macro-auto-blkvm’ created by ‘pbx_config’ ]
‘s’ => 1. Set(__MACRO_RESULT=) [pbx_config]
2. Macro(blkvm-clr,) [pbx_config]
3. ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && “${DB(AMPUSER/${AMPUSER}/cidname)}” != “”]?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=${DIALEDPEERNUMBER})) [pbx_config]
4. ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && “${DB(AMPUSER/${AMPUSER}/cidname)}” != “”]?Set(MASTER_CHANNEL(CONNECTEDLINE(name))=${DB(AMPUSER/${DIALEDPEERNUMBER}/cidname)})) [pbx_config]
Include => ‘macro-auto-blkvm-custom’ [pbx_config]

[ Context ‘macro-auto-confirm’ created by ‘pbx_config’ ]
‘s’ => 1. Set(__MACRO_RESULT=) [pbx_config]
2. Macro(blkvm-clr,) [pbx_config]
3. Noop(Deleting: RG/${ARG1}/${UNIQCHAN} ${DB_DELETE(RG/${ARG1}/${UNIQCHAN})}) [pbx_config]
4. ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && “${DB(AMPUSER/${AMPUSER}/cidname)}]” != “”?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=${DIALEDPEERNUMBER})) [pbx_config]
5. ExecIf($[!${REGEX("[^0-9]" ${DIALEDPEERNUMBER})} && “${DB(AMPUSER/${AMPUSER}/cidname)}]” != “”?Set(MASTER_CHANNEL(CONNECTEDLINE(name))=${DB(AMPUSER/${DIALEDPEERNUMBER}/cidname)})) [pbx_config]
Include => ‘macro-auto-confirm-custom’ [pbx_config]

[ Context ‘macro-confirm’ created by ‘pbx_config’ ]
‘1’ => 1. GotoIf($["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}"=“0” & “${SHARED(ANSWER_STATUS,${FORCE_CONFIRM})}”=""]?toolate,1) [pbx_config]
2. Noop(Deleting: RG/${ARG3}/${UNIQCHAN} ${DB_DELETE(RG/${ARG3}/${UNIQCHAN})}) [pbx_config]
3. Macro(blkvm-clr,) [pbx_config]
4. Set(SHARED(ANSWER_STATUS,${FORCE_CONFIRM})=) [pbx_config]
[skip] 5. Set(__MACRO_RESULT=) [pbx_config]
6. ExecIf($[("${MOHCLASS}"!=“default”) & ("${MOHCLASS}"!="")]?Set(CHANNEL(musicclass)=${MOHCLASS})) [pbx_config]
[exitopt1] 7. MacroExit() [pbx_config]
‘2’ => 1. Goto(noanswer,1) [pbx_config]
‘3’ => 1. SayDigits(${CALLCONFIRMCID}) [pbx_config]
2. GotoIf($["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}"=“0” & “${SHARED(ANSWER_STATUS,${FORCE_CONFIRM})}”=""]?toolate,1:s,start) [pbx_config]
‘h’ => 1. Macro(hangupcall,) [pbx_config]
‘noanswer’ => 1. Set(__MACRO_RESULT=ABORT) [pbx_config]
[exitnoanswer] 2. MacroExit() [pbx_config]
‘s’ => 1. Set(LOOPCOUNT=0) [pbx_config]
2. Set(__MACRO_RESULT=ABORT) [pbx_config]
3. Set(MSG1=${IF($["${ARG1}${ALT_CONFIRM_MSG}"=""]?incoming-call-1-accept-2-decline:${IF($[${LEN(${ALT_CONFIRM_MSG})}>0]?${ALT_CONFIRM_MSG}:${ARG1})})}) [pbx_config]
[start] 4. Background(${MSG1},m,${CHANNEL(language)},macro-confirm) [pbx_config]
5. Read(INPUT,1,4) [pbx_config]
6. GotoIf($[${LEN(${INPUT})} > 0]?${INPUT},1:t,1) [pbx_config]
‘t’ => 1. GotoIf($["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}"=“0” & “${SHARED(ANSWER_STATUS,${FORCE_CONFIRM})}”=""]?toolate,1) [pbx_config]
2. Set(LOOPCOUNT=$[ ${LOOPCOUNT} + 1 ]) [pbx_config]
3. GotoIf($[ ${LOOPCOUNT} < 5 ]?s,start:noanswer,1) [pbx_config]
‘toolate’ => 1. Set(MSG2=${IF($[“foo${ARG2}” != “foo”]?${ARG2}:“incoming-call-no-longer-avail”)}) [pbx_config]
2. Playback(${MSG2}) [pbx_config]
3. Set(__MACRO_RESULT=ABORT) [pbx_config]
[exittoolate] 4. MacroExit() [pbx_config]
’_X’ => 1. Background(invalid,m,${CHANNEL(language)},macro-confirm) [pbx_config]
2. GotoIf($["${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}"=“0” | “${SHARED(ANSWER_STATUS,${FORCE_CONFIRM})}”=""]?toolate,1) [pbx_config]
3. Set(LOOPCOUNT=$[ ${LOOPCOUNT} + 1 ]) [pbx_config]
4. GotoIf($[ ${LOOPCOUNT} < 5 ]?s,start:noanswer,1) [pbx_config]
Include => ‘macro-confirm-custom’ [pbx_config]

[ Context ‘bad-number’ created by ‘pbx_config’ ]
’_X.’ => 1. ResetCDR() [pbx_config]
2. NoCDR() [pbx_config]
3. Progress() [pbx_config]
4. Wait(1) [pbx_config]
5. Progress() [pbx_config]
6. Playback(silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer) [pbx_config]
7. Wait(1) [pbx_config]
8. Congestion(20) [pbx_config]
9. Hangup() [pbx_config]
Include => ‘bad-number-custom’ [pbx_config]

[ Context ‘app-blackhole’ created by ‘pbx_config’ ]
‘busy’ => 1. Noop(Blackhole Dest: Busy) [pbx_config]
2. Busy(20) [pbx_config]
3. Hangup() [pbx_config]
‘congestion’ => 1. Noop(Blackhole Dest: Congestion) [pbx_config]
2. Answer() [pbx_config]
3. Playtones(congestion) [pbx_config]
4. Congestion(20) [pbx_config]
5. Hangup() [pbx_config]
‘hangup’ => 1. Noop(Blackhole Dest: Hangup) [pbx_config]
2. Hangup() [pbx_config]
‘musiconhold’ => 1. Noop(Blackhole Dest: Put caller on hold forever) [pbx_config]
2. Answer() [pbx_config]
3. MusicOnHold() [pbx_config]
‘ring’ => 1. Noop(Blackhole Dest: Ring) [pbx_config]
2. Answer() [pbx_config]
3. Playtones(ring) [pbx_config]
4. Wait(300) [pbx_config]
5. Hangup() [pbx_config]
‘zapateller’ => 1. Noop(Blackhole Dest: Play SIT Tone) [pbx_config]
2. Answer() [pbx_config]
3. Zapateller() [pbx_config]
Include => ‘app-blackhole-custom’ [pbx_config]

[ Context ‘outrt-10’ created by ‘pbx_config’ ]
‘61’ => 1. Macro(user-callerid,LIMIT,) [pbx_config]
2. Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})}) [pbx_config]
3. Set(_NODEST=) [pbx_config]
4. Gosub(sub-record-check,s,1(out,${EXTEN},)) [pbx_config]
5. Macro(dialout-trunk,3,${EXTEN:2},) [pbx_config]
6. Macro(outisbusy,) [pbx_config]
Include => ‘outrt-10-custom’ [pbx_config]

[ Context ‘outrt-9’ created by ‘pbx_config’ ]
’_67XXXXX’ => 1. Macro(user-callerid,LIMIT,) [pbx_config]
2. Set(INTRACOMPANYROUTE=YES) [pbx_config]
3. Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})}) [pbx_config]
4. Set(_NODEST=) [pbx_config]
5. Gosub(sub-record-check,s,1(out,${EXTEN},)) [pbx_config]
6. Macro(dialout-trunk,2,${EXTEN:2},) [pbx_config]
7. Macro(outisbusy,) [pbx_config]
’_67XXXX’ => 1. Macro(user-callerid,LIMIT,) [pbx_config]
2. Set(INTRACOMPANYROUTE=YES) [pbx_config]
3. Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})}) [pbx_config]
4. Set(_NODEST=) [pbx_config]
5. Gosub(sub-record-check,s,1(out,${EXTEN},)) [pbx_config]
6. Macro(dialout-trunk,2,${EXTEN:2},) [pbx_config]
7. Macro(outisbusy,) [pbx_config]
’_67XX’ => 1. Macro(user-callerid,LIMIT,) [pbx_config]
2. Set(INTRACOMPANYROUTE=YES) [pbx_config]
3. Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})}) [pbx_config]
4. Set(_NODEST=) [pbx_config]
5. Gosub(sub-record-check,s,1(out,${EXTEN},)) [pbx_config]
6. Macro(dialout-trunk,2,${EXTEN:2},) [pbx_config]
7. Macro(outisbusy,) [pbx_config]
Include => ‘outrt-9-custom’ [pbx_config]

[ Context ‘outbound-allroutes’ created by ‘pbx_config’ ]
‘foo’ => 1. Noop(bar) [pbx_config]
Include => ‘outbound-allroutes-custom’ [pbx_config]
Include => ‘outrt-9’ [pbx_config]
Include => ‘outrt-10’ [pbx_config]

[ Context ‘macro-prepend-cid’ created by ‘pbx_config’ ]
‘s’ => 1. GotoIf($["${RGPREFIX}" = “”]?REPCID) [pbx_config]
2. GotoIf($["${RGPREFIX}" != “${CALLERID(name):0:${LEN(${RGPREFIX})}}”]?REPCID) [pbx_config]
3. Set(CALLERID(name)=${CALLERID(name):${LEN(${RGPREFIX})}}) [pbx_config]
4. Set(_RGPREFIX=) [pbx_config]
[REPCID] 5. Set(_RGPREFIX=${ARG1}) [pbx_config]
6. Set(CALLERID(name)=${RGPREFIX}${CALLERID(name)}) [pbx_config]
Include => ‘macro-prepend-cid-custom’ [pbx_config]

[ Context ‘macro-one-touch-record’ created by ‘pbx_config’ ]
‘s’ => 1. ExecIf($["${PICKUP_EXTEN}"!=""]?Set(THISEXTEN=${CUT(CALLFILENAME,-,2)})) [pbx_config]
2. ExecIf($["${THISEXTEN}"=""]?Set(THISEXTEN=${IF($["${REALCALLERIDNUM}"=""]?${CUT(CALLFILENAME,-,2)}:${FROMEXTEN})})) [pbx_config]
3. ExecIf($["${CUT(CALLFILENAME,-,1)}"=“exten” & “${DB(AMPUSER/${THISEXTEN}/recording/ondemand)}”!=“enabled”]?MacroExit()) [pbx_config]
4. GotoIf($["${MASTER_CHANNEL(ONETOUCH_REC)}"=“RECORDING”]?stoprec) [pbx_config]
5. GotoIf($["${MASTER_CHANNEL(REC_POLICY_MODE)}"=“never”]?stopped) [pbx_config]
6. GotoIf($["${MASTER_CHANNEL(ONETOUCH_REC)}"="" & “${MASTER_CHANNEL(REC_STATUS)}”=“RECORDING”]?recording) [pbx_config]
7. Set(MASTER_CHANNEL(ONETOUCH_REC)=RECORDING) [pbx_config]
8. Set(MASTER_CHANNEL(REC_STATUS)=RECORDING) [pbx_config]
[mixmon] 9. Set(AUDIOHOOK_INHERIT(MixMonitor)=yes) [pbx_config]
10. MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MIXMON_FORMAT},a,${MIXMON_POST}) [pbx_config]
11. Set(MON_FMT=${IF($[${LEN(${MIXMON_FORMAT})}]?${MIXMON_FORMAT}:wav)}) [pbx_config]
12. Set(MASTER_CHANNEL(CDR(recordingfile))=${CALLFILENAME}.${MON_FMT}) [pbx_config]
13. Set(MASTER_CHANNEL(ONETOUCH_RECFILE)=${CALLFILENAME}.${MON_FMT}) [pbx_config]
[recording] 14. Playback(beep) [pbx_config]
15. MacroExit() [pbx_config]
[stoprec] 16. StopMixMonitor() [pbx_config]
17. Set(MASTER_CHANNEL(ONETOUCH_REC)=PAUSED) [pbx_config]
18. Set(MASTER_CHANNEL(REC_STATUS)=PAUSED) [pbx_config]
19. ExecIf($["${THISEXTEN}"=""]?Set(THISEXTEN=${IF($["${REALCALLERIDNUM}"=""]?${DIALEDPEERNUMBER}:${FROMEXTEN})})) [pbx_config]
[stopped] 20. Playback(beep&beep) [pbx_config]
21. MacroExit() [pbx_config]
Include => ‘macro-one-touch-record-custom’ [pbx_config]

[ Context ‘sub-record-check’ created by ‘pbx_config’ ]
‘conf’ => 1. Gosub(recconf,1(${EXTEN},${ARG2},${ARG2})) [pbx_config]
2. Return() [pbx_config]
‘exten’ => 1. GotoIf($["${REC_POLICY_MODE}"!=""]?callee) [pbx_config]
2. Set(__REC_POLICY_MODE=${IF($[${LEN(${FROM_DID})}]?${DB(AMPUSER/${ARG2}/recording/in/external)}:${DB(AMPUSER/${ARG2}/recording/in/internal)})}) [pbx_config]
3. GotoIf($["${REC_POLICY_MODE}"=“dontcare”]?caller) [pbx_config]
4. GotoIf($["${DB(AMPUSER/${FROMEXTEN}/recording/out/internal)}"=“dontcare” | “${FROM_DID}”!=""]?callee) [pbx_config]
5. ExecIf($[${LEN(${DB(AMPUSER/${FROMEXTEN}/recording/priority)})}]?Set(CALLER_PRI=${DB(AMPUSER/${FROMEXTEN}/recording/priority)}):Set(CALLER_PRI=0)) [pbx_config]
6. ExecIf($[${LEN(${DB(AMPUSER/${ARG2}/recording/priority)})}]?Set(CALLEE_PRI=${DB(AMPUSER/${ARG2}/recording/priority)}):Set(CALLEE_PRI=0)) [pbx_config]
7. GotoIf($["${CALLER_PRI}"="${CALLEE_PRI}"]?${REC_POLICY}:${IF($[${CALLER_PRI}>${CALLEE_PRI}]?caller:callee)}) [pbx_config]
[callee] 8. GosubIf($["${REC_POLICY_MODE}"=“always”]?record,1(${EXTEN},${ARG2},${FROMEXTEN})) [pbx_config]
9. Return() [pbx_config]
[caller] 10. Set(REC_POLICY_MODE=${DB(AMPUSER/${FROMEXTEN}/recording/out/internal)}) [pbx_config]
11. GosubIf($["${REC_POLICY_MODE}"=“always”]?record,1(${EXTEN},${ARG2},${FROMEXTEN})) [pbx_config]
12. Return() [pbx_config]
‘force’ => 1. GosubIf($["${REC_POLICY_MODE}"=“always”]?record,1(${EXTEN},${REC_POLICY_MODE},${FROMEXTEN})) [pbx_config]
2. Return() [pbx_config]
‘out’ => 1. ExecIf($["${REC_POLICY_MODE}"=""]?Set(__REC_POLICY_MODE=${DB(AMPUSER/${FROMEXTEN}/recording/out/external)})) [pbx_config]
2. GosubIf($["${REC_POLICY_MODE}"=“always”]?record,1(exten,${ARG2},${FROMEXTEN})) [pbx_config]
3. Return() [pbx_config]
‘page’ => 1. GosubIf($["${REC_POLICY_MODE}"=“always”]?recconf,1(${EXTEN},${ARG2},${FROMEXTEN})) [pbx_config]
2. Return() [pbx_config]
‘q’ => 1. GosubIf($["${REC_POLICY_MODE}"=“always”]?recq,1(${EXTEN},${ARG2},${FROMEXTEN})) [pbx_config]
2. Return() [pbx_config]
‘recconf’ => 1. Set(__CALLFILENAME=${IF($[${MEETME_INFO(parties,${ARG2})}]?${DB(RECCONF/${ARG2})}:${ARG1}-${ARG2}-${ARG3}-${TIMESTR}-${UNIQUEID})}) [pbx_config]
2. ExecIf($[!${MEETME_INFO(parties,${ARG2})}]?Set(DB(RECCONF/${ARG2})=${CALLFILENAME})) [pbx_config]
3. Set(MEETME_RECORDINGFILE=${IF($[${LEN(${MIXMON_DIR})}]?${MIXMON_DIR}:${ASTSPOOLDIR}/monitor/)}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}) [pbx_config]
4. Set(MEETME_RECORDINGFORMAT=${MIXMON_FORMAT}) [pbx_config]
5. ExecIf($["${REC_POLICY_MODE}"!=“always”]?Return()) [pbx_config]
6. Set(__REC_STATUS=RECORDING) [pbx_config]
7. Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT}) [pbx_config]
8. Return() [pbx_config]
‘record’ => 1. Set(AUDIOHOOK_INHERIT(MixMonitor)=yes) [pbx_config]
2. MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MIXMON_FORMAT},${MIXMON_POST}) [pbx_config]
3. Set(__REC_STATUS=RECORDING) [pbx_config]
4. Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT}) [pbx_config]
5. Return() [pbx_config]
‘recq’ => 1. Set(AUDIOHOOK_INHERIT(MixMonitor)=yes) [pbx_config]
2. Set(MONITOR_FILENAME=${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}) [pbx_config]
3. Set(__REC_STATUS=RECORDING) [pbx_config]
4. Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT}) [pbx_config]
5. Return() [pbx_config]
‘rg’ => 1. GosubIf($["${REC_POLICY_MODE}"=“always”]?record,1(${EXTEN},${REC_POLICY_MODE},${FROMEXTEN})) [pbx_config]
2. Return() [pbx_config]
‘s’ => 1. GotoIf($["${BLINDTRANSFER}" = “”]?check) [pbx_config]
2. ResetCDR() [pbx_config]
3. GotoIf($["${REC_STATUS}" != “RECORDING”]?check) [pbx_config]
4. Set(AUDIOHOOK_INHERIT(MixMonitor)=yes) [pbx_config]
5. MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MIXMON_FORMAT},a,${MIXMON_POST}) [pbx_config]
[check] 6. Set(__MON_FMT=${IF($["${MIXMON_FORMAT}"=“wav49”]?WAV:${MIXMON_FORMAT})}) [pbx_config]
7. GotoIf($["${REC_STATUS}"!=“RECORDING”]?next) [pbx_config]
8. Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT}) [pbx_config]
9. Return() [pbx_config]
[next] 10. ExecIf($[!${LEN(${ARG1})}]?Return()) [pbx_config]
11. GotoIf($["${REC_STATUS}"!=""]?${ARG1},1) [pbx_config]
12. Set(__REC_STATUS=INITIALIZED) [pbx_config]
13. ExecIf($["${REC_POLICY_MODE}"="" & “${ARG3}”!=""]?Set(__REC_POLICY_MODE=${ARG3})) [pbx_config]
14. Set(NOW=${EPOCH}) [pbx_config]
15. Set(__DAY=${STRFTIME(${NOW},%d)}) [pbx_config]
16. Set(__MONTH=${STRFTIME(${NOW},%m)}) [pbx_config]
17. Set(__YEAR=${STRFTIME(${NOW},%Y)}) [pbx_config]
18. Set(__TIMESTR=${YEAR}${MONTH}${DAY}-${STRFTIME(${NOW},%H%M%S)}) [pbx_config]
19. Set(__FROMEXTEN=${IF($[${LEN(${AMPUSER})}]?${AMPUSER}:${IF($[${LEN(${REALCALLERIDNUM})}]?${REALCALLERIDNUM}:unknown)})}) [pbx_config]
20. Set(__CALLFILENAME=${ARG1}-${ARG2}-${FROMEXTEN}-${TIMESTR}-${UNIQUEID}) [pbx_config]
21. Goto(${ARG1},1) [pbx_config]
Include => ‘sub-record-check-custom’ [pbx_config]

[ Context ‘sub-record-cancel’ created by ‘pbx_config’ ]
‘s’ => 1. ExecIf($["${REC_STATUS}"!=“RECORDING”]?Return()) [pbx_config]
2. StopMixMonitor() [pbx_config]
3. Set(__REC_STATUS=) [pbx_config]
4. Set(MON_BASE=${IF($[${LEN(${MIXMON_DIR})}]?${MIXMON_DIR}:${ASTSPOOLDIR}/monitor/)}${YEAR}/${MONTH}/${DAY}/) [pbx_config]
5. Set(__MON_FMT=${IF($[${LEN(${MIXMON_FORMAT})}]?${IF($["${MIXMON_FORMAT}"=“wav49”]?WAV:${MIXMON_FORMAT})}:wav)}) [pbx_config]
6. ExecIf($[${LEN(${CALLFILENAME})} & ${STAT(f,${MON_BASE}${CALLFILENAME}.${MON_FMT})}]?System(rm -f ${MON_BASE}${CALLFILENAME}.${MON_FMT})) [pbx_config]
7. Set(__CALLFILENAME=) [pbx_config]
8. Set(CDR(recordingfile)=) [pbx_config]
9. Return() [pbx_config]
Include => ‘sub-record-cancel-custom’ [pbx_config]

[ Context ‘from-trunk-sip-DAKS-61-out’ created by ‘pbx_config’ ]
’_.’ => 1. Set(GROUP()=OUT_3) [pbx_config]
2. Goto(from-trunk,${EXTEN},1) [pbx_config]
Include => ‘from-trunk-sip-DAKS-61-out-custom’ [pbx_config]

[ Context ‘from-trunk-sip-Daks-69-out’ created by ‘pbx_config’ ]
’_.’ => 1. Set(GROUP()=OUT_2) [pbx_config]
2. Goto(from-trunk,${EXTEN},1) [pbx_config]
Include => ‘from-trunk-sip-Daks-69-out-custom’ [pbx_config]

[ Context ‘ext-trunk’ created by ‘pbx_config’ ]
‘1’ => 1. Set(TDIAL_STRING=ZAP/g0) [pbx_config]
2. Set(DIAL_TRUNK=1) [pbx_config]
3. Goto(ext-trunk,tdial,1) [pbx_config]
‘2’ => 1. Set(TDIAL_STRING=SIP/Daks-69-out) [pbx_config]
2. Set(DIAL_TRUNK=2) [pbx_config]
3. Goto(ext-trunk,tdial,1) [pbx_config]
‘3’ => 1. Set(TDIAL_STRING=SIP/DAKS-61-out) [pbx_config]
2. Set(DIAL_TRUNK=3) [pbx_config]
3. Goto(ext-trunk,tdial,1) [pbx_config]
‘tdial’ => 1. Set(OUTBOUND_GROUP=OUT_${DIAL_TRUNK}) [pbx_config]
2. GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}" = “”]?nomax) [pbx_config]
3. GotoIf($[${GROUP_COUNT(OUT_${DIAL_TRUNK})} >= ${OUTMAXCHANS_${DIAL_TRUNK}}]?hangit) [pbx_config]
[nomax] 4. ExecIf($["${CALLINGPRES_SV}" != “”]?Set(CALLERPRES()=${CALLINGPRES_SV})) [pbx_config]
5. Set(DIAL_NUMBER=${FROM_DID}) [pbx_config]
6. GosubIf($["${PREFIX_TRUNK_${DIAL_TRUNK}}" != “”]?sub-flp-${DIAL_TRUNK},s,1()) [pbx_config]
7. Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER}) [pbx_config]
8. Dial(${TDIAL_STRING}/${OUTNUM},300,${DIAL_TRUNK_OPTIONS}) [pbx_config]
9. Set(CALLERID(number)=${CALLERID(number):0:40}) [pbx_config]
10. Set(CALLERID(name)=${CALLERID(name):0:40}) [pbx_config]
[hangit] 11. Hangup() [pbx_config]
Include => ‘ext-trunk-custom’ [pbx_config]

[ Context ‘from-did-direct-ivr’ created by ‘pbx_config’ ]
‘201’ => 1. Macro(blkvm-clr,) [pbx_config]
2. Set(__NODEST=) [pbx_config]
3. Goto(from-did-direct,201,1) [pbx_config]
‘204’ => 1. Macro(blkvm-clr,) [pbx_config]
2. Set(__NODEST=) [pbx_config]
3. Goto(from-did-direct,204,1) [pbx_config]
‘207’ => 1. Macro(blkvm-clr,) [pbx_config]
2. Set(__NODEST=) [pbx_config]
3. Goto(from-did-direct,207,1) [pbx_config]
Include => ‘from-did-direct-ivr-custom’ [pbx_config]

[ Context ‘ext-local’ created by ‘pbx_config’ ]
‘201’ => hint: SIP/201 [pbx_config]
1. Set(__RINGTIMER=${IF($[${DB(AMPUSER/201/ringtimer)} > 0]?${DB(AMPUSER/201/ringtimer)}:${RINGTIMER_DEFAULT})}) [pbx_config]
2. Macro(exten-vm,novm,201,0,0,0) [pbx_config]
[dest] 3. Set(__PICKUPMARK=) [pbx_config]
4. Goto(${IVR_CONTEXT},return,1) [pbx_config]
5. Goto(from-internal,201,1) [pbx_config]
‘204’ => hint: SIP/204 [pbx_config]
1. Set(__RINGTIMER=${IF($[${DB(AMPUSER/204/ringtimer)} > 0]?${DB(AMPUSER/204/ringtimer)}:${RINGTIMER_DEFAULT})}) [pbx_config]
2. Macro(exten-vm,novm,204,0,0,0) [pbx_config]
[dest] 3. Set(__PICKUPMARK=) [pbx_config]
4. Goto(${IVR_CONTEXT},return,1) [pbx_config]
5. Goto(from-internal,204,1) [pbx_config]
‘207’ => hint: SIP/207 [pbx_config]
1. Set(__RINGTIMER=${IF($[${DB(AMPUSER/207/ringtimer)} > 0]?${DB(AMPUSER/207/ringtimer)}:${RINGTIMER_DEFAULT})}) [pbx_config]
2. Macro(exten-vm,novm,207,0,0,0) [pbx_config]
[dest] 3. Set(__PICKUPMARK=) [pbx_config]
4. Goto(${IVR_CONTEXT},return,1) [pbx_config]
5. Goto(from-internal,207,1) [pbx_config]
‘h’ => 1. Macro(hangupcall,) [pbx_config]
‘vmret’ => 1. GotoIf($["${IVR_RETVM}" = “RETURN” & “${IVR_CONTEXT}” != “”]?playret) [pbx_config]
2. Hangup() [pbx_config]
[playret] 3. Playback(exited-vm-will-be-transfered&silence/1) [pbx_config]
4. Goto(${IVR_CONTEXT},return,1) [pbx_config]
Include => ‘ext-local-custom’ [pbx_config]

[ Context ‘ext-did-catchall’ created by ‘pbx_config’ ]
‘h’ => 1. Hangup() [pbx_config]
‘s’ => 1. Noop(No DID or CID Match) [pbx_config]
[a2] 2. Answer() [pbx_config]
3. Wait(2) [pbx_config]
4. Playback(ss-noservice) [pbx_config]
5. SayAlpha(${FROM_DID}) [pbx_config]
6. Hangup() [pbx_config]
’_.’ => 1. Set(__FROM_DID=${EXTEN}) [pbx_config]
2. Noop(Received an unknown call with DID set to ${EXTEN}) [pbx_config]
3. Goto(s,a2) [pbx_config]
Include => ‘ext-did-catchall-custom’ [pbx_config]

[ Context ‘ext-did’ created by ‘pbx_config’ ]
‘foo’ => 1. Noop(bar) [pbx_config]
Include => ‘ext-did-custom’ [pbx_config]
Include => ‘ext-did-0001’ [pbx_config]
Include => ‘ext-did-0002’ [pbx_config]

[ Context ‘ext-test’ created by ‘pbx_config’ ]
‘7777’ => 1. Goto(from-pstn,${EXTEN},1) [pbx_config]
‘h’ => 1. Macro(hangupcall,) [pbx_config]
Include => ‘ext-test-custom’ [pbx_config]

[ Context ‘app-chanspy’ created by ‘pbx_config’ ]
‘555’ => 1. Macro(user-callerid,) [pbx_config]
2. Answer() [pbx_config]
3. Wait(1) [pbx_config]
4. ChanSpy() [pbx_config]
5. Hangup() [pbx_config]
Include => ‘app-chanspy-custom’ [pbx_config]

[ Context ‘app-zapbarge’ created by ‘pbx_config’ ]
‘888’ => 1. Macro(user-callerid,) [pbx_config]
2. Set(GROUP()=${CALLERID(number)}) [pbx_config]
3. Answer() [pbx_config]
4. Wait(1) [pbx_config]
5. DAHDIBarge() [pbx_config]
6. Hangup() [pbx_config]
Include => ‘app-zapbarge-custom’ [pbx_config]

[ Context ‘app-pickup’ created by ‘pbx_config’ ]
’_**.’ => 1. Macro(user-callerid,) [pbx_config]
2. Set(PICKUP_EXTEN=${AMPUSER}) [pbx_config]
3. Pickup(${EXTEN:2}&${EXTEN:2}@PICKUPMARK) [pbx_config]
4. Hangup() [pbx_config]
Include => ‘app-pickup-custom’ [pbx_config]

[ Context ‘findmefollow-ringallv2’ created by ‘pbx_config’ ]
’_FMGL-.’ => 1. NoCDR() [pbx_config]
2. Set(ENDLOOP=$[${EPOCH} + ${FMPRERING} + 2]) [pbx_config]
[start] 3. GotoIf($["${SHARED(FM_DND,${FMUNIQUE})}" = “DND”]?dodnd) [pbx_config]
4. Wait(1) [pbx_config]
5. GotoIf($[${EPOCH} < ${ENDLOOP}]?start) [pbx_config]
6. Set(SHARED(FM_DND,${FMUNIQUE})=) [pbx_config]
[dodial] 7. Macro(dial,${FMGRPTIME},${DIAL_OPTIONS},${EXTEN:5}) [pbx_config]
8. Hangup() [pbx_config]
[dodnd] 19. Set(SHARED(FM_DND,${FMUNIQUE})=) [pbx_config]
20. GotoIf($["${FMPRIME}" = “FALSE”]?dodial) [pbx_config]
21. Hangup() [pbx_config]
’_FMPR-.’ => 1. NoCDR() [pbx_config]
2. Set(RingGroupMethod=) [pbx_config]
3. Set(USE_CONFIRMATION=) [pbx_config]
4. Set(RINGGROUP_INDEX=) [pbx_config]
5. Macro(simple-dial,${EXTEN:5},${FMREALPRERING}) [pbx_config]
6. ExecIf($["${DIALSTATUS}" = “BUSY”]?Set(SHARED(FM_DND,${FMUNIQUE})=DND)) [pbx_config]
7. Hangup() [pbx_config]
Include => ‘findmefollow-ringallv2-custom’ [pbx_config]

[ Context ‘ext-local-confirm’ created by ‘pbx_config’ ]
’_LC-.’ => 1. ExecIf($["${ALERT_INFO}"!=""]?SIPAddHeader(Alert-Info: ${ALERT_INFO})) [pbx_config]
2. Dial(${DB(DEVICE/${EXTEN:3}/dial)},${RT},${DIAL_OPTIONS}M(auto-confirm^${RG_IDX})) [pbx_config]
Include => ‘ext-local-confirm-custom’ [pbx_config]

[ Context ‘app-userlogonoff’ created by ‘pbx_config’ ]
’*11’ => 1. Macro(user-logon,) [pbx_config]
[hook_on_1] 2. Hangup() [pbx_config]
’*12’ => 1. Macro(user-logoff,) [pbx_config]
[hook_off] 2. Hangup() [pbx_config]
’_*11.’ => 1. Macro(user-logon,${EXTEN:3},) [pbx_config]
[hook_on_2] 2. Hangup() [pbx_config]
Include => ‘app-userlogonoff-custom’ [pbx_config]

[ Context ‘sub-hr12format’ created by ‘pbx_config’ ]
‘de’ => 1. Playback(at-tone-time-exactly) [pbx_config]
2. SayUnixTime(${FutureTime},IMSp) [pbx_config]
3. Return() [pbx_config]
‘en’ => 1. Playback(at-tone-time-exactly) [pbx_config]
2. SayUnixTime(${FutureTime},IM ‘and’ S ‘seconds’ p) [pbx_config]
3. Return() [pbx_config]
‘s’ => 1. GotoIf($[${DIALPLAN_EXISTS(sub-hr12format,${CHANNEL(language)},1)}]?${CHANNEL(language)},1:en,1) [pbx_config]
Include => ‘sub-hr12format-custom’ [pbx_config]

[ Context ‘sub-hr24format’ created by ‘pbx_config’ ]
‘de’ => 1. Playback(at-tone-time-exactly) [pbx_config]
2. SayUnixTime(${FutureTime},kMS) [pbx_config]
3. Return() [pbx_config]
‘en’ => 1. Playback(at-tone-time-exactly) [pbx_config]
2. SayUnixTime(${FutureTime},kM ‘and’ S ‘seconds’) [pbx_config]
3. Return() [pbx_config]
‘s’ => 1. GotoIf($[${DIALPLAN_EXISTS(sub-hr24format,${CHANNEL(language)},1)}]?${CHANNEL(language)},1:en,1) [pbx_config]
Include => ‘sub-hr24format-custom’ [pbx_config]

[ Context ‘app-speakingclock’ created by ‘pbx_config’ ]
’*60’ => 1. Answer() [pbx_config]
2. Wait(1) [pbx_config]
3. Set(NumLoops=0) [pbx_config]
[start] 4. Set(FutureTime=$[${EPOCH} + 11]) [pbx_config]
5. GosubIf($["${TIMEFORMAT}"=“kM”]?sub-hr24format,s,1():sub-hr12format,s,1()) [pbx_config]
[waitloop] 6. Set(TimeLeft=$[${FutureTime} - ${EPOCH}]) [pbx_config]
7. GotoIf($[${TimeLeft} < 1]?playbeep) [pbx_config]
8. Wait(1) [pbx_config]
9. Goto(waitloop) [pbx_config]
[playbeep] 10. Playback(beep) [pbx_config]
11. Wait(5) [pbx_config]
12. Set(NumLoops=$[${NumLoops} + 1]) [pbx_config]
13. GotoIf($[${NumLoops} < 5]?start) [pbx_config]
14. Playback(goodbye) [pbx_config]
15. Hangup() [pbx_config]
Include => ‘app-speakingclock-custom’ [pbx_config]

[ Context ‘app-speakextennum’ created by ‘pbx_config’ ]
’*65’ => 1. Answer() [pbx_config]
2. Wait(1) [pbx_config]
3. Macro(user-callerid,) [pbx_config]
4. Playback(your) [pbx_config]
5. Playback(extension) [pbx_config]
6. Playback(number) [pbx_config]
7. Playback(is) [pbx_config]
8. SayDigits(${AMPUSER}) [pbx_config]
9. Wait(2) [pbx_config]
10. Hangup() [pbx_config]
Include => ‘app-speakextennum-custom’ [pbx_config]

[ Context ‘app-echo-test’ created by ‘pbx_config’ ]
’*43’ => 1. Answer() [pbx_config]
2. Wait(1) [pbx_config]
3. Playback(demo-echotest) [pbx_config]
4. Echo() [pbx_config]
5. Playback(demo-echodone) [pbx_config]
6. Hangup() [pbx_config]
Include => ‘app-echo-test-custom’ [pbx_config]

[ Context ‘app-calltrace-perform’ created by ‘pbx_config’ ]
‘1’ => 1. Goto(from-internal,${lastcaller},1) [pbx_config]
‘i’ => 1. Playback(vm-goodbye) [pbx_config]
2. Macro(hangupcall,) [pbx_config]
‘s’ => 1. Answer() [pbx_config]
2. Wait(1) [pbx_config]
3. Macro(user-callerid,) [pbx_config]
4. Playback(info-about-last-call&telephone-number) [pbx_config]
5. Set(lastcaller=${DB(CALLTRACE/${AMPUSER})}) [pbx_config]
6. GotoIf($[ $[ “${lastcaller}” = “” ] | $[ “${lastcaller}” = “unknown” ] ]?noinfo) [pbx_config]
7. SayDigits(${lastcaller}) [pbx_config]
8. Set(TIMEOUT(digit)=3) [pbx_config]
9. Set(TIMEOUT(response)=7) [pbx_config]
10. Background(to-call-this-number&press-1) [pbx_config]
11. Goto(fin) [pbx_config]
[noinfo] 12. Playback(from-unknown-caller) [pbx_config]
13. Macro(hangupcall,) [pbx_config]
[fin] 14. Noop(Waiting for input) [pbx_config]
15. WaitExten(60,) [pbx_config]
16. Playback(sorry-youre-having-problems&goodbye) [pbx_config]
‘t’ => 1. Playback(vm-goodbye) [pbx_config]
2. Macro(hangupcall,) [pbx_config]
Include => ‘app-calltrace-perform-custom’ [pbx_config]

[ Context ‘app-calltrace’ created by ‘pbx_config’ ]
’*69’ => 1. Goto(app-calltrace-perform,s,1) [pbx_config]
Include => ‘app-calltrace-custom’ [pbx_config]

[ Context ‘macro-systemrecording’ created by ‘pbx_config’ ]
’ => 1. Goto(dorecord,1) [pbx_config]
‘1’ => 1. Goto(docheck,dc_start) [pbx_config]
‘confmenu’ => 1. Background(to-listen-to-it&press-1&to-rerecord-it&press-star&astcc-followed-by-pound,m,${CHANNEL(language)},macro-systemrecording) [pbx_config]
2. Read(RECRESULT,1,4) [pbx_config]
3. GotoIf($[“x${RECRESULT}”="x
"]?dorecord,1) [pbx_config]
4. GotoIf($[“x${RECRESULT}”=“x1”]?docheck,2) [pbx_config]
5. Goto(1) [pbx_config]
‘docheck’ => 1. Playback(beep) [pbx_config]
[dc_start] 2. Background(${RECFILE},m,${CHANNEL(language)},macro-systemrecording) [pbx_config]
3. Wait(1) [pbx_config]
4. Goto(confmenu,1) [pbx_config]
‘dorecord’ => 1. GotoIf($["${ARG2}" = “”]?skipremove) [pbx_config]
2. System(rm ${ASTVARLIBDIR}/sounds/${RECFILE}.*) [pbx_config]
[skipremove] 3. Record(${RECFILE}.wav,k) [pbx_config]
4. Wait(1) [pbx_config]
5. Goto(confmenu,1) [pbx_config]
‘h’ => 1. Hangup() [pbx_config]
‘i’ => 1. Playback(pm-invalid-option) [pbx_config]
2. Goto(confmenu,1) [pbx_config]
‘s’ => 1. Set(RECFILE=${IF($["${ARG2}" = “”]?/var/spool/asterisk/tmp/${AMPUSER}-ivrrecording:${ARG2})}) [pbx_config]
2. ExecIf($["${ARG3}" != “”]?Authenticate(${ARG3})) [pbx_config]
3. Goto(${ARG1},1) [pbx_config]
‘t’ => 1. Playback(goodbye) [pbx_config]
2. Hangup() [pbx_config]
Include => ‘macro-systemrecording-custom’ [pbx_config]

[ Context ‘app-recordings’ created by ‘pbx_config’ ]
’*77’ => 1. Macro(user-callerid,) [pbx_config]
2. Wait(2) [pbx_config]
3. Macro(systemrecording,dorecord) [pbx_config]
’*99’ => 1. Macro(user-callerid,) [pbx_config]
2. Wait(2) [pbx_config]
3. Macro(systemrecording,docheck) [pbx_config]
Include => ‘app-recordings-custom’ [pbx_config]

[ Context ‘app-vmmain’ created by ‘pbx_config’ ]
’*97’ => 1. Answer() [pbx_config]
2. Wait(1) [pbx_config]
3. Macro(user-callerid,) [pbx_config]
4. Macro(get-vmcontext,${AMPUSER}) [pbx_config]
[check] 5. Set(VMBOXEXISTSSTATUS=${IF(${MAILBOX_EXISTS(${AMPUSER}@${VMCONTEXT})}?SUCCESS:FAILED)}) [pbx_config]
6. GotoIf($["${VMBOXEXISTSSTATUS}" = “SUCCESS”]?mbexist) [pbx_config]
7. VoiceMailMain() [pbx_config]
8. GotoIf($["${IVR_RETVM}" = “RETURN” & “${IVR_CONTEXT}” != “”]?playret) [pbx_config]
9. Macro(hangupcall,) [pbx_config]
[mbexist] 106. VoiceMailMain(${AMPUSER}@${VMCONTEXT}) [pbx_config]
107. GotoIf($["${IVR_RETVM}" = “RETURN” & “${IVR_CONTEXT}” != “”]?playret) [pbx_config]
108. Macro(hangupcall,) [pbx_config]
[playret] 109. Playback(beep&you-will-be-transfered-menu&silence/1) [pbx_config]
110. Goto(${IVR_CONTEXT},return,1) [pbx_config]
Include => ‘app-vmmain-custom’ [pbx_config]

[ Context ‘app-dialvm’ created by ‘pbx_config’ ]
’*98’ => 1. Answer() [pbx_config]
[start] 2. Wait(1) [pbx_config]
3. Noop(app-dialvm: Asking for mailbox) [pbx_config]
4. Read(MAILBOX,vm-login,3,2) [pbx_config]
[check] 5. Noop(app-dialvm: Got Mailbox ${MAILBOX}) [pbx_config]
6. Macro(get-vmcontext,${MAILBOX}) [pbx_config]
7. Set(VMBOXEXISTSSTATUS=${IF(${MAILBOX_EXISTS(${MAILBOX}@${VMCONTEXT})}?SUCCESS:FAILED)}) [pbx_config]
8. GotoIf($["${VMBOXEXISTSSTATUS}" = “SUCCESS”]?good:bad) [pbx_config]
9. Macro(hangupcall,) [pbx_config]
[good] 10. Noop(app-dialvm: Good mailbox ${MAILBOX}@${VMCONTEXT}) [pbx_config]
11. VoiceMailMain(${MAILBOX}@${VMCONTEXT}) [pbx_config]
12. GotoIf($["${IVR_RETVM}" = “RETURN” & “${IVR_CONTEXT}” != “”]?playret) [pbx_config]
13. Macro(hangupcall,) [pbx_config]
[bad] 14. Noop(app-dialvm: BAD mailbox ${MAILBOX}@${VMCONTEXT}) [pbx_config]
15. Wait(1) [pbx_config]
16. Noop(app-dialvm: Asking for password so people can’t probe for existence of a mailbox) [pbx_config]
17. Read(FAKEPW,vm-password,3,2) [pbx_config]
18. Noop(app-dialvm: Asking for mailbox again) [pbx_config]
19. Read(MAILBOX,vm-incorrect-mailbox,3,2) [pbx_config]
20. Goto(check) [pbx_config]
21. Macro(hangupcall,) [pbx_config]
[playret] 22. Playback(beep&you-will-be-transfered-menu&silence/1) [pbx_config]
23. Goto(${IVR_CONTEXT},return,1) [pbx_config]
’_*98.’ => 1. Answer() [pbx_config]
2. Wait(1) [pbx_config]
3. Macro(get-vmcontext,${EXTEN:3}) [pbx_config]
4. VoiceMailMain(${EXTEN:3}@${VMCONTEXT}) [pbx_config]
5. GotoIf($["${IVR_RETVM}" = “RETURN” & “${IVR_CONTEXT}” != “”]?${IVR_CONTEXT},return,1) [pbx_config]
6. Macro(hangupcall,) [pbx_config]
Include => ‘app-dialvm-custom’ [pbx_config]

[ Context ‘ext-featurecodes’ created by ‘pbx_config’ ]
’*43’ => 1. Goto(from-internal,*43,1) [pbx_config]
’*60’ => 1. Goto(from-internal,*60,1) [pbx_config]
’*98’ => 1. Goto(from-internal,*98,1) [pbx_config]
‘555’ => 1. Goto(from-internal,555,1) [pbx_config]
‘666’ => 1. Goto(from-internal,666,1) [pbx_config]
‘7777’ => 1. Goto(from-internal,7777,1) [pbx_config]
‘888’ => 1. Goto(from-internal,888,1) [pbx_config]
Include => ‘ext-featurecodes-custom’ [pbx_config]

-= 277 extensions (1241 priorities) in 89 contexts. =-

I’m not sure if you wanted to pass the 67 along, or have it stripped off as a Prefix… but in any case you need to tell FreePBX that your dialplan must match any character/number of characters that follow your 67 so you need to use the . metacharacter.

For example, to strip the prefix and pass the rest along you’d need
Prefix Pattern
67 / .

If you wanted to keep the 67 and pass it along, then just use it as the start of the pattern instead of the Prefix
Pattern
67.

Thanks,
-Rob

Well that makes sense…maybe I need to wear my glasses. I looked at the original one and of course there is the ‘.’ I’m not a phone guy, but I knew it had to be simple.
thanks for the help. you get a gold star!!