Switchcase: This applet helps customers to streamline their flows based on multiple responses. It helps them to create different work flows based on different responses given. 


Ex: For a condition based routing(Geo routing API)


The call flow would be like :



The steps followed here are:

1. Customer Calls a central number

2. The pass-through applet passes the call details to the URL configured



It makes a GET request to the URL with the call details as URL-encoded HTTP query parameters.

eg:-  www.the newcompny.com/exoteldata.php?CallSid=1321360773 &From=09880847047&To=08088919888&Direction=incoming&DialCallDuration=7&StartTime=2011-11-15+18%3A09%3A41&EndTime=0000-00-00+00%3A00%3A00&CallType=call&DialWhomNumber=09052161119&digits=%2289%22 HTTP/1.1

Once Passthru sends the data ,the customer needs to read the digits parameter along with the Callsid and return a 200 Ok response along with a keyword in the body of the response (The response needs to be in text/plain format).

This list of keywords that are returned in the passthru applet will be checked in the switch case applet, where these keywords are pre-defined and are set to do corresponding actions (This could be connecting to a group (Connect applet), playing a greeting (greeting applet) and others). Please find one such example below.



CRM now needs to send a keyword to be read by SWITCHCASE,which would connect the call to a specific team.

The CRM needs to return response like below in text/plain format

{"select":"<Name/option in the switchecase>"}


This option is read by the swith case applet and tries to follow the next part of the call flow which is "connect" to reach the appropriate group.

This can be used for Dynamic routing like incase of marketplace scenarios.