Browse code

kazoo: fixed json body in example

Sergey Safarov authored on 16/09/2021 07:35:14 • Daniel-Constantin Mierla committed on 21/09/2021 18:56:55
Showing 1 changed files
... ...
@@ -624,7 +624,7 @@ modparam("kazoo", "pua_mode", 0)
624 624
         <title><function>kazoo_publish</function> usage</title>
625 625
         <programlisting format="linespecific">
626 626
 ...
627
-$var(amqp_payload_request) = "{'Event-Category' : 'directory', 'Event-Name' : 'reg_success', 'Contact' : '" + $var(fs_contact) + "', 'Call-ID' : '" + $ci + "', 'Realm' : '" + $fd +"', 'Username' : '" + $fU + "', 'From-User' : '" + $fU + "', 'From-Host' : '" + $fd + "', 'To-User' : '" + $tU +"', 'To-Host' : '" + $td + "', 'User-Agent' : '" + $ua +"' ," + $var(register_contants)+ " }";
627
+$var(amqp_payload_request) = $_s({"Event-Category" : "directory", "Event-Name" : "reg_success", "Contact" : "$(ct{s.escape.common}{s.replace,\','}{s.replace,$$,})", "Call-ID" : "$ci", "Realm" : "$fd", "Username" : "$fU", "From-User" : "$fU", "From-Host" : "$fd", "To-User" : "$tU", "To-Host" : "$td", "User-Agent" : "$(ua{s.escape.common}{s.replace,\','}{s.replace,$$,})" });
628 628
 $var(amqp_routing_key) = "registration.success." + $(fd{kz.encode}) + "." + $fU;
629 629
 kazoo_publish("callmgr", $var(amqp_routing_key), $var(amqp_payload_request)); 
630 630
 ...