MOR API device details get

From Kolmisoft Wiki
Jump to navigationJump to search

Description

MOR API Device details get

Usage

  • Methods: POST, GET(if allowed, not recomended)



Parametres

  • u – username for authentication. Required.
  • device_id – id of the device whose details you want to get.
  • device_u – username of the device whose details you want to get. (Note that device_id cant be used with device_u, if both parametres are used, firstly, device_id would be used)
  • hash – SHA1 hash constructed using device_id and API_Secret_Key ( More described in Constructing hash). Required.

Please note that admin/reseller can retrieve Device details only for their own Users. Simple users cannot check device details.

Request

We have API Secret Key = 456789, device_id = 5

We send:

HTML POST: http://<SERVER_IP>/billing/api/device_details_get?u=admin&device_id=5&hash=65fd575c441513bd114b84c7dbdb01e0f2716d27

* Note that username is not included in the hash

Returns

Success

 <page>
   <id>2</id>
   <name>101</name>
   <host>dynamic</host>
   <secret>vauvszef</secret>
   <context>mor_local</context>
   <ipaddr>0.0.0.0</ipaddr>
   <port>0</port>
   <regseconds>1175892667</regseconds>
   <accountcode>2</accountcode>
   <callerid>"101" <101></callerid>
   <extension>101</extension>
   <voicemail_active>0</voicemail_active>
   <username>101</username>
   <device_type>IAX2</device_type>
   <user_id>2</user_id>
   <primary_did_id>0</primary_did_id>
   <works_not_logged>1</works_not_logged>
   <forward_to>0</forward_to>
   <record>0</record>
   <transfer>no</transfer>
   <disallow>all</disallow>
   <allow>all</allow>
   <deny>0.0.0.0/0.0.0.0</deny>
   <permit>0.0.0.0/0.0.0.0</permit>
   <nat>yes</nat>
   <qualify>500</qualify>
   <fullcontact></fullcontact>
   <canreinvite>no</canreinvite>
   <devicegroup_id></devicegroup_id>
   <dtmfmode>rfc2833</dtmfmode>
   <callgroup></callgroup>
   <pickupgroup></pickupgroup>
   <fromuser></fromuser>
   <fromdomain></fromdomain>
   <trustrpid>no</trustrpid>
   <sendrpid>no</sendrpid>
   <insecure>no</insecure>
   <progressinband>never</progressinband>
   <videosupport>no</videosupport>
   <location_id>1</location_id>
   <description>Test Device #1</description>
   <istrunk>0</istrunk>
   <cid_from_dids>0</cid_from_dids>
   <pin></pin>
   <tell_balance>0</tell_balance>
   <tell_time>0</tell_time>
   <tell_rtime_when_left>60</tell_rtime_when_left>
   <repeat_rtime_every>60</repeat_rtime_every>
   <t38pt_udptl>no</t38pt_udptl>
   <regserver></regserver>
   <ani>0</ani>
   <promiscredir>no</promiscredir>
   <timeout>60</timeout>
   <process_sipchaninfo>0</process_sipchaninfo>
   <temporary_id></temporary_id>
   <allow_duplicate_calls>0</allow_duplicate_calls>
   <call_limit>0</call_limit>
   <lastms>0</lastms>
   <faststart>yes</faststart>
   <h245tunneling>yes</h245tunneling>
   <latency>0.0</latency>
   <grace_time>0</grace_time>
   <recording_to_email>0</recording_to_email>
   <recording_keep>0</recording_keep>
   <recording_email></recording_email>
   <record_forced>0</record_forced>
   <fake_ring>0</fake_ring>
   <save_call_log>0</save_call_log>
   <mailbox></mailbox>
   <server_id>1</server_id>
   <enable_mwi>0</enable_mwi>
   <authuser></authuser>
   <requirecalltoken>no</requirecalltoken>
   <language></language>
   <use_ani_for_cli>false</use_ani_for_cli>
   <calleridpres></calleridpres>
   <change_failed_code_to>0</change_failed_code_to>
   <reg_status></reg_status>
   <max_timeout>0</max_timeout>
   <forward_did_id>0</forward_did_id>
   <anti_resale_auto_answer>0</anti_resale_auto_answer>
   <qf_tell_balance>0</qf_tell_balance>
   <qf_tell_time>0</qf_tell_time>
   <time_limit_per_day>0</time_limit_per_day>
   <control_callerid_by_cids></control_callerid_by_cids>
   <callerid_advanced_control>0</callerid_advanced_control>
   <transport>udp</transport>
   <subscribemwi></subscribemwi>
   <encryption>no</encryption>
   <block_callerid>0</block_callerid>
   <tell_rate>0</tell_rate>
   <trunk>no</trunk>
   <proxy_port>0</proxy_port>
   <cps_call_limit>0</cps_call_limit>
   <cps_period>0</cps_period>
   <timerb>6400</timerb>
   <callerid_number_pool_id>0</callerid_number_pool_id>
   <op>0</op>
   <op_active>0</op_active>
   <op_tech_prefix></op_tech_prefix>
   <op_routing_algorithm>lcr</op_routing_algorithm>
   <op_routing_group_id>0</op_routing_group_id>
   <op_tariff_id>0</op_tariff_id>
   <op_capacity>500</op_capacity>
   <op_src_regexp></op_src_regexp>
   <op_src_deny_regexp></op_src_deny_regexp>
   <tp>0</tp>
   <tp_active>0</tp_active>
   <tp_tech_prefix></tp_tech_prefix>
   <tp_tariff_id>0</tp_tariff_id>
   <tp_capacity>500</tp_capacity>
   <tp_src_regexp></tp_src_regexp>
   <tp_src_deny_regexp></tp_src_deny_regexp>
   <copy_name_to_number>0</copy_name_to_number>
   <custom_sip_header></custom_sip_header>
   <comment></comment>
   <inherit_codec></inherit_codec>
   <time_limit_per_day_used>0</time_limit_per_day_used>
   <time_limit_per_day_datetime></time_limit_per_day_datetime>
   <execute_agi_script>0</execute_agi_script>
   <custom_dst_header></custom_dst_header>
   <pdd_limit>0</pdd_limit>
   <hide_from_user>0</hide_from_user>
   <original_ipaddr></original_ipaddr>
   <original_host>dynamic</original_host>
   <subscribecontext></subscribecontext>
   <localize_pai>0</localize_pai>
   <custom_rpid_number></custom_rpid_number>
   <custom_pai_number></custom_pai_number>
   <valid_cid_number_pool_id></valid_cid_number_pool_id>
   <fake_number_pool_id></fake_number_pool_id>
   <emergency_callerid></emergency_callerid>
   <emergency_callerid_pool_id>0</emergency_callerid_pool_id>
   <disable_global_pass_privacy>0</disable_global_pass_privacy>
   <devicerulegroup_id>0</devicerulegroup_id>
   <reassigned_new_device_id></reassigned_new_device_id>
   <change_device_pass_pai>-1</change_device_pass_pai>
   <time_limit_per_month>0</time_limit_per_month>
   <time_limit_per_month_used>0</time_limit_per_month_used>
   <time_limit_per_month_day_of_reset>1</time_limit_per_month_day_of_reset>
   <time_limit_per_month_datetime></time_limit_per_month_datetime>
   <callerid_number_pool_type>random</callerid_number_pool_type>
   <callerid_number_pool_deviation>0</callerid_number_pool_deviation>
   <defaultuser>101</defaultuser>
   <useragent></useragent>
   <type>friend</type>
   <md5secret></md5secret>
   <remotesecret></remotesecret>
   <directmedia></directmedia>
   <useclientcode></useclientcode>
   <setvar></setvar>
   <amaflags></amaflags>
   <callcounter></callcounter>
   <busylevel></busylevel>
   <allowoverlap></allowoverlap>
   <allowsubscribe></allowsubscribe>
   <maxcallbitrate></maxcallbitrate>
   <rfc2833compensate></rfc2833compensate>
   <session-timers></session-timers>
   <session-expires></session-expires>
   <session-minse></session-minse>
   <session-refresher></session-refresher>
   <t38pt_usertpsource></t38pt_usertpsource>
   <regexten></regexten>
   <defaultip></defaultip>
   <rtptimeout></rtptimeout>
   <rtpholdtimeout></rtpholdtimeout>
   <outboundproxy></outboundproxy>
   <callbackextension></callbackextension>
   <timert1></timert1>
   <qualifyfreq></qualifyfreq>
   <constantssrc></constantssrc>
   <contactpermit></contactpermit>
   <contactdeny></contactdeny>
   <usereqphone></usereqphone>
   <textsupport></textsupport>
   <faxdetect></faxdetect>
   <buggymwi></buggymwi>
   <auth>md5</auth>
   <fullname></fullname>
   <trunkname></trunkname>
   <cid_number></cid_number>
   <callingpres></callingpres>
   <mohinterpret></mohinterpret>
   <mohsuggest></mohsuggest>
   <parkinglot></parkinglot>
   <hasvoicemail></hasvoicemail>
   <vmexten></vmexten>
   <autoframing></autoframing>
   <rtpkeepalive></rtpkeepalive>
   <call-limit></call-limit>
   <g726nonstandard></g726nonstandard>
   <ignoresdpversion></ignoresdpversion>
   <allowtransfer></allowtransfer>
   <dynamic></dynamic>
   <balance>9999.0</balance>
   <device_balance_enabled>1</device_balance_enabled>
   <codecs>
       <audio_codecs></audio_codecs>
       <video_codecs></video_codecs>
   </codecs>
