BuyNumber SOAP Service
This webservice will allow you to purchase a number.
Meta:
BuyNumber(UserName,Password,Number,URI,Type);
Sample usage:
<?php | |
include('/path/to/your/nusoap/nusoap.php'); | |
$client = new nusoap_client('http://api.multitel.net/?wsdl'); | |
$parameters=array( | |
array( | |
"UserName" => "yourusername", | |
"Password" => "yourpassword", | |
"Number" => "3228286002", | |
"URI" => "3228286002@yourSIPserver.com", | |
"URI2" => "3228286002@yourOtherSIPserver.com", | |
"URI3" => "3228286002@yourBackupSIPserver.com", | |
"RingType" => "1", | |
"FaxDetect" => "1", | |
"FaxEmail" => "your@email.address.com", | |
"FaxRing" => 5, | |
"Vm" => "1", | |
"Vmring" => "30", | |
"Vmtts" => 1, | |
"Vmemail" => "your@email.address.com", | |
"Cnam" => "1", | |
"Type" => "1" | |
) | |
); | |
$Res = array(); | |
$Res = $client->call("BuyNumbersWs", $parameters,'urn:BuyNumbersWs'); | |
print_r($Res); | |
exit; | |
// $return_arr = $Res['DATA'][0]; | |
// $return = $return_arr['RETURN']; | |
?> |
Parameters:
# Username/Password - your username and password
# Number - the number you are purchasing
# URI - the destination (SIP URI) for this number
# URI2/URI3 - backup destinations for this number
# RingType - how will we ring these numbers?
* RingType => 1 - Sequential - all the URIs will be called in the order they are setup (First we will ring URI, then URI1, then URI2)
* RingType => 2 - Random - only a single URI will be called, selected randomly from the list of provided URIs. If only a single URI is provided, then that'll be the one used
* RingType => 3 - Simultaneously - ring all three URIs at the same time.
# FaxDetect - If FaxDetect is set to 1 , all calls towards this number will automatically be picked up by the system and fax detection will run. Please note that this feature is not free. Its a per account feature, so if you enable it on a single number or 100 numbers - it will cost you the same amount per month. Default value is 0 (not enabled)
# FaxRing - how many seconds should we listen for fax tones before sending the call to URI / URI1 / URI2 ?
# FaxEmail - the email address that will receive the fax messages. Please note that the emails are also stored on the server and you can always view them in your account.
# Vm - If Vm is set to 1 , all unanswered calls will be picked up by our voicemail system. You can record a voicemail greeting in our customer control panel (your web account). Please note that this feature is not free. Its a per account feature, so if you enable it on a single number or 100 numbers - it will cost you the same amount per month. Default value is 0 (not enabled)
# Vmring - How many seconds should we wait for an answer before the voicemail system picks up the call?
# Vmemail - Whats the email address we should be sending this voicemail to?
# Vmtts - Voicemail Text to Speech - This will attempt to translate your VoiceMail messages. Works only for messages in English (US/UK/Australian English) . Please note that this feature is not free. Its a per account feature, so if you enable it on a single number or 100 numbers - it will cost you the same amount per month. Default value is 0 (not enabled). This feature is only charged if you have numbers which have VoiceMail enabled.
# Cnam - enable CNAM lookups for this number - This feature will attempt to identify incoming calls and provide a CallerID Name on the outbound call leg. This feature will charge for successful CNAM lookups.
# Type - type of forward ( 1 is for SIP)
A simplified version is available below:
<?php | |
include('/path/to/your/nusoap/nusoap.php'); | |
$client = new nusoap_client('http://api.multitel.net/?wsdl'); | |
$parameters=array( | |
array( | |
"UserName" => "yourusername", | |
"Password" => "yourpassword", | |
"Number" => "3228286002", | |
"URI" => "3228286002@yourSIPserver.com", | |
"Type" => "1" | |
) | |
); | |
$Res = array(); | |
$Res = $client->call("BuyNumbersWs", $parameters,'urn:BuyNumbersWs'); | |
print_r($Res); | |
exit; | |
// $return_arr = $Res['DATA'][0]; | |
// $return = $return_arr['RETURN']; | |
?> |
Successful number purchase output:
Array | |
( | |
[DATA] => Array | |
( | |
[0] => Array | |
( | |
[RETURN] => 3228286002 | |
) | |
) | |
) |
Unsuccessful number purchase output (Number not available):
Array | |
( | |
[DATA] => Array | |
( | |
[0] => Array | |
( | |
[RETURN] => -165 | |
) | |
) | |
) |
Unsuccessful number purchase output (Not enough credit):
Array | |
( | |
[DATA] => Array | |
( | |
[0] => Array | |
( | |
[RETURN] => 99 | |
) | |
) | |
) |
Unsuccessful number purchase output (User or Password incorrect):
Array | |
( | |
[DATA] => Array | |
( | |
[0] => Array | |
( | |
[RETURN] => 100 | |
) | |
) | |
) |
SOAP XML Definition
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:multitelws"> | |
<soapenv:Header/> | |
<soapenv:Body> | |
<urn:BuyNumbersWs soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> | |
<param xsi:type="urn:BuyNumbersWsReq" xs:type="type:BuyNumbersWsReq" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance"> | |
<UserName xsi:type="xsd:string" xs:type="type:string">?</UserName> | |
<Password xsi:type="xsd:string" xs:type="type:string">?</Password> | |
<Number xsi:type="xsd:string" xs:type="type:string">?</Number> | |
<URI xsi:type="xsd:string" xs:type="type:string">?</URI> | |
<FaxDetect xsi:type="xsd:string" xs:type="type:string">?</FaxDetect> | |
<FaxEmail xsi:type="xsd:string" xs:type="type:string">?</FaxEmail> | |
<FaxRing xsi:type="xsd:string" xs:type="type:string">?</FaxRing> | |
<Vm xsi:type="xsd:string" xs:type="type:string">?</Vm> | |
<Vmring xsi:type="xsd:string" xs:type="type:string">?</Vmring> | |
<Vmtts xsi:type="xsd:string" xs:type="type:string">?</Vmtts> | |
<Vmemail xsi:type="xsd:string" xs:type="type:string">?</Vmemail> | |
<Cnam xsi:type="xsd:string" xs:type="type:string">?</Cnam> | |
<Type xsi:type="xsd:string" xs:type="type:string">?</Type> | |
<URI2 xsi:type="xsd:string" xs:type="type:string">?</URI2> | |
<URI3 xsi:type="xsd:string" xs:type="type:string">?</URI3> | |
<RingType xsi:type="xsd:string" xs:type="type:string">?</RingType> | |
</param> | |
</urn:BuyNumbersWs> | |
</soapenv:Body> | |
</soapenv:Envelope> |