this module adds a new function json_pua_publish() which allows json data objects to be parsed and inserted into the presentity table.
the function is borrowed from the nsq and kazoo modules. it allows presence to be controlled without loading the nsq or kazoo modules.
this can be quite powerful as it will allow users to control presence by sending http json data objects to kamailio, for example:

event_route[xhttp:request] {
    $var(call-id) = $(rb{json.parse,Call-ID});
    if ($(rb{json.parse,Event-Package}) == "dialog") {
            json_pua_publish($rb);
            pres_refresh_watchers("$(rb{json.parse,From})", "$(rb{json.parse,Event-Package})", 1);
    }
    xhttp_reply("200", "OK", "text/html", "$rb");
}

example curl request to send presence update:

curl -d '{"Call-ID":"user01@my.domain.io","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"3600","From":"sip:user01@my.domain.io","From-User":"user01","From-Realm":"my.domain.io","To":"sip:park+6003@my.domain.io","To-User":"park+6003","To-Realm":"my.domain.io","State":"confirmed"}' http://localhost:8080/presence/

You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/1408

Commit Summary

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.