Configuring HTTP POST Web Service
You can use HTTP POST messages to simply notify an HTTP server about a call, and use HTTP POST messages for querying information like HTTP GET messages. The example provided in this section describes how to configure the device to send HTTP POSTs to notify an HTTP server of incoming 911 calls. You need to configure a Remote Web Service to represent the HTTP server (IP address 52.7.189.10). You also need to configure Call Setup Rules that instruct the device to send an HTTP POST message, containing the 911 caller's user name and host name, to the server (at path /path/query/notify-emergency-call) if a 911 call is received.
|
➢
|
To configure an HTTP POST notification operation:
|
|
1.
|
Open the Remote Web Services table, and then configure a Remote Web Service for the HTTP server: |
|
2.
|
Open the HTTP Remote Hosts table of the Remote Web Service that you configured in Step 1, and then configure the following: |
|
3.
|
Open the Call Setup Rules table, and then configure the following rules (Rule Set ID 1):
|
|
●
|
If the destination number of the incoming call is not 911, then don't process these Call Setup Rules: |
|
◆
|
'Condition': Param.Call.Dst.User != '911' |
|
●
|
Set the Content-Type header in the HTTP POST message to the value "application/json": |
|
◆
|
'Action Subject': HTTP.Request.Content-Type |
|
◆
|
'Action Value': 'application/json' |
|
●
|
Add JSON parameters to the body of the HTTP POST message so that it includes the 911 caller's (source) number and host name: |
|
◆
|
'Action Subject': HTTP.Request.Body
|
|
◆
|
'Action Value': '{ "user": "'+Param.Call.Src.User+'", "host": "'+Param.Call.Src.Host+'" }'
|
|
●
|
Send the HTTP POST message to the specified server and folder path: |
|
◆
|
'Request Type': HTTP POST Notification |
|
◆
|
'Request Target': MyHTTP
|
|
◆
|
'Request Key': '/path/query/notify-emergency-call' |
|
4.
|
Assign your Call Setup Rules (i.e., Rule Set ID 1) to the relevant SIP Interface (for example).
|
An example of the HTTP and SIP messages of the above configuration is shown below:
|
1.
|
Incoming SIP message from 911 caller:
|
INVITE sip:911@10.7.7.246;user=phone SIP/2.0
Via: SIP/2.0/UDP 10.7.2.15;branch=z9hG4bKLRGQTOQHILSSMGAQJQSU
From: <sip: 15551234567@10.7.2.15;user=phone>;tag=RJFNXMKDOHELDUMEWWGH
To: <sip:911@10.7.7.246;user=phone>
Call-ID: UBBKFKBCXFPESMYOPDTB@10.7.2.15
CSeq: 1 INVITE
Contact: <sip:1000@10.7.2.15>
Supported: em,100rel,timer,replaces
Allow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE
User-Agent: Sip Message Generator V1.0.0.5
|
2.
|
Outgoing HTTP POST message notifying server of 911 call:
|
Header=POST /path/query/notify-emergency-call HTTP/1.1
Content-Type: application/json
Host: 52.7.189.114
Connection: keep-alive
Content-Length: 47
Cache-Control: no-cache
User-Agent: 1
{ "user": "15551234567", "host": "10.7.2.15" }