====== SIPNOTIFY2REST ====== This server accepts SIP Notify messages and then converts them to a JSON packet and POSTS them to the defined URL. This server is a great option for those wanting to manage MWI via their own PBX interface or simply for MWI notifications to other 3rd party applications. ===== Requirements ===== * DV2000 8.0.21 or above. ===== Features ===== * HTTP and HTTPS supported. * JSON packet contains almost all of the SIP Notify packet. * URL can be any rout-able address. * Multiple servers can be configured if necessary. ===== Setup ===== This server is always disabled by default and must be manually configured. This server is never added to the list of servers on updates or upgrades and can be added manually. - Edit the server by double clicking on the it. - Edit the port number. This is typically always set to the default. - Add the URL to send the POST. ==== Arguments ==== ^ Argument ^ Description ^ | port | UDP port the server should listen on. Default is //6050//.| | url | Full URL to post data. Example: http://192.168.1.100/mwi | == Example == -port 4040 -url http://192.168.1.100 === URL Macros === The URL can accept two additional optional macros. These will be automatically replaced with the corresponding data and can be used for additional routing or for any purpose needed. These macros are case-sensitive. ^ Macro ^ Description ^ |{extension}|Replaced by extension number in SIP Notify packet.| |{onoff}|Replaced with the word //on// or //off//.| == Example == ^ URL ^ Result ^ | http://192.168.1.100/mwi/{extension}/{onoff} | http://192.168.1.100/mwi/3101/on | ===== Packet ===== The packet will be sent as a POST with the following data in JSON format. All fields are direct matches to the SIP Notify packet received. ^ Field ^ Description ^ | Contact | Contact header field. | | Date | Date header field. | | To | To header field. | | From | From header field. | | Voice-Message | SIP Notify header | | Message-Account | SIP Notify header | | Messages-Waiting | SIP Notify header | | P-DV-VoiceChannel | Channel performing the MWI notification. | | P-DV-Version | Version of the DV2000 | | on | true if light should be on, otherwise false. | ==== Example ==== === URL Argument === -url http://127.0.0.1:8080/vs/mwi/{extension} === POST === POST /vs/mwi/711003 HTTP/1.1 Date: 2023-09-12T17:11:00Z User-Agent: DuVoice/8.0.20 Content-Type: application/json Content-Length: 366 Connection: Close Host: 127.0.0.1:8080 {"Contact":"","From":";tag=45caefba-721524bb-544c0-44ab738-6464a8c0-13c4-764","Message-Account":"sip:711003@192.168.100.100:6050","Messages-Waiting":"yes","P-DV-Version":"8.0.20","P-DV-VoiceChannel":"23","To":"","Voice-Message":"1/0(0/0)","extension":"711003","on":true} == JSON Data == { "Contact": "", "From": ";tag=45caefba-721524bb-544c0-44ab738-6464a8c0-13c4-764", "Message-Account": "sip:711003@192.168.100.100:6050", "Messages-Waiting": "yes", "P-DV-Version": "8.0.20", "P-DV-VoiceChannel": "23", "To": "", "Voice-Message": "1/0(0/0)", "extension": "711003", "on": true }