IF you have a multi-part body, shouldn't this do the trick:

$xml(bla) = $rb(application/im-iscomposing+xml);

[1] https://opensips.org/Documentation/Script-CoreVar-3-6#rb


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
  https://www.siphub.com


On 5/11/26 18:40, Robert Dyck wrote:
I don't think that $xml() can be made to work. The first parameter for $xml()
is the name of an xml object. This would work for the xml we create ourself
with xml module. How would we extract an xml and name it.

I thought about using the content type as a filter. This was problematic
because MESSAGE ( RFC 3248 page mode ) allows SIP headers in the body. We
receive two Content-Type headers. I tried using $cT[index] but the second
Content-Type is never found. Using any index always just returns the first
instance.

I tried using sipmsgops has_body_part( mime ). This doesn't work for the same
reason filtering the content type didn't work. This function uses the content
type as the first step in its filter. It will never find "Content-Type:
application/im-iscomposing+xml".

I can keep the xml from being stored in the silo by filtering on "Content-Type
message/cpim" but I am not happy with it. It is not specific enough and may
cause issues.

On Thursday, May 7, 2026 1:36:49 a.m. Pacific Daylight Time you wrote:
if you have $xml(bla) = "....some xml....";

Try like $xml(bla/isComposing.attr/xmlns)

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
    https://www.opensips-solutions.com
    https://www.siphub.com

On 5/6/26 22:19, Robert Dyck wrote:
I am trying to understand $xml() and added some logging to the script.

I know the contents of the xml doc.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<isComposing xmlns="urn:ietf:params:xml:ns:im-iscomposing">

<state>active</state>

<contenttype>text/plain</contenttype>

<refresh>60</refresh>

  </isComposing>'


Using statements such as "xlog("xlm is $xml(?xml/isComposing)\n");"

I get DBG:xml:pv_get_xml: Unknown object <?xml>
The same if I ignore the version element and try "isComposing".

It says Unknown object <isComposing>


Printing the entire $xml doesn't work.

BG:core:parse_headers_aux: flags=ffffffffffffffff
[266B blob data]

On Wednesday, May 6, 2026 1:08:11 a.m. Pacific Daylight Time you wrote:
According to the grammar [1], you have access to the attributes:



access = .val | .attr/string | .attr/$var



An example:



$xml(my_doc/doc/list.attr/sort) = "asc";              # add
attribute "sort"

to list node





[1] https://opensips.org/docs/modules/3.6.x/xml.html#pv_xml



Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

https://www.opensips-solutions.com

https://www.siphub.com

On 5/4/26 17:31, Robert Dyck wrote:
Yes.

Or perhaps just detect the the presence of xlm. It should not go
into the

silo.

On Monday, May 4, 2026 6:48:50 a.m. Pacific Daylight Time you wrote:
You mean the xmlns attribute of the isComposing node ?



Regards,



Bogdan-Andrei Iancu



OpenSIPS Founder and Developer



https://www.opensips-solutions.com

https://www.siphub.com

On 4/27/26 19:21, Robert Dyck wrote:
I have looked at the module and it is not clear to me how one would

extract the name space from the xml.





<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<isComposing xmlns="urn:ietf:params:xml:ns:im-iscomposing">

         <state>active</state>

<contenttype>text/plain</contenttype>

         <refresh>60</refresh>

</isComposing>'

   _______________________________________________

Users mailing list



[email protected]



http://lists.opensips.org/cgi-bin/mailman/listinfo/users
On Monday, April 27, 2026 7:31:14 a.m. Pacific Daylight Time you
wrote:
Robert,







Check thishttps://opensips.org/docs/modules/3.6.x/xml.html







Regards,







Bogdan-Andrei Iancu







OpenSIPS Founder and Developer



https://www.opensips-solutions.com



https://www.siphub.com





_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to