⚲
Project
General
Profile
Sign in
Home
Projects
Help
Search
:
Documentation
All Projects
Documentation
Overview
Activity
News
Wiki
Download (997 Bytes)
Provisioning guide
» sip_add_account.php
Tijmen de Mes
, 10/11/2012 07:50 PM
#!/usr/bin/php
<?
include
(
"SOAP/Client.php"
);
// Available in PHP PEAR SOAP library
require
(
"ngnpro_soap_lib.php"
);
// Initialize SOAP client / SIP port
$SipPort
=
new
WebService_NGNPro_SipPort
();
// Login credentials to Managed DNS
$credentials
=
array
(
"username"
=>
"MDNSusername"
,
"password"
=>
"MDNSpassword"
);
$auth_header
=
array
(
'auth'
,
$credentials
,
'urn:AGProjects:NGNPro'
,
0
,
''
);
//////////////////////////////////////////////
// Create a SIP account
//////////////////////////////////////////////
$SipPort
->
addHeader
(
$auth_header
);
$result
=
$SipPort
->
addAccount
(
array
(
"id"
=>
array
(
"username"
=>
'alice'
,
"domain"
=>
'example.com'
),
"password"
=>
"1234"
));
if
(
PEAR
::
isError
(
$result
))
{
$error_msg
=
$result
->
getMessage
();
$error_fault
=
$result
->
getFault
();
$error_code
=
$result
->
getCode
();
print
"
$error_msg
\n
"
;
printf
(
"%s %s
\n
"
,
$error_fault
->
detail
->
exception
->
errorcode
,
$error_fault
->
detail
->
exception
->
errorstring
);
}
else
{
print
"SIP account created
\n
"
;
}
?>
« Previous
1
…
21
22
23
24
25
Next »
(23-23/25)
Loading...