MOR API callback init

From Kolmisoft Wiki
Jump to navigationJump to search

Description

Callback Addon is needed in order to use MOR API callback.

This API method is often used to implement Click2Call functionality from webpage. Also it can be used in CRM systems like SugarCRM, Salesforce and others.

Usage

  • From MOR X4 call: /api/callback_init
  • For Backwards-compatibility old name 'callback' is also usable. Call: /api/callback
  • Methods: POST, GET(if allowed, not recomended)



Parametres

  • u – users username, not from the device! (user should be the owner of the device)
  • device – device_id, which device should be used to initiate callback and which Caller ID will be set on the call (Device ID = Device ACC, or accountcode). You can find ACC in /billing/devices/devices_all). USER should be the owner of the device in MOR.
  • src – source, which number to dial first.
  • dst – destination, which will be dialed when SOURCE answers.
  • cli_lega - callerID on legA. Optional. Takes higher priority then GUI settings.
  • cli_legb - callerID on legB. Optional. Takes higher priority then GUI settings.

You can omit <DESTINATION>. If you do so, SOURCE will be asked to enter it.

Request

HTML POST: http://<YOUR_SERVER_IP>/billing/api/callback?u=username&device=device_id&src=source&dst=destination



Returns

Success– Means callback is initiated.

<?xml version="1.0" encoding="UTF-8"?>
<status>Ok</status>




Errors

Not authenticated – User is not present with provided username.

<?xml version="1.0" encoding="UTF-8"?>
<status>Not authenticated</status>

Bad device – Device does not exist or Device should belong to user if user does not have 'admin' rights.

<?xml version="1.0" encoding="UTF-8"?>
<status>Bad device</status>

No source – No source in request.

<?xml version="1.0" encoding="UTF-8"?>
<status>No source</status>

Call is not received

  • Check your CDR for a FAILED call and reason why it failed.
  • Check Asterisk CLI for error.
  • Use Call Tracing to locate the error and fix it.



See also