Methods

Objects

Making Calls

Outbound calls the easy way


To make outbound calls, you can either:

Summary

    API init

    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")
    
            

    Option 1: Broadcast messages to a target

    Method

    Objects

    • Target
    • Calls.Broadcast1.Options
    $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: '+33612345678',
        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 => '+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 = {
        '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)
            

    Without options

    $target = new stdClass;
    $target->number = '+33612345678';
    $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)
            

    Option 2: Control call in real-time


    Call any number in the world! Check the real-time first steps.

    Method

    Objects

    • Target
    • REALTIME10.Call.Options
    $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: '+16469820800',
        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 => '+447890123456',
        :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)