[SR-Users] [sr-dev] registered4() is not adding xavp with details of the record

Luis Azedo luis at 2600hz.com
Thu Sep 3 13:47:50 CEST 2015


Hi,

it seems the doc is wrong.
what it does is to fill the xavp_contact from the matched contact

here's how i work with it.

modparam("usrloc", "xavp_contact", "ulattrs")

   if (registered("location","$ru", 0, 1)) {
      append_hf("X-Account-ID: $(xavp(ulattrs=>Account-ID)\r\n");
      append_hf("X-Authorizing-Type: $(xavp(ulattrs=>Authorizing-Type)\r\n");
   }

but maybe it should be filling xavp_rcd , but how would we access the contact xavp_contact ?

________________________________________
From: sr-dev [sr-dev-bounces at lists.sip-router.org] on behalf of Andrew Pogrebennyk [apogrebennyk at sipwise.com]
Sent: Thursday, September 03, 2015 3:04 AM
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List; Development mailing list of the sip-router project
Subject: [sr-dev] registered4() is not adding xavp with details of the record

Hi,
I was trying to use registered("location", "$ru", 0, 1)
Last parameter is the flag according to
http://kamailio.org/docs/modules/stable/modules/registrar.html#registrar.f.registered

flag values is as follows:
    1 - set xavp_rcd with value from matched contact

But I'm getting NULL instead of ruid.. While the same works after
lookup("location").

So I took a quick look into the code and that confirms that registered4
does not add the xavp with details of the record (ruid), i.e. it does
not do what the lookup_helper does.

Is this done on purpose or an oversight? While fixing this it might be
reasonable to introduce a new function for setting the XAVPs and call it
from lookup and registered4 functions, especially since we are going to
extend the attributes list beyond just ruid, but right now I'm
struggling just to understanding how the XAVP should be built.. Ideas?

Thanks,
Andrew

_______________________________________________
sr-dev mailing list
sr-dev at lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev



More information about the sr-users mailing list