HTTP API - Push Event: Difference between revisions

From Ultiroam User Docs
Jump to navigation Jump to search
No edit summary
Tag: 2017 source edit
 
No edit summary
 
Line 1: Line 1:
In the latest version, the gateway can push some events such as SMS, SMS sending results and SMS delivery status to your web server.
In the latest version, the gateway can push events such as SMS, SMS sending results and SMS delivery status to your web server.
[[File:HTTP API Push Event.png|none|thumb|594x594px]]
[[File:HTTP_API_Push_Event.png|right|670x670px]]
Once you selected push SMS, all SMS messages received by the gateway will be pushed to your web server.  
The URL of your web server must be specified in the configuration window.
 
Once you selected push SMS, all SMS messages received by the gateway will be pushed to your web server. The context of SMS pushing is very similar to the response of '''querying incoming sms'''.
The context of SMS pushing is very similar to the response of '''querying incoming sms'''.


{"sn":"xxxx-xxxx-xxxx-xxxx","sms":[{"incoming_sms_id":1,"port": 1,"number":"6717","smsc":"+8613800757511","timestamp":"2016-07
{"sn":"xxxx-xxxx-xxxx-xxxx","sms":[{"incoming_sms_id":1,"port": 1,"number":"6717","smsc":"+8613800757511","timestamp":"2016-07


-12 15:46:18","text":"test"}]}
-12 15:46:18","text":"test"}]}


The result of SMS pushing is similar to the response of '''Query Send SMS Result'''.
The result of SMS pushing is similar to the response of '''Query Send SMS Result'''.


{"sn":"xxxx-xxxx-xxxx-xxxx","sms_result":[{"port":1,"number":" 10086","time":"2016-07-12  
{"sn":"xxxx-xxxx-xxxx-xxxx","sms_result":[{"port":1,"number":" 10086","time":"2016-07-12 01:46:02","status":"DELIVERED","count":1,"succ_count":1,"ref_i d":215,"imsi":"460004642148063"}]}  
 
01:46:02","status":"DELIVERED","count":1,"succ_count":1,"ref_i d":215,"imsi":"460004642148063"}]}


'''SMS delivery status'''


{"sn":"xxxx-xxxx-xxxx-xxxx","sms_deliver_status":[{"port":1,"n umber":"10086","time":"2016-07-12
'''SMS delivery status:'''


15:46:53","ref_id":215,"status_code":0,"imsi":"460004642148063 "}]}
{"sn":"xxxx-xxxx-xxxx-xxxx","sms_deliver_status":[{"port":1,"n umber":"10086","time":"2016-07-1215:46:53","ref_id":215,


"status_code":0,"imsi":"460004642148063 "}]}


'''USSD'''
'''USSD:'''


{"sn":"xxxx-xxxx-xxxx-xxxx","ussd":[{"port":1,"text":"Thank  you!"}]}
{"sn":"xxxx-xxxx-xxxx-xxxx","ussd":[{"port":1,"text":"Thank  you!"}]}


 
'''SIM Register Status:'''
 
'''SIM Register Status'''


{"sn":"xxxx-xxxx-xxxx-xxxx","register":[{"port":8,"iccid":"8986 0040191844710023","imsi":"460004642148063","number":"1371463767
{"sn":"xxxx-xxxx-xxxx-xxxx","register":[{"port":8,"iccid":"8986 0040191844710023","imsi":"460004642148063","number":"1371463767


4","status":"up","sequence":2,"slot":2}]}
4","status":"up","sequence":2,"slot":2}]}{"sn":"xxxx-xxxx-xxxx-xxxx","register":[{"port":8,"iccid":"<NULL>","imsi":"<NULL>","number":"13714637674","status":"down","seq uence":1,"slot":2}]}


'''Note:''' Multi-SIM gateway will push SIM Register Status with “slot”.


{"sn":"xxxx-xxxx-xxxx-xxxx","register":[{"port":8,"iccid":"<NUL
L>","imsi":"<NULL>","number":"13714637674","status":"down","seq uence":1,"slot":2}]}
Note: Multi-SIM gateway will push SIM Register Status with “slot”.


'''CDR:'''
'''CDR:'''
Line 51: Line 42:


Note: Only answered call will be pushed. For All the CDR, please ues “get_cdr”
Note: Only answered call will be pushed. For All the CDR, please ues “get_cdr”


'''Device:'''
'''Device:'''


{"sn":"xxxx-xxxx-xxxx-xxxx","device":{"port_number":32,"IP":"1
{"sn":"xxxx-xxxx-xxxx-xxxx","device":{"port_number":32,"IP":"1<nowiki>72.18.55.142","MAC":"F8-A0-3D-48-E5-19","status":"power_off"}}</nowiki>
 
<nowiki>72.18.55.142","MAC":"F8-A0-3D-48-E5-19","status":"power_off"}}</nowiki>
 
{"sn":"xxxx-xxxx-xxxx-xxxx","device":{"port_number":32,"IP":"1
 
<nowiki>72.18.55.142","MAC":"F8-A0-3D-48-E5-19","status":"power_on"}}</nowiki>


{"sn":"xxxx-xxxx-xxxx-xxxx","device":{"port_number":32,"IP":"1<nowiki>72.18.55.142","MAC":"F8-A0-3D-48-E5-19","status":"power_on"}}</nowiki>




Line 67: Line 54:


<nowiki>{"sn":"xxxx-xxxx-xxxx-xxxx","exception_info":{"port":0,"type": "call_fail","action":"reset"}}</nowiki>
<nowiki>{"sn":"xxxx-xxxx-xxxx-xxxx","exception_info":{"port":0,"type": "call_fail","action":"reset"}}</nowiki>


'''<u>Note</u>''':Exception Event Handling should be enabled.
'''<u>Note</u>''':Exception Event Handling should be enabled.

Latest revision as of 16:07, 5 May 2024

In the latest version, the gateway can push events such as SMS, SMS sending results and SMS delivery status to your web server.

The URL of your web server must be specified in the configuration window. Once you selected push SMS, all SMS messages received by the gateway will be pushed to your web server. The context of SMS pushing is very similar to the response of querying incoming sms.

{"sn":"xxxx-xxxx-xxxx-xxxx","sms":[{"incoming_sms_id":1,"port": 1,"number":"6717","smsc":"+8613800757511","timestamp":"2016-07

-12 15:46:18","text":"test"}]}


The result of SMS pushing is similar to the response of Query Send SMS Result.

{"sn":"xxxx-xxxx-xxxx-xxxx","sms_result":[{"port":1,"number":" 10086","time":"2016-07-12 01:46:02","status":"DELIVERED","count":1,"succ_count":1,"ref_i d":215,"imsi":"460004642148063"}]}


SMS delivery status:

{"sn":"xxxx-xxxx-xxxx-xxxx","sms_deliver_status":[{"port":1,"n umber":"10086","time":"2016-07-1215:46:53","ref_id":215,

"status_code":0,"imsi":"460004642148063 "}]}

USSD:

{"sn":"xxxx-xxxx-xxxx-xxxx","ussd":[{"port":1,"text":"Thank  you!"}]}

SIM Register Status:

{"sn":"xxxx-xxxx-xxxx-xxxx","register":[{"port":8,"iccid":"8986 0040191844710023","imsi":"460004642148063","number":"1371463767

4","status":"up","sequence":2,"slot":2}]}{"sn":"xxxx-xxxx-xxxx-xxxx","register":[{"port":8,"iccid":"<NULL>","imsi":"<NULL>","number":"13714637674","status":"down","seq uence":1,"slot":2}]}

Note: Multi-SIM gateway will push SIM Register Status with “slot”.


CDR:

{"sn":"xxxx-xxxx-xxxx-xxxx","cdr":[{"port":2,"start_date":"201 5-07-21 16:35:20","answer_date":"2015-07-21

16:35:31","duration":3,"source_number":"1010","destination_num ber":"6717","direction":"ip->gsm","ip":"172.16.100.136","codec

":"G.711U","hangup":"called","gsm_code":16,"bcch":""}]}

Note: Only answered call will be pushed. For All the CDR, please ues “get_cdr”


Device:

{"sn":"xxxx-xxxx-xxxx-xxxx","device":{"port_number":32,"IP":"172.18.55.142","MAC":"F8-A0-3D-48-E5-19","status":"power_off"}}

{"sn":"xxxx-xxxx-xxxx-xxxx","device":{"port_number":32,"IP":"172.18.55.142","MAC":"F8-A0-3D-48-E5-19","status":"power_on"}}


Abnormal:

{"sn":"xxxx-xxxx-xxxx-xxxx","exception_info":{"port":0,"type": "call_fail","action":"reset"}}

Note:Exception Event Handling should be enabled.