From miconda@gmail.com Tue Nov 29 09:11:15 2016 From: Daniel-Constantin Mierla To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] XAVP Null Date: Tue, 29 Nov 2016 09:11:07 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1997663601==" --===============1997663601== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Some extra details and examples, hopefully for better clarification of new people dealing with xavps. To add an xavp, you must not use an index, like Alberto wrote: $xavp(caller_peer=>accountname) = "Account Variable"; /*This is an example to add a value in an xavp */ Then to add an extra xavp inside the first root avp use index for the first name: $xavp(caller_peer[0]=>accountname) = "AAA"; To overwrite first value in the first root xavp: $xavp(caller_peer[0]=>accountname[0]) = "NEW AAA"; To overwrite first value in the first root xavp: $xavp(caller_peer[0]=>accountname[1]) = "ABC"; Just have in mind, that when using an index it's about overwriting a previous value of an existing xavp, not adding a new xavp. Cheers, Daniel On 28/11/2016 18:40, Alberto Llamas wrote: > Hello Linux, > > Each xavp has a name and name values. So if you first define the name > of the variable then you assign the name value it will work for you: > > $xavp(caller_peer=>accountname) = "Account Variable"; */*This is an > example*/* > $xavp(caller_peer[0]=>accountname) = "AAA"; > xlog("L_WARN", "XAVP ACCOUNT NAME $xavp(caller_peer[0]=>accountname) \n"); > > > Regards, > > On Mon, Nov 28, 2016 at 5:55 PM, Linux Vince > wrote: > > Hi, > > I am sure i am doing something very basic wrongly. > > Here is my config file snippet > > $xavp(caller_peer[0]=>accountname) = "AAA"; > xlog("L_WARN", "XAVP ACCOUNT NAME > $xavp(caller_peer[0]=>accountname) \n"); > > No matter what i set this XAVP at, it always prints null in log > file as below > > WARNING: