IVR custom programing pbx

yes, is freepbx

witch better ways? i know how i did is not the best practice, but can i just all my inbound call go to this IVR without a extension? (i did with 5000, just to test)

As Lorne said. Create a misc destination which calls 5000.
Then point your inbound route to that misc destination.

If you paste here the text from this picture, I’ll help you set it up properly.

; Internal dialplan that most internal phones have access to
;
[from-internal]

;GoogleTTS Demo

;verificacion del celular registrado

exten => 5000,1,Verbose(Testando Google TTS ${CALLERID(name)});
exten => 5000,2,Answer();
exten => 5000,3,Agi(nroRegGb.php,${CALLERID(name)});
exten => 5000,4,GotoIf($[ “${sucu}” = “0” ]?err);
exten => 5000,5,GotoIf($[ “${sucu}” = “0” ]?err2);
exten => 5000,6,GotoIf($[ “${cantPaq}” != “0” ]?oK:ok1);

;vericacion del CI
exten => 5000,7(err),Playback(custom/12);
exten => 5000,8,Read(ci,“silence/2”,8,6);
exten => 5000,9,Agi(ciRegGb.php,${ci});
exten => 5000,10,GotoIf($[ “${nombre}” = “nuevo” ]?err1);
exten => 5000,11,GotoIf($[ “${sucu}” = “0” ]?err2);
exten => 5000,12,GotoIf($[ “${cantPaq}” != “0” ]?oK:ok1);
;nuevo cliente
exten => 5000,11(err1),Goto(nuevo-cliente,s,1);
;no se detecto el CI cliente
exten => 5000,12(err2),Playback(custom/15);
;Posee paquetes
exten => 5000,13(oK),Goto(cliente-paquete,s,1);
;No posee paquetes
exten => 5000,14(ok1),Goto(no-paquetes,s,1);

[nuevo-cliente]
exten => s,1,NoOp();
same => 2(loop),Playback(custom/16);
same => n,Playback(custom/18);
same => n,Playback(custom/20);
same => n,Playback(custom/22);
same => n,Playback(custom/23);
same => n,WaitExten(5);
same => n,Goto(loop);
exten => 1,1,Goto(registro,s,1)
exten => 2,1,Goto(aereo,s,1)
exten => 3,1,Goto(maritimo,s,1)
exten => 4,1,Goto(representante,s,1)
exten => 5,1,Goto(representante,s,1)

[registro]
exten => s,1,NoOp();
same => n,Playback(custom/17);
same => n,WaitExten(5);
exten => 1,1,Playback(custom/11);
exten => 2,1,Goto(nuevo-cliente,s,1)

[aereo]
exten => s,1,NoOp();
same => n,Playback(custom/19);
same => n,WaitExten(5);
exten => 1,1,Playback(custom/11);
exten => 2,1,Goto(nuevo-cliente,s,1)

[maritimo]
exten => s,1,NoOp();
same => n,Playback(custom/21);
same => n,WaitExten(5);
exten => 1,1,Playback(custom/11);
exten => 2,1,Goto(nuevo-cliente,s,1)

[representante]
exten => s,1,NoOp();
same => n,Playback(custom/11);
same => n,WaitExten(5);

;no se detecto el CI cliente
exten => 5000,30(err2),Playback(custom/15);
same => n,goto “Representante”
same => n,Hangup();

[cliente-paquete]
exten => s,1,NoOp();
same => n,Playback(custom/HOLA);
same => n,Agi(googletts.agi,"${nombre}",es);
same => n,Playback(custom/03);
same => n,Agi(googletts.agi,"${cantPaq}",es);
same => n,Playback(custom/04);
same => n,Agi(googletts.agi,"${peso}",es);
same => n,Playback(custom/05);
same => n,Goto(opcion-cliente,s,1);

[opcion-cliente]
exten => s,1,NoOp();
same => 2(loop),Playback(custom/06);
same => n,Playback(custom/07);
same => n,Playback(custom/08);
same => n,WaitExten(5);
same => n,Goto(loop);
exten => 1,1,Goto(delivery,s,1);
exten => 2,1,Goto(compra,s,1);
exten => 3,1,Goto(representante,s,1);
exten => 4,1,Goto(representante,s,1);
exten => 5,1,Goto(representante,s,1);

[delivery]
exten => s,1,NoOp();
same => n,Playback(custom/09);
same => n,WaitExten(5);
exten => 1,1,Goto(opcion-cliente,s,1)

[compra]
exten => s,1,NoOp();
same => n,Playback(custom/10);
same => n,WaitExten(5);
exten => 1,1,Goto(opcion-cliente,s,1)

[no-paquetes]
exten => s,1,NoOp();
same => n,Playback(custom/HOLA);
same => n,Agi(googletts.agi,"${nombre}",es);
same => 4(loop),Playback(custom/14);
same => n,WaitExten(5);
same => n,Goto(loop);

exten => 1,1,Goto(representante,s,1);
exten => 2,1,Goto(compra,s,1);

include => from-internal-noxfer
include => from-internal-xfer
include => bad-number ; auto-generated
exten => h,1,Macro(hangupcall)

Follow the below steps.

  • Paste the text from this link https://pastebin.freepbx.org/view/raw/209bd577 in /etc/asterisk/extensions_custom.conf

  • Create a Custom Destination under Admin > Custom Destinations. Set the target to custom-tts-ivr,s,1

  • Under Applications > Misc Application create the below:

  • Go to Connectivity > Inbound Routes, and create an inbound route, point it to the Custom Destination (Not to the Misc Application)

  • Finally, go to extensions.conf and delete all the config you added and apply config.

Now when you dial 5000 from internal you should reach the IVR, and when calling the DID in your inbound route you should be reaching the IVR as well.

ok ok i will try and tell if work

thanks a loot!!

its woork!! perfect!!
But i have anohter problem, when i call from outside i interact with ivr but when i must to put my dni on this part:
;vericacion del CI
exten => s,n(err),Playback(custom/12);
exten => s,n,Read(ci,“silence/2”,8,6);
exten => s,n,Agi(ciRegGb.php,${ci});

he just continue and dont even wait to put the numbers,. and this is the log:

why user disconect?

Thanks

PD: on my test pbx work fine. i dont know why on prod doesnt work.

Maybe try changing to

exten => s,n(err),Read(ci,custom/12,8,6);
exten => s,n,Agi(ciRegGb.php,${ci});

thanks! its work!! but why i have this error?

In both php. I try executing on …/agi-bin and its work fine.

Is a pbx problem?

Thanks

I don’t know. Can you post a picture of the custom-tts-ivr dialplan in extensions_custom.conf?

Both are the same code:
[custom-tts-ivr]
;verificacion del celular registrado
exten => s,1,Noop(Entering custom IVR setup in extensions_custom.conf)
exten => s,n,Verbose(Testando Google TTS ${CALLERID(num)});
exten => s,n,Answer();
exten => s,n,Agi(nroRegGb.php,${CALLERID(num)});
exten => s,n,GotoIf($[ “${sucu}” = “0” ]?err);
exten => s,n,GotoIf($[ “${sucu}” = “0” ]?err2);
exten => s,n,GotoIf($[ “${cantPaq}” != “0” ]?oK:ok1);

But in prod:

test: work fine

all is working fine now, but how can i accept an extension without finishing the option. i put this:
include => from-did-direct-ivr on the top but dosnt work in the another context.

Thanks

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