...
...
...
RESTful API |
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
| #Restful with json body
POST http://<server_url>:<http_port>/click2dial/calls |
- server_url: PBX IP/Domain Address
- agent: <ext> agent extension/number
- callee: <callee> number to dial
- outbound_id: <outbound_id> number to use as caller ID
- call_ref: <custom_call_ref> your custom call reference, (in the dialer this is the contact_ref, but call_ref is kept for backwards compatibility)
| WebRTC | From v2.7.0 (unreleased)
Via SIP.js for this example:
Code Block |
---|
---|
|
// Creates the user agent
var userAgent = new SIP.UA({
uri
# Payload from to v3.0.0 upwards, to fix spec design
{
|
| | '<ext>@<server_url>' | wsServers | | ['ws://<server_url>:8088/ws'] | authorizationUser | '<ext>' | password : '<ext_password>',
hackIpInContact : true
});
// Call options
var options = contact_ref: <custom_call_ref>
}
# Payload prior to v3.0.0
{
|
| 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>'outbound_id: <outbound_id>,
call_ref |
| 'X-Platforma-Call-Ref: | '
] | ;
// Make the call
var session = userAgent.invite('sip:<callee>@<server_url>', options);- <server_url> PBX IP/Domain Address
- <ext>
| Agent | <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
| , (in the dialer this is the contact_ref, but call_ref is kept for backwards compatibility) | WebRTC | From v3.0.0 From v4.0.0 The Sip Headers changed to X-Teleforge-* |
---|