Need help in creating dialplan for IVR

Hello, kindly requesting to advise!
Please look at my raw dialplan, it is not doing next step after exten=>8,n,Background(${home}/ivr_tabrik5).
it hangs up.

i want: after the message to enter the number followed by pound key, i could enter, asterisk seize what i entered, then send to this number the congratulation(file i uploaded).

here is my dialplan in the extensions_custom.conf file:

[afterpressing8_tabrik]
exten=>8,1,Set(home="/var/lib/asterisk/sounds/custom")
exten=>8,n,Answer()
exten=>8,n,Wait(1)
exten=>8,n,Background(${home}/ivr_tabrik5) // here, the message "please enter the number you want to sent the congratulation followed by pound key "
exten=>8,n,Waitexten(10)

exten=>_XXXXXXXXXXXX,read_digits,Read(digits, ,12) // here, Asterisk should seize the digits
exten=>_XXXXXXXXXXXX,n,Wait(1)
exten=>_XXXXXXXXXXXX,n,Set(CHANNEL(language)=ru)
exten=>_XXXXXXXXXXXX,n,Background(${home}/ivr_tabrik6) // here, the message: "the number to send is:"
exten=>_XXXXXXXXXXXX,n,Saydigits(${digits})// here, Asterisk should tell what tel number is for sending the congratulation
exten=>_XXXXXXXXXXXX,n,Background(${home}/ivr_tabrik7)here, the message"press one to send, press 2 to go to main menu"
exten=>_XXXXXXXXXXXX,n,Waitexten(3)

exten=>_X!,one_two,Read(digit, ,1) // here, Asterisk should seize the pressed key(1 or 2)
exten=>_X!,n,Gotoif($[${digit=1}?dial_to_out:ivr_menu]) // Asterisk should go to the context with Dial() application or to ivr_menu context

