Skip to content

Instantly share code, notes, and snippets.

@radralph
Last active January 25, 2017 15:43
Show Gist options
  • Select an option

  • Save radralph/2c5cb6886a05072d18fc to your computer and use it in GitHub Desktop.

Select an option

Save radralph/2c5cb6886a05072d18fc to your computer and use it in GitHub Desktop.

Scripting API - DOCS


Script/code should be rendered as a txt file. You can use https://gist.github.com or your own server.

eg. https://gist.githubusercontent.com/radralph/21dd694f416d36b595d3/raw/c1ee03178377eeace516ef06f893d2d8bccfb543/test.php

======

Tropo Endpoint to trigger call

https://54.251.177.176/sessions?action=create&token=VOICE_TOKEN_HERE

MTC (mobile terminating call - From app to subscriber)

sample.php
<?php
	call(array("91712345678"), array(
	   "timeout" => 120,
	   "callerID" => 'sip:91712345678@sip.tropo.net',
	   )
);

  say("Hello! this a sample call from globe labs. Welcome to Tropo!");
  hangup();
?> 

Note that the $subscriber variable is a parameter being passed in the trigger endpoint.
You can add more parameters as needed.
To trigger it, you must call this url below:

GET
https://54.251.177.176/sessions?action=create&token=<VOICE_TOKEN_HERE>&subscriber=<subscriber_number>

MOC (mobile originating call - From subscriber to app)

sample.php
<?php
  say("Hello! this a sample call from globe labs. Welcome to Tropo!");
  hangup();
?> 
You just have to remove the call method from the code.
For subscribers to trigger the call. They would have to dial in the application's shortcode.

eg.

_Dial in_ ***2158-1234***
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment