Skip to main content

User Edit

از این سرویس برای ویرایش داخلی استفاده می‌شود.

پارامتر‌ها

توضیحاتداده های تعریف شدهداده های نمونهپارامترهای ضروری[**]/منطقی[*]پارامترها
شناسه داخلی که از طریق سرویس جستجو بدست می آید-603b41443e14270c550bf15a**id_
فعال/غیرفعال بودن کاربرyes/noyes*active
نام‌کاربر-Test User*name
شماره‌داخلی-530*number
--530*cid_number
رمزعبور-530*secret
ضبط مکالماتyes/nono*call_record
-yes/nono*push_notification
IPهای غیر مجاز-0.0.0.0/0.0.0.0*deny
IPهای مجاز-0.0.0.0/0.0.0.0*permit
پروتکل dtmf-rfc2833*dtmfmode
-yes/nono*canreinvite
-yes/nono*directmedia
--main_routing*context
--dynamic*host
-User/Peer/Frienduser*type
-yes/no/Force Report & Co-Mediano*nat
--5060*port
-yes/nono*qualify
--1*callgroup
--1*pickupgroup
-yes/nono*callcounter
-yes/nono*faxdetect
---*call_limit
-yes/nono*trunk
-yes/nono*transfer
---email
--571forward_policy->Busy
--09158315762forward_policy->No Answer
--570forward_policy->UnAvailable
--2121forward_policy->All
--2121forward_policy->All

نمونه فراخوانی

نمایش کامل کد PHP


<?php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'http://192.168.51.20/api/v4/pbx/users/update',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"_id":"6033876dc92de036d1390923",
"user_type":"SIP",
"active":"yes",
"name":"Test User",
"number":"999",
"cid_number":"999",
"secret":"999",
"call_record":"no",
"push_notification":"no",
"deny":"0.0.0.0/0.0.0.0",
"permit":"0.0.0.0/0.0.0.0",
"dtmfmode":"rfc2833",
"canreinvite":"no",
"directmedia":"no",
"context":"main_routing",
"host":"dynamic",
"type":"user",
"nat":"no",
"port":"5060",
"qualify":"no",
"callgroup":"1",
"pickupgroup":"1",
"callcounter":"no",
"faxdetect":"no",
"call_limit":"",
"trunk":"no",
"transfer":"no",
"email":"",
"forward_policy":{"Busy":"571","No Answer":"093411452671","UnAvailable":"588","All":"2020"},
"more_options":""
}',
CURLOPT_HTTPHEADER => array(
'X-APIKEY: vZKtIKWsld0egNlkzHo8i5LVBqLNBSWARCQsPOSgDjFmAHM3tG',
'Authorization: Basic dGVzdDpBYTEyMzQ1Ng==',
'Content-Type: application/json'
),
));

$response = curl_exec($curl);

if (!curl_errno($curl)) {
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
echo 'response code:'.$httpcode, '<br/>';
}

curl_close($curl);
echo $response;