Reference8:PBX Configuration API: Difference between revisions
New page: Starting with v6 a new Web User Interface has been implemented to configure the PBX. The same interface can be used by applications for configuration. The interface is based on the mechani... |
No edit summary |
||
| (16 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{FIXME|reason=Work in progress, still very incomplete}} | |||
{{FIXME|reason=Shouldn't we rather advice to use SOAP/Admin?}} | |||
Starting with v6 a new Web User Interface has been implemented to configure the PBX. The same interface can be used by applications for configuration. The interface is based on the mechanism used by web forms. This means a string containing a list of named arguments is sent to the PBX and the PBX returns an XML document. | Starting with v6 a new Web User Interface has been implemented to configure the PBX. The same interface can be used by applications for configuration. The interface is based on the mechanism used by web forms. This means a string containing a list of named arguments is sent to the PBX and the PBX returns an XML document. | ||
| Line 9: | Line 12: | ||
The arguments are sent as part of the URL. The URL to be used has the following form: | The arguments are sent as part of the URL. The URL to be used has the following form: | ||
<ip>/<PBX-Entity>/ADMIN/mod_cmd_login.xml?argument1=value1&argument2=value2&... | |||
Example | |||
192.168.0.1/PBX0/ADMIN/mod_cmd_login.xml?cmd=submit-object&cn=Test&e164=111&h323=test | |||
=== HTTP POST === | === HTTP POST === | ||
| Line 18: | Line 25: | ||
to be done | to be done | ||
=== mod cmd === | |||
The commands can also be sent via the command processor, which can be accessed with telnet or the update script or a '!' URL on the browser. The format of the command is in this case | |||
!mod cmd <PBX-Entity>/ADMIN <command> /argument1 value1 /argument2 value2 ... | |||
The first argument is implicitly '''cmd'''. | |||
Example | |||
!mod cmd PBX0/ADMIN submit-object /cn Test /e164 111 /h323 test | |||
== Arguments == | == Arguments == | ||
| Line 29: | Line 48: | ||
=== xsl === | === xsl === | ||
This argument is put as reference to an XSL file into the XML file returned. | |||
=== guid === | |||
Hexstring containing the GUID of an object to be changed. This argument may be ommitted only if a new object shall be created. A value of '''*''' indicates that the argument '''cn''' shall be used to identify the object instead. | |||
=== cn === | |||
The Long Name of an object. Used to identify an existing object if '''guid''' is set to '''*''' | |||
== cmd=submit-object == | |||
Used to create/change/delete objects. | Used to create/change/delete objects. | ||
| Line 53: | Line 68: | ||
|valign=top nowrap=true|'''e164''' | |valign=top nowrap=true|'''e164''' | ||
|The number of the object | |The number of the object | ||
|- | |||
|valign=top nowrap=true|'''gi''' | |||
|Configures the group for which group indications are sent to the registered endpoints | |||
|- | |||
|valign=top nowrap=true|'''rej-ext''' | |||
|If set to '''on''', the Reject external Calls property is set | |||
|- | |||
|valign=top nowrap=true|'''phone-config''' | |||
|If set to '''on''', the PBX stores the config for phones registered to this object | |||
|- | |- | ||
|valign=top nowrap=true|'''pseudo''' | |valign=top nowrap=true|'''pseudo''' | ||
| Line 58: | Line 82: | ||
|} | |} | ||
=== pseudo=waiting === | |||
... | ... | ||
== cmd=submit-groups == | |||
Used to change group configuration of a user. With a single command the complete list of | Used to change group membership configuration of a user. With a single command the complete list of group memberships is sent, which replaces the existing list of group memberships. | ||
A single group is configured with the following arguments in exactly this order. For multiple | A single group membership is configured with the following arguments in exactly this order. For multiple group memberships this can be repeated. | ||
{| | {| | ||
| Line 73: | Line 97: | ||
|- | |- | ||
|valign=top nowrap=true|'''grp-active''' | |valign=top nowrap=true|'''grp-active''' | ||
|If this argument is set to '''on''' | |If this argument is set to '''on''' the group membership is set to active | ||
|- | |- | ||
|valign=top nowrap=true|'''grp-dyn''' | |valign=top nowrap=true|'''grp-dyn''' | ||
|If this argument is set to '''in''', the group membership is dynamic with preset to be in the group, if this argument is set to '''out''' the group membership is dynamic with preset to be not in the group | |If this argument is set to '''in''', the group membership is dynamic with preset to be in the group, if this argument is set to '''out''' the group membership is dynamic with preset to be not in the group. If this argument is missing or empty, the group membership is static | ||
|- | |- | ||
|valign=top nowrap=true|'''grp-add''' | |valign=top nowrap=true|'''grp-add''' | ||
|Marks the end of the group membership definition, must be present | |Marks the end of the group membership definition, must be present | ||
|} | |} | ||
== cmd=submit-forks == | |||
Used to change forking configuration of a user. With a single command the complete list of forking destinations is sent, which replaces the existing list of forking destinatios. | |||
A single forking destination is configured with the following arguments in exactly this order. For multiple forking destinations this can be repeated. | |||
{| | |||
|valign=top nowrap=true|'''e164''' | |||
|Forking destination number | |||
|- | |||
|valign=top nowrap=true|'''h323''' | |||
|Forking destination name | |||
|- | |||
|valign=top nowrap=true|'''mobility''' | |||
|Long Name of a mobility object associated with this forking destination | |||
|- | |||
|valign=top nowrap=true|'''hw''' | |||
|Device id used on SOAP to control calls with this forking destination | |||
|- | |||
|valign=top nowrap=true|'''delay''' | |||
|Delay for calls sent out to the forking destination | |||
|- | |||
|valign=top nowrap=true|'''fork''' | |||
|Indicates the end of the forking destination configuration | |||
|} | |||
==Examples== | |||
===Change an existing Object=== | |||
The command <code>submit-object</code> can be used to change an existing PBX Object. If you already know the <code>guid</code> of the object, you can use it to refer to the desired object. Otherwise use <code>guid=*</code> and refer to the object by using <code>cn</code> (known as ''Long Name''): | |||
/PBX0/ADMIN/mod_cmd_login.xml?cmd=submit-object&cn=MyObjectsLongName&h323=SomeChangedName&guid=* | |||
Latest revision as of 13:20, 20 June 2014
Starting with v6 a new Web User Interface has been implemented to configure the PBX. The same interface can be used by applications for configuration. The interface is based on the mechanism used by web forms. This means a string containing a list of named arguments is sent to the PBX and the PBX returns an XML document.
There are different ways to send the argument list to the PBX: HTTP GET, HTTP POST, SOAP.
Transport Methods
HTTP GET
The arguments are sent as part of the URL. The URL to be used has the following form:
<ip>/<PBX-Entity>/ADMIN/mod_cmd_login.xml?argument1=value1&argument2=value2&...
Example
192.168.0.1/PBX0/ADMIN/mod_cmd_login.xml?cmd=submit-object&cn=Test&e164=111&h323=test
HTTP POST
to be done
SOAP
to be done
mod cmd
The commands can also be sent via the command processor, which can be accessed with telnet or the update script or a '!' URL on the browser. The format of the command is in this case
!mod cmd <PBX-Entity>/ADMIN <command> /argument1 value1 /argument2 value2 ...
The first argument is implicitly cmd.
Example
!mod cmd PBX0/ADMIN submit-object /cn Test /e164 111 /h323 test
Arguments
In general the sequence of the arguments is not importent except in some cases in which a list of configuration items can be sent, with each item being described by multiple arguments.
cmd
The argument cmd is used to identify which command shall be executed. Depending on the argument cmd other arguments are available.
xsl
This argument is put as reference to an XSL file into the XML file returned.
guid
Hexstring containing the GUID of an object to be changed. This argument may be ommitted only if a new object shall be created. A value of * indicates that the argument cn shall be used to identify the object instead.
cn
The Long Name of an object. Used to identify an existing object if guid is set to *
cmd=submit-object
Used to create/change/delete objects.
| h323 | The name of the object |
| e164 | The number of the object |
| gi | Configures the group for which group indications are sent to the registered endpoints |
| rej-ext | If set to on, the Reject external Calls property is set |
| phone-config | If set to on, the PBX stores the config for phones registered to this object |
| pseudo | This argument defines the type of object to be set. If omitted a user object is created |
pseudo=waiting
...
cmd=submit-groups
Used to change group membership configuration of a user. With a single command the complete list of group memberships is sent, which replaces the existing list of group memberships.
A single group membership is configured with the following arguments in exactly this order. For multiple group memberships this can be repeated.
| grp-name | Name of the group |
| grp-active | If this argument is set to on the group membership is set to active |
| grp-dyn | If this argument is set to in, the group membership is dynamic with preset to be in the group, if this argument is set to out the group membership is dynamic with preset to be not in the group. If this argument is missing or empty, the group membership is static |
| grp-add | Marks the end of the group membership definition, must be present |
cmd=submit-forks
Used to change forking configuration of a user. With a single command the complete list of forking destinations is sent, which replaces the existing list of forking destinatios.
A single forking destination is configured with the following arguments in exactly this order. For multiple forking destinations this can be repeated.
| e164 | Forking destination number |
| h323 | Forking destination name |
| mobility | Long Name of a mobility object associated with this forking destination |
| hw | Device id used on SOAP to control calls with this forking destination |
| delay | Delay for calls sent out to the forking destination |
| fork | Indicates the end of the forking destination configuration |
Examples
Change an existing Object
The command submit-object can be used to change an existing PBX Object. If you already know the guid of the object, you can use it to refer to the desired object. Otherwise use guid=* and refer to the object by using cn (known as Long Name):
/PBX0/ADMIN/mod_cmd_login.xml?cmd=submit-object&cn=MyObjectsLongName&h323=SomeChangedName&guid=*