Inbound:
In order to be able to do lookups on inbound calls we make use of the Redis callback infrastructure which already exists. We will send a callback to your application which is of a similar type as the C2D notifications. This incoming call notification is compatible with the notification used by the Teleforge Dialler for call connections, thus only one unpacking function is required to handle both.
Redis Notification |
//Notification Example brpop enigma:notifications:inbound // Payload prior to v3.0.0 { type : "call" payload: { number : <caller>, dial_number : <dial_number>, hold_time : <hold_time>, call_ref : <internal_call_ref>, contact_ref : <custom_call_ref>, campaign_ref: "inbound", ref : <ext> } } // Payload from v3.0.0 upwards { type : "call" payload: { number : <caller>, dial_number : <dial_number>, hold_time : <hold_time>, call_ref : <internal_call_ref>, contact_ref : <custom_call_ref>, call_dir : "inbound", ref : <ext> } }
| ||||
---|---|---|---|---|---|
WebRTC Invite | 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'), }, }, } }; // Accept Incoming Call: Listen for the invite userAgent.on('invite', function (session) { //http://sipjs.com/api/0.7.0/ua/#invite console.log('Call Invite Accepted'); session.accept(options); //NO custom SIP headers for v3.0.0 });
|
Values:
<ext> | The agent extension number |
---|---|
<internal_call_ref> | Internal click2dial call reference, this is used to disposition the call
|
<custom_call_ref> | The contact_ref field may not always be populated, that depends if there is an IVR which allows inbound callees to type in a reference number or account number. If this is the case that will be filled in in the contact_ref field, otherwise the field will default to a null string (""). |