Tutorial for simple branch call example.

This makes a call to the destination end and will get digits. Then will execute the branched target.

                  Start
                    |
                    |
    ------------>  Talk("Press 1 for show must go on. Press 2 for bohemian rhapsody. Press 3 for another one bites the dust")
    |               |
    |               |
    |              Digit(DTMF) receive
    |               |
    |               |
    |       -----------------------------------------------
    |       |           |                |                |
    |     default      "1"              "2"              "3"
    |       |           |                |                |
    |       |           |                |                |
    |       |          Talk(...)        Talk(...)        Talk(...)
    |       |           |                |                |
    |       |           |                |                |
    |       |          Hangup          Hangup           Hangup
    |       |
    |       |
    |      Talk(...)
    |       |
    ----goto(loop 3 times)
            |
            |
           Talk(...)
            |
            |
           Hangup
{
	"source": {
		"type": "tel",
		"target": "+821100020001"
	},
	"destinations": [
		{
			"type": "tel",
			"target": "+821100010001"
		}
	],
	"actions": [
		{
			"type": "talk",
			"option": {
				"text": "Hello. This is branch test. Press 1 for show must go on. Press 2 for bohemian rhapsody. Press 3 for another one bites the dust",
				"gender": "female",
				"language": "en-US"
			}
		},
		{
			"type": "digits_receive",
			"option": {
				"duration": 5000,
				"length": 1
			}
		},
		{
			"type": "branch",
			"option": {
				"default_index": 9,
				"target_indexes": {
					"1": 3,
					"2": 5,
					"3": 7
				}
			}
		},
		{
			"type": "talk",
			"option": {
				"text": "Empty spaces, what are we living for? Abandoned places, I guess we know the score, on and on. Does anybody know what we are looking for? Another hero, another mindless crime. Behind the curtain, in the pantomime",
				"gender": "female",
				"language": "en-US"
			}
		},
		{
			"type": "hangup"
		},
		{
			"type": "talk",
			"option": {
				"text": "Mama, Just killed a man. Put a gun against his head, pulled my trigger. Now he's dead. Mama, life had just begun, But now I've gone and thrown it all away.",
				"gender": "female",
				"language": "en-US"
			}
		},
		{
			"type": "hangup"
		},
		{
			"type": "talk",
			"option": {
				"text": "Steve walks warily down the street. With his brim pulled way down low. Ain't no sound but the sound of his feet. Machine guns ready to go. Are you ready hey are you ready for this?",
				"gender": "female",
				"language": "en-US"
			}
		},
		{
			"type": "hangup"
		},
		{
			"type": "talk",
			"option": {
				"text": "You didn't choice correct number. Default selected.",
				"gender": "female",
				"language": "en-US"
			}
		},
		{
			"type": "goto",
			"option": {
				"target_index": 0,
				"loop": true,
				"loop_count": 2
			}
		},
		{
			"type": "talk",
			"option": {
				"text": "Loop over. Hangup the call. Thank you, good bye.",
				"gender": "female",
				"language": "en-US"
			}
		},
		{
			"type": "hangup"
		}
	]
}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.