Difference between revisions of "MOR API callback init"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: Line 1:
=About=
=Description=
[[Callback|Callback Addon]] is needed in order to use API callback.
[[Callback|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.
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.
<br><br>
=Usage=


* Call: /billing/api/callback_init
* Methods: POST, GET(if allowed, not recomended)
<br><br>
<br><br>
==Request==
===Parametres===


http://<YOUR_SERVER_IP>/billing/api/callback?u=<USERNAME>&p=<PASSWORD>&device=<DEVICE_ID>&src=<SOURCE>&dst=<DESTINATION>


* USERNAME/PASSWORD login and password from the USER, not from the device! (user should be the owner of the device)
* u users username, not from the device! (user should be the owner of the 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.
* 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.
* SOURCE – which number to dial first.
* src source, which number to dial first.
* DESTINATION – will be dialed when SOURCE answers.
* dst destination, which will be dialed when SOURCE answers.


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


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


==Response==
'''Success'''– Means callback is initiated.


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


* Means callback is initiated.
'''Errors'''


<br>
Not authenticated – User is not present with provided username.


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


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


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


* User is not present with provided username.
No source – No source in request.
* User's password is wrong.


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


<Status>Bad device</Status>
===Call is not received===
 
* Device does not exist.
* Device should belong to user if user does not have 'admin' rights.
 
==No source==
 
<Status>No source</Status>
 
* No source in request.
 
 
==Call is not received==


* Check your CDR for a FAILED call and reason why it failed.
* Check your CDR for a FAILED call and reason why it failed.
Line 54: Line 55:
* Use [[Call Tracing]] to locate the error and fix it.
* Use [[Call Tracing]] to locate the error and fix it.
<br><br>
<br><br>
=== See also ===
= See also =
 
* [[MOR API]]
* [[MOR API]]

Revision as of 13:52, 23 May 2013

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

  • Call: /billing/api/callback_init
  • 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.

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