Hello,
Seems, there is a need to specify xmlns forcefully
As it's working when I do
$var(body) = $(rb{s.rm,xmlns="urn:ietf:params:xml:ns:dialog-info"});
So, I do need or to specify namespace or to remove this line from XML.
But if someone can comment on this (cause XML is a world on it's own)
I'd be really grateful.
Regards,
Igor
Le 10.02.2022 à 16:25, Igor Olhovskiy a écrit :
Hello
Just to add, when I'm trying to dump $rb to logs, I'm getting this line
<?xml version="1.0"?>#012<dialog-info
xmlns="urn:ietf:params:xml:ns:dialog-info" version="0"
state="full" entity="sip:88881@dev.company">#012 <dialog
id="f-XGMVyeO0" direction="recipient">#012
<state>terminated</state>#012 </dialog>#012</dialog-info>
So, I expect problem is in this #012 + extra spaces. Is there a way to
clean it up in an easy way?
Regards,
Igor
Le 10.02.2022 à 16:01, Igor Olhovskiy a écrit :
>
> Hello,
>
> I'm trying to get state of endpoint from PUBLISH message in a most
> simple way using xmlops module
>
> Trying to make this
>
> $xml(body=>doc) = $rb;
> log("L_ERR", "$rU is now in state
$xml(body=>xpath:/dialog-info/dialog/state)\n");
>
> XML in PUBLISH itself
>
> <?xml version="1.0"?>
> <dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info"
version="0" state="full" entity="sip:88881@dev.company">
> <dialog id="v6qmEYf5yI" direction="initiator">
> <state>confirmed</state>
> </dialog>
> </dialog-info>
>
>
> Actual text in log is
>
> ... <script>: 88881 is now in state
>
> Means it's empty. xmlops module is loaded with no parameters. Tried
> also string
>
> $xml(body=>xpath:/dialog-info/dialog/state/text())
>
> -> same result
>
> What am I missing here?
>
> kamailio 5.4.6
>
> --
> Thanks in advance,
> Igor