[SR-Users] Check if xavp is set

Marrold kamailio at marrold.co.uk
Mon Apr 18 01:11:40 CEST 2016


Hi all,

What's the most efficient way to check if an xavp is set?

I have tried-

is_avp_set() from avpops module

which resulted in-

ERROR: avpops [avpops.c:915]: fixup_is_avp_set(): bad attribute name
<$xavp(tm_contacts)>

and

if ($xavp(tm_contacts)) {}

which resulted in -

WARNING: <core> [rvalue.c:1007]: rval_get_int(): automatic string to int
conversion for "<<xavp:0x7feac74cfcb8>>" failed

To give a little background, I am using the UAC_redirect module
and t_next_contacts() in conjunction with 302 redirects .However if there
is only a single contact, $xavp(tm_contacts) is not created and
t_next_contacts() fails, hence why I'd like to check if it exists first.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160418/9fcc9d2f/attachment.html>


More information about the sr-users mailing list