OZEKI Phone System - HTTP GET and HTTP POST

In this section you can learn the correct form of HTTP requests and HTTP responses. You can also learn both kind of requests (GET, POST). You can read examples of these sent from a browser.

HTTP requests sent to the OZEKI Phone System XE:

You can send HTTP GET or HTTP POST requests. Both are accepted by the phone system. We will use the Call command as an example.

Here you can see a HTTP example using the HTTP GET request:

GET /?command=Call&dialed=103&apiextension=9986 HTTP/1.1
Host: localhost:7780
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: hu-hu,hu;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
	

You can see that the 1st row contains the parameters of the command (command, dialed, apiextension).

Here you can see the HTTP response from the phone system to the HTTP GET request:

HTTP/1.1 200 OK
Content-Length: 263
Content-Type: application/xml
Server: Microsoft-HTTPAPI/2.0
Date: Thu, 04 Jul 2013 05:38:24 GMT

<?xml version="1.0"?>
<Response xmlns:xsd="http://www.w3.org/XMLSchema" xmlns:xsi="http://www.w3.org/XMLSchema-instance">
<Code>401</Code>
<Message>API extension '9986' unavailable, please check configuration or permissions</Message>
</Response>
	

Here you can see a HTTP example using the HTTP POST request:

POST /ozml_example/call_changed.php HTTP/1.0
Content-Type: application/x-www-form-urlencoded
Host: localhost
Cache-Control: no-store,no-cache
Pragma: no-cache
Content-Length: 41

command=Call&dialed=103&apiextension=9990
	

You can see that the last row contains the command parameters (command, dialed, apiextension).

Here you can see the HTTP response from the phone system to the HTTP POST request:

HTTP/1.1 200 OK
Content-Length: 263
Content-Type: application/xml
Server: Microsoft-HTTPAPI/2.0
Date: Thu, 04 Jul 2013 05:38:24 GMT

<?xml version="1.0"?>
<Response xmlns:xsd="http://www.w3.org/XMLSchema" xmlns:xsi="http://www.w3.org/XMLSchema-instance">
<Code>200</Code>
<Message>Command successfully executed</Message>
</Response>
	

A HTTP request sent from the OZEKI Phone System:

Requests sent from the phone system are called notifications, notifications will be sent as HTTP POST requests. In this example we receive a CallChanged notification from the phone system

Here you can see a HTTP request (notification) example using the HTTP POST request:

POST /ozml_example/call_changed.php HTTP/1.0
Content-Type: application/x-www-form-urlencoded
Host: localhost
Cache-Control: no-store,no-cache
Pragma: no-cache
Content-Length: 65

CallState=Ringing&CallId=3CiHe&Caller=103&CallerId=103&Callee=101
	

Here you can see the HTTP response to the HTTP POST request:

(The response are made in OZML (Ozeki XML))

HTTP/1.1 200 OK
Date: Thu, 04 Jul 2013 05:49:36 GMT
Server: Apache/2.2.22 (Win32) PHP/5.4.3
X-Powered-By: PHP/5.4.3
Content-Length: 64
Connection: close
Content-Type: text/html

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Forward CallId="3CiHe" Destination="500"></Forward>
</Response>
	

More information