Custom IVR for Dialing External Number by Key Events

Scenario

Customers want to dial caller in IVR can be forwarded to an a external number by IVR key event. For example, press 1 to a external mobile number 1384561932.

Note: with the following custom IVR dialplan, the change on the web interface will take effect. System will only follow the customized dialplan.

Conditions

Firstly make sure the you have created an outbound route for the external number, and with the proper dial pattern. This route can be exclusive for the external number dialing from IVR key event or not. We recommend create a exclusive one, and remember its outbound route name like the figure: To126

 

How to Create the Custom IVR

We take IVR number 679 and external number 6000 as example.

  1. Login MyPBX via SSH
  2. Edit the configuration file extensions.conf.
  3. Search IVR 679 by typing “/679” on your keyboard. If the first result is not the one you want, type "n" to find the next one until you find it.
  4. You will find the rule of IVR 679 as below.
  5. Copy the calling rule.
    On putty, you should hold left click and drag the area of the code to copy them.
  6. Press the Esc key to exit the modified mode. Type ":q!" to quit and not save this configuration file.
  7. Create a custom configuration file under path: /persistent/custom-cfg/ 
    Enter command ” vi /persistent/custom-cfg/extensions_custom.conf ” to creat a new custom file.
  8. Paste the rule you’d copied by right click from the green cursor. If you don’t like the mouse operation of copy and paste action, you could type the code of the rule as you like.
  9. Add a rule “ exten = 1,1,Goto(CallingRule_To126,6000,1) ”, if you can’t edit or input any word, you could enter “ i ” to swap to Modified mode.
  10. Press to Esc key to exit and swap to Command mode. Enter “:wq” to save and quit the custom file.
  11. Then enter command “ mypbxconf ”&” asterisk –rx ”module reload” ” to reload all configuration files. Or simply apply any changes on the web or reboot MyPBX to take effect.
  12. Finally check the whether the new is generated or not. Enter “ vi etc/asterisk/extension.conf ” and find the IVR 679.

    Explanation of the Added Rule

    exten = 1,1,Goto(CallingRule_To126,6000,1)
    1: means the key you press(key event)
    To126: is the name of the outbound route
    6000: if you press key 1 in IVR, MyPBX will send 6000 to the outbound route “To126”. It means the number you fill here should match the dial pattern of Outbound route“To126”. You could replace the number as required.

    If you need more exteral number dialing, no matter from same outbound route or different outbound route. you could do like this:

    [voicemenu-custom-679]
    exten = 679,1,NoOp(679)
    exten = 679,n,Set(CDR(orgdst)=679)
    exten = 679,n,Background(record/default)
    exten = 679,n,WaitExten(3)
    exten = 679,n,Background(record/default)
    exten = 679,n,WaitExten(3)
    exten = 679,n,Background(record/default)
    exten = 679,n,WaitExten(3)
    exten = 1,1,Goto(CallingRule_To126,6000,1)
    exten = 2,1,Goto(CallingRule_To126,7000,1)
    exten = 3,1,Goto(CallingRule_To127,8000,1)

    exten = 9,1,Goto(CallingRule_To128,9000,1)
    exten = t,1,NoOp(do..)
    exten = i,1,NoOp(do..)
    include = from-outside
    include = conferences
    include = vmm
    exten = fax,1,Goto(detect-fax-to-email,s,1)

  13. Dail to IVR 679 to test.

How to Delete the Custom File

If you don’t need the custom rule any more. Enter command “ cd /persistent/custom-cfg ”& “ rm extensions_custom.conf

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.