See also: Kamailio 3.0.x - DYK - Table of Content
SIMPLE Presence usage increases constantly over the past years, therefore the number of XML documents flowing around is bigger and bigger. The demand of routing this SIP traffic based on content is one of the reasons Kamailio 3.0.0 added new class of pseudo-variables in config file to help with XML processing:
If you get an XML document, say in a PUBLISH, like:
to get the status, then you can do:
<?xml version="1.0" encoding="UTF-8"?>
$xml(x=>doc) = $rb;You can change the content as well:
# specific handling for online status
$xml(x=>xpath:/presence/tuple/timestamp) = "2010-05-09T11:25:25Z";Practically you can do what any XPATH operation over the XML document.