Bhavesh Daswani
Bhavesh Daswani

Reputation: 725

call fire inbound ivr with php

I want to create inbound IVR script in which some part of XML come from PHP. case scenario is like this customer call a given number and would get transfer to agency number but the agency number should be dynamic means it should come from PHP. any suggestion

Upvotes: 0

Views: 141

Answers (1)

Vladimir Mikhailov
Vladimir Mikhailov

Reputation: 61

I believe you can achieve this with following IVR tags:

  1. make a get request to your server from IVR to decide where client should transferred to https://developers.callfire.com/callfire_xml_get.html
  2. create if condition and depending on return value transfer client to the first or the second number https://developers.callfire.com/callfire_xml_if.html
  3. make a transfer https://developers.callfire.com/callfire_xml_transfer.html
<dialplan name="Root">
    <setvar varname="fromNumber">${call. callerid}</setvar>
    <get varname="transferNum">http://destination.com/test.php?type=TestText&ID=${fromNumber}</get>
    <if expr="${transferNum} == 1">
        <transfer callerid="${fromNumber}">5551235555</transfer>
    </if>
    <if expr="${transferNum} == 2">
        <transfer callerid="${fromNumber}">5551236666</transfer>
    </if>
    <if expr="${transferNum} == 3">
        <transfer callerid="${fromNumber}">5551237777</transfer>
    </if>
</dialplan>

Upvotes: 0

Related Questions