Brekeke SIP Server Wiki

Brekeke Remote Management Client Interface

The Remote Management Client Interface provides ways to remotely execute a management command plug-in over SIP and HTTP.
This section explains how to send these management command requests. A developer can choose either SIP or HTTP depending on a application.

 

1. Execute Command over HTTP

A management command plug-in can be executed over HTTP.

Here is the system structure:

 

1.1 Settings at SIP Server

To accept HTTP request, the following setting is needed at the [Configuration] > [Advanced] page. With this setting, the SIP server can accept a request only from the defined IP address. The IP address part <Client_IP_Addr> can be defined using Regular expression.

sipadmin.cmd.hosts.allow = <Client_IP_Addr>

 

1.2 Sending a request

A client should send a HTTP request with the following URL syntaxes.

For Brekeke SIP Server:
http://<WEB_ADDRESS>/sip/cmd?cmd=<COMMAND_NAME>
http://<WEB_ADDRESS>/sip/cmd?cmd=<COMMAND_NAME>&param=<PARAMETER>
Variable Value
cmd Command Name
param Parameter (option)

A web server can accept “POST” or “GET” method. If a client wants to send a text content,the “text” variable should be used within “POST” method.

 

For Brekeke PBX or Bundled SIP server in Brekeke PBX:
http://<WEB_ADDRESS>/pbx/cmd?cmd=<COMMAND_NAME>&param=<PARAMETER>&target=<TARGET>
Variable Value
cmd Command Name
param Parameter (option)
target Target (pbx|proxy|ms|9990)

*To accept HTTP request, the allowed IP address range should be specified with Regular expression at the [Options] > [PBX system settings] > [Valid Client IP pattern].

Example: Allow requests only from the local.

^127\.0\.0\.1$

 


2. Execute Command over SIP

The following SIP methods should be used for executing a command over SIP.

Method Purpose
MANAGEMENT Initiate a session
MACK Acknowledge a response

A client sends a MANAGEMENT request first over UDP or TCP to initiate a session to execute a command plug-in. When a client receives a “183 Session Progress” response in the same session, it should acknowledge the response with MACK request.

Here is the flow:

 

Here is the system Structure:

 

2.1 Settings at SIP Server

The following DialPlan is needed to accept MANAGEMENT request at Brekeke SIP Server. With this DialPlan rule, the Brekeke SIP Server can accept a request only from the defined IP address. The IP address part can be defined using Regular expression.

Matching Patterns
$request = ^MANAGEMENT

$addr = <Client_IP_Addr>

Command = (.+)

Deploy Patterns
$action=%1

 

2.2 Sending MANAGEMENT Request

First, a client should send MANAGEMENT request to the Brekeke SIP Server. The Command field must be included with a command plug-in name. If the command can accept a parameter, Param header field can be used.
A client can include content in the message body as the Content-Type “text/plain”.

Header Value
Command Command Name
Param Parameter(option)

 

2.3 Receiving Responses

Brekeke SIP Server will insert a result data in a response packet as the Content-Type “text/plain”. If there are any remained data, the response code will be 183. In this case, a client should send MACK request with same Call-ID and CSeq.
If the response code is 200, there are no remained data.

 


3. Execute Command with Java
java -cp ondosip.jar svctl <target IP address>:<port> <command> <param>

 

*ondosip.jar is located at under the following directory.
<Installed_directory>/webapps/(sip|pbx)/WEB-INF/lib/

 

 

Related links:

Management Command Reference >>

 

Yes No
Suggest Edit