[dial_to_out]
exten=>1,1,Dial(SIP/idon`t know what should be here)

It would be useful to know what Asterisk and FreePBX version you are using.

Can you post a call trace?

hello Alan, the version of Asterisk is 1/8, FreePBX version is 2.10.1.9

and here is the trace of call:

Connected to Asterisk 1.8.22.0 currently running on pbx (pid = 2206)
Verbosity is at least 3
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Executing [[email protected]:1] Set("SIP/sip-in-0000000f", "GROUP()=OUT_1") in new stack
    -- Executing [[email protected]:2] Goto("SIP/sip-in-0000000f", "from-trunk,1501164,1") in new stack
    -- Goto (from-trunk,1501164,1)
    -- Executing [[email protected]:1] NoOp("SIP/sip-in-0000000f", "Catch-All DID Match - Found 1501164 - You probably want a DID for this.") in new stack
    -- Executing [[email protected]:2] Goto("SIP/sip-in-0000000f", "ext-did,s,1") in new stack
    -- Goto (ext-did,s,1)
    -- Executing [[email protected]:1] ExecIf("SIP/sip-in-0000000f", "1?Set(__FROM_DID=s)") in new stack
    -- Executing [[email protected]:2] Gosub("SIP/sip-in-0000000f", "app-blacklist-check,s,1()") in new stack
    -- Executing [[email protected]:1] GotoIf("SIP/sip-in-0000000f", "0?blacklisted") in new stack
    -- Executing [[email protected]:2] Set("SIP/sip-in-0000000f", "CALLED_BLACKLIST=1") in new stack
    -- Executing [[email protected]:3] Return("SIP/sip-in-0000000f", "") in new stack
    -- Executing [[email protected]:3] Set("SIP/sip-in-0000000f", "CDR(did)=s") in new stack
    -- Executing [[email protected]:4] ExecIf("SIP/sip-in-0000000f", "1 ?Set(CALLERID(name)=711409727)") in new stack
    -- Executing [[email protected]:5] Set("SIP/sip-in-0000000f", "__CALLINGPRES_SV=allowed_not_screened") in new stack
    -- Executing [[email protected]:6] Set("SIP/sip-in-0000000f", "CALLERPRES()=allowed_not_screened") in new stack
    -- Executing [[email protected]:7] Goto("SIP/sip-in-0000000f", "ivr-12,s,1") in new stack
    -- Goto (ivr-12,s,1)
    -- Executing [[email protected]:1] Set("SIP/sip-in-0000000f", "INVALID_LOOPCOUNT=0") in new stack
    -- Executing [[email protected]:2] Set("SIP/sip-in-0000000f", "_IVR_CONTEXT_ivr-12=") in new stack
    -- Executing [[email protected]:3] Set("SIP/sip-in-0000000f", "_IVR_CONTEXT=ivr-12") in new stack
    -- Executing [[email protected]:4] Set("SIP/sip-in-0000000f", "__IVR_RETVM=") in new stack
    -- Executing [[email protected]:5] GotoIf("SIP/sip-in-0000000f", "0?skip") in new stack
    -- Executing [[email protected]:6] Answer("SIP/sip-in-0000000f", "") in new stack
    -- Executing [[email protected]:7] Wait("SIP/sip-in-0000000f", "1") in new stack
    -- Executing [[email protected]:8] Set("SIP/sip-in-0000000f", "IVR_MSG=custom/ivr_intro") in new stack
    -- Executing [[email protected]:9] Set("SIP/sip-in-0000000f", "TIMEOUT(digit)=3") in new stack
    -- Digit timeout set to 3.000
    -- Executing [[email protected]:10] ExecIf("SIP/sip-in-0000000f", "1?Background(custom/ivr_intro)") in new stack
    -- <SIP/sip-in-0000000f> Playing 'custom/ivr_intro.slin' (language 'en')
    -- Executing [[email protected]:11] WaitExten("SIP/sip-in-0000000f", "2,") in new stack
    -- Timeout on SIP/sip-in-0000000f, going to 't'
    -- Executing [[email protected]:1] Playback("SIP/sip-in-0000000f", "custom/ivr_menu") in new stack
    -- <SIP/sip-in-0000000f> Playing 'custom/ivr_menu.slin' (language 'en')
    -- Executing [[email protected]:2] Goto("SIP/sip-in-0000000f", "ivr-16,s,1") in new stack
    -- Goto (ivr-16,s,1)
    -- Executing [[email protected]:1] Set("SIP/sip-in-0000000f", "TIMEOUT_LOOPCOUNT=0") in new stack
    -- Executing [[email protected]:2] Set("SIP/sip-in-0000000f", "INVALID_LOOPCOUNT=0") in new stack
    -- Executing [[email protected]:3] Set("SIP/sip-in-0000000f", "_IVR_CONTEXT_ivr-16=ivr-12") in new stack
    -- Executing [[email protected]:4] Set("SIP/sip-in-0000000f", "_IVR_CONTEXT=ivr-16") in new stack
    -- Executing [[email protected]:5] Set("SIP/sip-in-0000000f", "__IVR_RETVM=") in new stack
    -- Executing [[email protected]:6] GotoIf("SIP/sip-in-0000000f", "1?skip") in new stack
    -- Goto (ivr-16,s,9)
    -- Executing [[email protected]:9] Set("SIP/sip-in-0000000f", "IVR_MSG=custom/ivr_menu") in new stack
    -- Executing [[email protected]:10] Set("SIP/sip-in-0000000f", "TIMEOUT(digit)=3") in new stack
    -- Digit timeout set to 3.000
    -- Executing [[email protected]:11] ExecIf("SIP/sip-in-0000000f", "1?Background(custom/ivr_menu)") in new stack
    -- <SIP/sip-in-0000000f> Playing 'custom/ivr_menu.slin' (language 'en')
    -- Executing [[email protected]:1] Goto("SIP/sip-in-0000000f", "ivr-13,s,1") in new stack
    -- Goto (ivr-13,s,1)
    -- Executing [[email protected]:1] Set("SIP/sip-in-0000000f", "TIMEOUT_LOOPCOUNT=0") in new stack
    -- Executing [[email protected]:2] Set("SIP/sip-in-0000000f", "INVALID_LOOPCOUNT=0") in new stack
    -- Executing [[email protected]:3] Set("SIP/sip-in-0000000f", "_IVR_CONTEXT_ivr-13=ivr-16") in new stack
    -- Executing [[email protected]:4] Set("SIP/sip-in-0000000f", "_IVR_CONTEXT=ivr-13") in new stack
    -- Executing [[email protected]:5] Set("SIP/sip-in-0000000f", "__IVR_RETVM=") in new stack
    -- Executing [[email protected]:6] GotoIf("SIP/sip-in-0000000f", "1?skip") in new stack
    -- Goto (ivr-13,s,9)
    -- Executing [[email protected]:9] Set("SIP/sip-in-0000000f", "IVR_MSG=custom/ivr_tabrik1") in new stack
    -- Executing [[email protected]:10] Set("SIP/sip-in-0000000f", "TIMEOUT(digit)=3") in new stack
    -- Digit timeout set to 3.000
    -- Executing [[email protected]:11] ExecIf("SIP/sip-in-0000000f", "1?Background(custom/ivr_tabrik1)") in new stack
    -- <SIP/sip-in-0000000f> Playing 'custom/ivr_tabrik1.slin' (language 'en')
    -- Registered IAX2 '111' (AUTHENTICATED) at 37.110.210.225:35531
    -- Executing [[email protected]:12] WaitExten("SIP/sip-in-0000000f", "1,") in new stack
    -- Timeout on SIP/sip-in-0000000f, going to 't'
    -- Executing [[email protected]:1] Set("SIP/sip-in-0000000f", "TIMEOUT_LOOPCOUNT=1") in new stack
    -- Executing [[email protected]:2] GotoIf("SIP/sip-in-0000000f", "0?final") in new stack
    -- Executing [[email protected]:3] Set("SIP/sip-in-0000000f", "IVR_MSG=custom/ivr_tabrik2") in new stack
    -- Executing [[email protected]:4] Goto("SIP/sip-in-0000000f", "s,start") in new stack
    -- Goto (ivr-13,s,10)
    -- Executing [[email protected]:10] Set("SIP/sip-in-0000000f", "TIMEOUT(digit)=3") in new stack
    -- Digit timeout set to 3.000
    -- Executing [[email protected]:11] ExecIf("SIP/sip-in-0000000f", "1?Background(custom/ivr_tabrik2)") in new stack
    -- <SIP/sip-in-0000000f> Playing 'custom/ivr_tabrik2.slin' (language 'en')
    -- Executing [[email protected]:12] WaitExten("SIP/sip-in-0000000f", "1,") in new stack
  == CDR updated on SIP/sip-in-0000000f
    -- Executing [[email protected]:1] Goto("SIP/sip-in-0000000f", "ivr-17,s,1") in new stack
    -- Goto (ivr-17,s,1)
    -- Executing [[email protected]:1] Set("SIP/sip-in-0000000f", "TIMEOUT_LOOPCOUNT=0") in new stack
    -- Executing [[email protected]:2] Set("SIP/sip-in-0000000f", "INVALID_LOOPCOUNT=0") in new stack
    -- Executing [[email protected]vr-17:3] Set("SIP/sip-in-0000000f", "_IVR_CONTEXT_ivr-17=ivr-13") in new stack
    -- Executing [[email protected]:4] Set("SIP/sip-in-0000000f", "_IVR_CONTEXT=ivr-17") in new stack
    -- Executing [[email protected]:5] Set("SIP/sip-in-0000000f", "__IVR_RETVM=") in new stack
    -- Executing [[email protected]:6] GotoIf("SIP/sip-in-0000000f", "1?skip") in new stack
    -- Goto (ivr-17,s,9)
    -- Executing [[email protected]:9] Set("SIP/sip-in-0000000f", "IVR_MSG=custom/pozdrav01") in new stack
    -- Executing [[email protected]:10] Set("SIP/sip-in-0000000f", "TIMEOUT(digit)=3") in new stack
    -- Digit timeout set to 3.000
    -- Executing [[email protected]:11] ExecIf("SIP/sip-in-0000000f", "1?Background(custom/pozdrav01)") in new stack
    -- <SIP/sip-in-0000000f> Playing 'custom/pozdrav01.slin' (language 'en')
    -- Registered IAX2 '111' (AUTHENTICATED) at 217.12.84.58:4569
    -- Registered IAX2 '111' (AUTHENTICATED) at 37.110.210.225:35531
    -- Executing [[email protected]:12] WaitExten("SIP/sip-in-0000000f", "3,") in new stack
    -- Timeout on SIP/sip-in-0000000f, going to 't'
    -- Executing [[email protected]:1] Set("SIP/sip-in-0000000f", "TIMEOUT_LOOPCOUNT=1") in new stack
    -- Executing [[email protected]:2] GotoIf("SIP/sip-in-0000000f", "0?final") in new stack
    -- Executing [[email protected]:3] Set("SIP/sip-in-0000000f", "IVR_MSG=custom/ivr_tabrik3") in new stack
    -- Executing [[email protected]:4] Goto("SIP/sip-in-0000000f", "s,start") in new stack
    -- Goto (ivr-17,s,10)
    -- Executing [[email protected]:10] Set("SIP/sip-in-0000000f", "TIMEOUT(digit)=3") in new stack
    -- Digit timeout set to 3.000
    -- Executing [[email protected]:11] ExecIf("SIP/sip-in-0000000f", "1?Background(custom/ivr_tabrik3)") in new stack
    -- <SIP/sip-in-0000000f> Playing 'custom/ivr_tabrik3.slin' (language 'en')
    -- Registered IAX2 '111' (AUTHENTICATED) at 217.12.84.58:4569
    -- Executing [[email protected]:1] Goto("SIP/sip-in-0000000f", "afterpressing8_tabrik,8,1") in new stack
    -- Goto (afterpressing8_tabrik,8,1)
    -- Executing [[email protected]_tabrik:1] Set("SIP/sip-in-0000000f", "home="/var/lib/asterisk/sounds/custom"") in new stack
    -- Executing [[email protected]_tabrik:2] Answer("SIP/sip-in-0000000f", "") in new stack
    -- Executing [[email protected]_tabrik:3] Wait("SIP/sip-in-0000000f", "1") in new stack
    -- Executing [[email protected]_tabrik:4] BackGround("SIP/sip-in-0000000f", ""/var/lib/asterisk/sounds/custom"/ivr_tabrik5") in new stack
    -- <SIP/sip-in-0000000f> Playing '/var/lib/asterisk/sounds/custom/ivr_tabrik5.slin' (language 'en')
    -- Executing [[email protected]_tabrik:5] WaitExten("SIP/sip-in-0000000f", "10") in new stack
    -- Executing [[email protected]_tabrik:1] Macro("SIP/sip-in-0000000f", "XMPPSend,") in new stack
    -- Executing [[email protected]_tabrik:2] Macro("SIP/sip-in-0000000f", "hangupcall,") in new stack
    -- Executing [[email protected]:1] GotoIf("SIP/sip-in-0000000f", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [[email protected]:3] ExecIf("SIP/sip-in-0000000f", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [[email protected]:4] Hangup("SIP/sip-in-0000000f", "") in new stack
  == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/sip-in-0000000f' in macro 'hangupcall'
  == Spawn extension (afterpressing8_tabrik, h, 2) exited non-zero on 'SIP/sip-in-0000000f'
    -- Registered IAX2 '111' (AUTHENTICATED) at 37.110.210.225:35531
pbx*CLI>

can anyone advise please

1 Like