Difference between revisions of "MOR API active calls get"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(4 intermediate revisions by 2 users not shown)
Line 50: Line 50:
  <active_call>
  <active_call>
     <id>3</id>
     <id>3</id>
     status>Ringing</status>
     <uniqueid>1249298495.111727</uniqueid>
    <status>Ringing</status>
     <answer_time/>
     <answer_time/>
     <duration/>
     <duration/>
Line 65: Line 66:
     <direction_code>PHL</direction_code>
     <direction_code>PHL</direction_code>
     <direction_name>Philippines</direction_name>
     <direction_name>Philippines</direction_name>
     destination_name>Philippines proper</destination_name>
     <destination_name>Philippines proper</destination_name>
     <provider_id/><provider_name/>
     <provider_id/><provider_name/>
     <channel>SIP/10.219.62.200-c40daf10</channel>
     <channel>SIP/10.219.62.200-c40daf10</channel>
</active_call>
Inbound calls have the following additional output:
    <dst_user_id></dst_user_id>
    <dst_user>The Name</dst_user>
    <dst_device_id></dst_device_id>
    <dst_device_type>SIP</dst_device_type>
    <dst_device_extension>1010</dst_device_extension>
    <dst_device_name>0123456789</dst_device_name>
    <dst_device_istrunk>0</dst_device_istrunk>
    <dst_device_ani>0</dst_device_ani>


'''Errors:'''
'''Errors:'''
Line 96: Line 108:
     </status>
     </status>
  </page>
  </page>
=See also=
=See also=


* [[MOR API]]
* [[MOR API]]

Latest revision as of 07:32, 14 March 2024

Description

Retrieves list of active calls for specified User.

Admin - can get any user calls

Reseller - can get his and his users calls.

User - can get his own calls.

Usage

  • From MOR X14 call: /api/active_calls_get
  • Methods: POST, GET(if allowed, not recommended)



Parameters

Parameters which are included into hash:

  • u - username for authentication. Required.

Parameters which are not included into hash:

  • s_did - did prefix. If pattern is needed, for example, %370, then you should write down %25370 (% - %25utf encoding)
  • s_provider - provider_id
  • s_user_id - source user id
  • s_device - device id(source). Does not work without s_user_id
  • s_dst_user_id - destination user id
  • s_dst_device - destination device id. Does not work without dst_user_id
  • s_destination - destination prefix. If pattern is needed, for example, %370, then you should write down %25370 (% - %25utf encoding)
  • s_destination_group - destination group id
  • s_source - destination prefix. If pattern is needed, for example, %370, then you should write down %25370 (% - %25utf encoding)
  • s_status - text (ringing or answered)
  • s_server - server_id
  • s_country - direction name

Request

If you want find ringing active calls for user=username, through server id 2, and your API Secret Key = 456789

You send:

HTML POST: http://<SERVER_IP>/billing/api/active_calls_get?u=username&s_server=2&s_status=ringing&hash=df2983700ffecb52e6649f0cb3981b66537083a4 



Returns

Success: Everything is ok. You get the list of active calls if there is any:

<active_call>
   <id>3</id>
   <uniqueid>1249298495.111727</uniqueid>
   <status>Ringing</status>
   <answer_time/>
   <duration/>
   <src>306984327345</src>
   <user_id>2</user_id>
   <user>Test User #1</user>
   <src_device_id>2</src_device_id>
   <device_type>IAX2</device_type>
   <device_extension>101</device_extension>
   <device_name>101</device_name>
   <device_istrunk>0</device_istrunk>
   <device_ani>0</device_ani>
   <localized_dst>63727007886</localized_dst>
   <direction_code>PHL</direction_code>
   <direction_name>Philippines</direction_name>
   <destination_name>Philippines proper</destination_name>
   <provider_id/><provider_name/>
   <channel>SIP/10.219.62.200-c40daf10</channel>
</active_call>

Inbound calls have the following additional output:

   <dst_user_id></dst_user_id>
   <dst_user>The Name</dst_user>
   <dst_device_id></dst_device_id>
   <dst_device_type>SIP</dst_device_type>
   <dst_device_extension>1010</dst_device_extension>
   <dst_device_name>0123456789</dst_device_name>
   <dst_device_istrunk>0</dst_device_istrunk>
   <dst_device_ani>0</dst_device_ani>

Errors:

  • Server was not found - bad value or user access denied.
  • Direction was not found - s_country value is entered incorrectly.
  • Originating User was not found - s_user_id value is entered incorrectly or access denied.
  • Originating Device was not found - s_device value is entered incorrectly or access denied.
  • Terminating User was not found - s_dst_user_id value is entered incorrectly or access denied.
  • Terminating Device was not found - s_dst_device value is entered incorrectly or access denied.
  • Destination Group was not found -s_destination_group value is entered incorrectly.
  • Status value must be Ringing or Answered - s_status value is entered incorrectly.
  • Provider was not found - s_provider value is entered incorrectly or access denied.
  • Did was not found - s_did value is entered incorrectly or access denied.

Example: If DID was not found:

<page>
   <status>
       <error> Did was not Found </error>
   </status>
</page>

If no data found:

<page>
   <status>
       <message> No data found... </message>
   </status>
</page>

See also