SimotelSimotel Documentation
فارسی

Trunk Edit

This service is used to edit a trunk.

Parameters

ParametersRequired[**]/Optional[*]Defined DataSample DataDescription
id_**-6033876dc92de036d1390923Unique identifier of the trunk obtained from search
trunk_type*SIP/IAX2/DAHDISIPTrunk Type
name*-trunk_name_new2Trunk Name
register_string*-some-register-string-
active*yes/nonoActive/Inactive
deny*-0.0.0.0/0.0.0.0-
permit*-0.0.0.0/0.0.0.0-
dtmfmode*-rfc2833DTMF Standard
canreinvite*yes/nono-
directmedia*yes/nono-
context*-from-pstn-
host*-192.168.1.100Service Provider IP
type*User/Peer/Friendfriend-
nat*yes/no/Force Report & Co-Mediaforce_rport, comedia-
port*-5060-
qualify*yes/noyes-
insecure*Port/Invite/Port & Inviteport, invite-
disallow*-all-
allow*-ulaw, alaw-

Sample Invocation

Example Code
PHP
	<?PHP
	$curl = curl_init();

	curl_setopt_array($curl, array(
	  CURLOPT_URL => 'HTTP://192.168.1.100/API/v4/PBX/trunks/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",
			"trunk_type":"SIP",
			"name":"trunk_name_new2",
			"register_string":"3591011020:as#3591011020@192.168.1.100/3591011020\\t",
			"active":"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":"from-pstn",
			"host":"192.168.1.100",
			"type":"friend",
			"nat":"force_rport,comedia",
			"port":"5060",
			"qualify":"yes",
			"insecure":"port,invite",
			"disallow":"all",
			"allow":"ulaw,alaw",
			"more_options":"fromuser=3591011020\\nusername=3591011020\\nsecret=as#3591011020",
			"description":""
		}',
	  CURLOPT_HTTPHEADER => array(
		'X-APIKEY: SAMPLE_API_KEY',
		'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;
?>