Methods
Objects
Outbound calls the easy way
To make outbound calls, you can either:
Summary
require 'vendor/autoload.php'; // Composer $api = new \CALLR\API\Client; $api->setAuth(new \CALLR\API\Authentication\LoginPasswordAuth('login', 'password'));
var callr = require('callr'); var api = new callr.api(callr.loginPasswordAuth('login', 'password'));
require 'callr' api = CALLR::Api.new('login', 'password')
import callr api = callr.Api("login", "password")
$target = new stdClass; $target->number = '+447890123456'; $target->timeout = 30; $messages = [131, 132, 'TTS|TTS_EN-GB_SERENA|Hello world! how are you ? I hope you enjoy this call. good bye.']; $options = new stdClass; $options->cdr_field = 'userData'; $options->cli = 'BLOCKED'; $options->loop = 2; $result = $api->call('calls.broadcast_1', [$target, $messages, $options]);
var target = { number: '+447890123456', timeout: 30 }; var messages = [131, 132, 'TTS|TTS_EN-GB_SERENA|Hello world! how are you ? I hope you enjoy this call. good bye.']; var options = { cdr_field: 'userData', cli: 'BLOCKED', loop: 2 }; api.call('calls.broadcast_1', target, messages, options).success(function(result) { // });
target = { :number => '+16469820800', :timeout => 30 } messages = [131, 132, 'TTS|TTS_EN-GB_SERENA|Hello world! how are you ? I hope you enjoy this call. good bye.'] options = { :cdr_field => 'userData', :cli => 'BLOCKED', :loop => 2 } result = api.call('calls.broadcast_1', target, messages, options)
target = { 'number': '+33612345678', 'timeout': 30 } messages = [131, 132, 'TTS|TTS_EN-GB_SERENA|Hello world! how are you ? I hope you enjoy this call. good bye.'] options = { 'cdr_field': 'userData', 'cli': 'BLOCKED', 'loop': 2 } result = api.call('calls.broadcast_1', target, messages, options)
$target = new stdClass; $target->number = '+447890123456'; $target->timeout = 30; $messages = [131, 132, 134]; $result = $api->call('calls.broadcast_1', [$target, $messages, null]);
var target = { number: '+447890123456', timeout: 30 }; var messages = [131, 132, 134]; api.call('calls.broadcast_1', target, messages, null).success(function(result) { // });
target = { :number => '+33612345678', :timeout => 30 } messages = [131, 132, 134] result = api.call('calls.broadcast_1', target, messages, nil)
target = { 'number': '+447890123456', 'timeout': 30 } messages = [131, 132, 134] result = api.call('calls.broadcast_1', target, messages, None)
This only works with mobile phones.
$target = new stdClass; $target->number = '+16469820800'; $target->timeout = 30; $messages = [131, 132, 'TTS|TTS_EN-GB_SERENA|Hello world! how are you ? I hope you enjoy this call. good bye.']; $options = new stdClass; $options->cdr_field = 'userData'; $options->cli = '+441234567890'; $options->direct_to_voicemail = true; $result = $api->call('calls.broadcast_1', [$target, $messages, $options]);
var target = { number: '+447890123456', timeout: 30 }; var messages = [131, 132, 'TTS|TTS_EN-GB_SERENA|Hello world! how are you ? I hope you enjoy this call. good bye.']; var options = { cdr_field: 'userData', cli: '+33698765432', direct_to_voicemail: true }; api.call('calls.broadcast_1', target, messages, options).success(function(result) { // });
target = { :number => '+447890123456', :timeout => 30 } messages = [131, 132, 'TTS|TTS_EN-GB_SERENA|Hello world! how are you ? I hope you enjoy this call. good bye.'] options = { :cdr_field => 'userData', :cli => '+441234567890', :direct_to_voicemail => true } result = api.call('calls.broadcast_1', target, messages, options)
target = { 'number': '+447890123456', 'timeout': 30 } messages = [131, 132, 'TTS|TTS_EN-GB_SERENA|Hello world! how are you ? I hope you enjoy this call. good bye.'] options = { 'cdr_field': 'userData', 'cli': '+441234567890', 'direct_to_voicemail': True } result = api.call('calls.broadcast_1', target, messages, options)
Call any number in the world! Check the real-time first steps.
$target = (object) [ 'number' => '+447890123456', 'timeout' => 30 ]; $options = (object) [ 'cdr_field' => '42', 'cli' => 'BLOCKED' ]; $result = $api->call('calls.realtime', [$app->hash, $target, $options]);
var target = { number: '+447890123456', timeout: 30 }; var callOptions = { cdr_field: '42', cli: 'BLOCKED' }; api.call('calls.realtime', 'appHash', target, callOptions).success(function(callID) { // success callback }).error(function(error) { // error callback });
target = { :number => '+16469820800', :timeout => 30 } callOptions = { :cdr_field => '42', :cli => 'BLOCKED' } result = api.call('calls.realtime', 'appHash', target, callOptions)
target = { 'number': '+33612345678', 'timeout': 30 } callOptions = { 'cdr_field': '42', 'cli': 'BLOCKED' } result = api.call('calls.realtime', 'appHash', target, callOptions)