</page>

If device_details_get is used for FAX device, you will also get such additional return:

  <pdf_fax_emails>  </pdf_fax_emails>



VoiceMail box fields


Successful responses include four additional tags with VoiceMail box settings (the same values as on the device edit page under VoiceMail). These are separate from the voicemail_active device column, which is returned with the other device fields.

Go to SETTINGS → Users → Devices, open the device, and use the VoiceMail section to view or change the GUI fields that correspond to these tags.

voicemail_email
VoiceMail email address. Matches the Email field on the device edit form and the voicemail_email parameter on MOR API device update (that method updates email only).

voicemail_password
VoiceMail mailbox password (device edit Password field). Returned for read-back; change it in the GUI, not via device_update.

voicemail_tz
VoiceMail time zone (device edit Timezone field). When the timezone field is left empty on save, the GUI may store a default such as central.

voicemail_delete
Whether VoiceMail is deleted after sending: yes or no (device edit Delete VoiceMail after sending it).

If the device has no VoiceMail box configured, all four tags remain in the XML with empty values.

Example (after voicemail_active and other device fields):

  <voicemail_email>device@example.com</voicemail_email>
  <voicemail_password>4321</voicemail_password>
  <voicemail_tz>central</voicemail_tz>
  <voicemail_delete>yes</voicemail_delete>



Errors

  • <error>Access Denied</error> – User was not found by such username. Make sure that the username (u) is specified.
  • <error>Device was not found</error> – such a device does not exist in the system, or the device does not belong to your scope.
  • <error>Incorrect hash</error> – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.



See also