Jump to content
2600Hz Community

Create a call flow manually, but route to the call flow programatically

Paul M

Recommended Posts

In my use case, I want to create a number of call flows manually. When an incoming call is received, I will check the phone number against a database and then based on the state of the number in the database, I want to route to one of the flows that were created. 

Is this approach possible? If so, how should the flows be created in the UI? Is the Pivot callflow the best option to handle the programmable portion? 

Link to comment
Share on other sites

You can do this with Pivot and Preflow. We've done this in a lot of different ways, mostly using PHP scripts.
First, create the callflows you want to route the calls to, then check in Futon / CouchDB for the Callflow ID's. (however this might be possible to integrate directly into the PHP script instead of making different pre-defined callflows).
Then create a callflow with a Pivot request, pointing to the PHP script.
The PHP script then can route the call to the correct Callflow ID, it just has to return '{"module":"callflow","data":{"id":"<callflow_id>"}}'

To make the Pivot script run every time a call is being connected in you can select that as Preflow in the Callflow app -> Account Settings -> Misc -> Preflow.

Example Pivot callflow below:

Example PHP script:

header("content-type: application/json");
die ('{"module":"callflow","data":{"id":"'.$nextcallflow.'"}}');


Edited by tomas_ (see edit history)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...