[Kamailio-Users] [sr-dev] new feature: fine access to xml documents

Daniel-Constantin Mierla miconda at gmail.com
Mon Jun 29 20:33:14 CEST 2009



On 06/25/2009 04:13 PM, Klaus Darilion wrote:
>
>
> Iñaki Baz Castillo schrieb:
>> El Jueves, 25 de Junio de 2009, Daniel-Constantin Mierla escribió:
>>> Probably not very clear in my first email, but you can change the xml
>>> content:
>>>
>>> $xml(a=>xpath:/presence/mynode) = "123";
>>
>> When reading, which is the result if the node doesn't exist? empty 
>> string?
>> If a=>xpath:/presence/mynode gets 123 (an integer) can it be used in 
>> math operation as integer? or is it a string?
>>
>>  
>>> Note that if you assigned the sip message body to $xml(name=>doc), body
>>> does not get changed, the operations are done on a replica.
>>
>> So modifications in the body must be done in the proxy before 
>> forwarding the request to the presence server, or doing a spiral if 
>> the presence server is integrated in the proxy, right?
>
> Hi Daniel!
>
> In sip-router there is functionality to apply lumps before sending (it 
> is used for SIP-Identity). Maybe this could be exported to script and 
> can be executed manually to triggering reconstruction of the message, 
> e.g. for processing the modified message in the presence module.
it does not work now directly on msg body, but your approach can get 
life using set_body() from textops.

Applying lumps would be good to add as experimental function in config, 
to see how much it affects the rest.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://www.asipto.com/





More information about the sr-users mailing list