Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 35 Next »

Create Call:

RESTful API

#Restful with json body
POST http://<server_url>:8300/click2dial/calls
 
# Payload from to v3.0.0 upwards, to fix spec design
{
    agent      : <ext>,
    callee     : <callee>,
    outbound_id: <outbound_id>,
    contact_ref: <custom_call_ref>
}
 
# Payload prior to v3.0.0
{
    agent      : <ext>,
    callee     : <callee>,
    outbound_id: <outbound_id>,
    call_ref   : <custom_call_ref>
}

 

Port

From v3.3+ Click2Dial's default port changed to 8300, as it now supports multiple integrators

  • <server_url> PBX IP/Domain Address
  • <ext> agent extension/number
  • <callee> number to dial
  • <outbound_id> number to use as caller ID
  • <custom_call_ref>  your custom call reference

WebRTC

From v3.0.0

Via SIP.js for this example:

// Creates the user agent
var userAgent = new SIP.UA({
    uri              : '<ext>@<server_url>',
    wsServers        : ['ws://<server_url>:8088/ws'],
    authorizationUser: '<ext>',
    password         : '<ext_password>',
    hackIpInContact  : true
});

// Call options
var options = {
    media: {
        constraints: {
            audio: true,
            video: false
        },
        render: {
            remote: {
                audio: document.getElementById('example-audio-tag'),
            },
        },
    }, 
    extraHeaders : [ #SIP headers for Click2Dial Settings
        'X-Platforma-Outbound-ID:<outbound_id>',
        'X-Platforma-Contact-Ref:<custom_call_ref>'
    ]
};

// Make the call
var session = userAgent.invite('sip:<callee>@<server_url>', options);
 
// Error while placing a call
session.on('failed', function (request) {
    //http://sipjs.com/api/0.7.0/causes/
    console.log('Call Failed');
	//We send back special error messages for validation errors.
	var validationErrors = request.getHeaders('X-Platforma-Error');
 
	if (0 < validationErrors.length) { 
		validationErrors.forEach(function(error) {
			console.log('Validation Error: ', error);
		});
	} 
});
  • <server_url> PBX IP/Domain Address
  • <ext> Agent extension/number
  • <ext_password> Agents Password for the Extension
  • <callee> number to dial
  • <outbound_id> number to use as caller ID
  • <custom_call_ref>  your custom call reference

Values:

<ext>

The agent extension number or the first number connected to the call

  • 3-4 digit extension
  • or same as <callee>

Agent Regex

<callee>

The number to dial:

One of the following:

  • 0820001234
    • Length: 10 digits
    • Must start with 0
  • 27820001234
    • Length: 11 digits
    • Must start with 27
  • 0027820001234
    • Length: 13-16 digits
    • Must start with 00

Callee Regex

<outbound_id>

Number to use as caller ID:

One of the following:

  • 'random' for Random CLID (Needs PBX configuration)
  • 0820001234 (WARNING)
    • Length: 10 digits
    • Must start with 0
    • Although this is supported, providers often do reject it.
  • 27820001234 (Reccomended)
    • Length: 11 digits
    • Must start with 27

Outbound Caller ID Regex

<custom_call_ref> 

Your custom call reference specified for this call

Alphanumeric and .-_~:

Max length 230 characters, thereafter they are truncated

Call Contact Reference Regex

Default: if none is provided, then one is generated, although it serves no real purpose

  • No labels