You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
1.4 KiB

######## Presence notify sync ########
## send notify sync back to kazoo
route[PRESENCE_LOCAL_NOTIFY]
{
if($rm != "NOTIFY") {
return;
}
$avp(notify_body) = $rb;
$avp(notify_event) = $hdr(Event);
t_on_reply("PRESENCE_NOTIFY_REPLY");
t_on_failure("PRESENCE_NOTIFY_FAULT");
}
onreply_route[PRESENCE_NOTIFY_REPLY]
{
$var(amqp_payload_request) = '{"Event-Category" : "presence", "Event-Name" : "notify", "Event-Package" : "$avp(notify_event)", "Call-ID" : "$ci", "From" : "$fu", "To" : "$tu", "Body" : "$(avp(notify_body){s.escape.common})", "Sequence" : $cs, "Reply" : $T_reply_code }';
$var(rk) = "notify." + $(td{kz.encode}) + "." + $(tU{kz.encode});
kazoo_publish("omnipresence", "$var(rk)", $var(amqp_payload_request));
xlog("L_INFO", "$ci|log|sent notify callback for event $avp(notify_event) : $tu\n");
}
onreply_route[PRESENCE_NOTIFY_FAULT]
{
$var(amqp_payload_request) = '{"Event-Category" : "presence", "Event-Name" : "notify", "Event-Package" : "$avp(notify_event)", "Call-ID" : "$ci", "From" : "$fu", "To" : "$tu", "Body" : "$(avp(notify_body){s.escape.common})", "Sequence" : $cs, "Reply" : $T_reply_code }';
$var(rk) = "notify." + $(td{kz.encode}) + "." + $(tU{kz.encode});
kazoo_publish("omnipresence", "$var(rk)", $var(amqp_payload_request));
xlog("L_INFO", "$ci|log|sent notify callback error $T_reply_code for event $avp(notify_event) : $tu\n");
}