Search code examples
luafreeswitch

dial an extension after call is setup


I need to dial an extension within an IVR. So my freeswitch application will test PBX extensions. The application will dial an IVR (Could be running any PBX vendor), when the PBX picks up it will dial an extension and run several tests including testing two way audio, DTMF and other tests. I got my test scenarios working with a normal numbers, but now I need to extend it to dial extensions within an IVR. Most of this is written in Lua

I have two problems with this setup:

  1. How can I dial an extension after the call is setup. Tried the "send_dtmf" but it didnt work or maybe I just dont know how to use it. I have done "send_dtmf " and nothing happens. What would be the best way to dial an extension after the IVR picks up?

  2. Once I get this part working. How can I wait for the extension to answer before starting to execute my test script. I was thinking of doing "wait_for_silence 200 15 10 5000" then execute the rest of my script. What do you think? Is there a better way?


Solution

  • To call typed extension you should use application called play and get digits or bind digit action. Next read the digits pressed and do application ( transfer/ call ) on this leg to this digits. Here isn't simple call extension application.

    To achieve on onswer handler you can use application called execute_on_answer.