-1

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?

user2236794
  • 441
  • 3
  • 7
  • 22
  • Suggestion: limit your question to, a question. There is little motivation on SO to solve a significant portion of your implementation. Post multiple, separate, focused questions, if anything. Finally, you should post code for others to see what you’ve tried. If you don’t have any, then you are asking too big of a question. Break it down into parts that you can try yourself first. – brianolive Apr 23 '19 at 00:52
  • Hello. OK can I get help on dialing a number after an IVR has answered. I have tried the "send_dtmf" function and it does not dial any extension. – user2236794 Apr 23 '19 at 19:05

1 Answers1

0

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.

norbeq
  • 2,923
  • 1
  • 16
  • 20
  • I got the extension working, but the execute_on_answer is not. I have a series of actions that I need to do when the caller answers. I am not seeing many examples of this application. right now my script has session:action would I have to do for each one execute_on_answer:action or can I call this action by itself then run the rest of my script? – user2236794 Apr 24 '19 at 16:48
  • You can execute many actions after answer in lua script : `execute_on_answer=lua incrInUse.lua` – norbeq Apr 24 '19 at 20:29