From ushacked@gmail.com Sun Aug 12 13:51:02 2012 From: Uri Shacked To: sr-users@lists.kamailio.org Subject: [SR-Users] $avp reset to with no reason? Date: Sun, 12 Aug 2012 14:50:55 +0300 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0653402561==" --===============0653402561== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Hi,**** ** ** I encountered a problem. While doing some avp's settings I notice that one avp that I use is changing to without me doing anything.**** ** ** Here is the part of the cfg file:**** ………….**** ………….**** Route[SET]{**** …………..**** $avp(Sfeaturetype)=$avp(next_feature_type);**** …………**** Route(DIDSRV);**** }**** ** ** route[DIDSRV] {**** xlog("L_CRIT","$C(rg) SCRIPT: in DIDSRV type = $avp(Sfeaturetype), index = $avp(SfeatureIndx) $C(xx)\n");**** if($var(srvcount)>3){**** xlog("L_NOTICE","$C(rg)Too many services loops $C(xx)\n");**** update_stat("nts_subs_srv_loop", "+1");**** $avp(TRMCS)="10";**** t_reply(403,"too many loops");**** exit;**** }**** $var(srvcount)=($var(srvcount)+1);**** xlog("L_CRIT","$C(rg) SCRIPT: in DIDSRV before switch to $avp(SfeatureType) or $avp(next_feature_type) $C(xx)\n");**** switch ($avp(SfeatureType)){**** case "0" :**** ……….**** ………**** ** ** On the route "SET" I put the value from the $avp(next_feature_type) in $avp(Sfeaturetype).**** After that I call the route "DIDSRV" and use switch($avp(Sfeaturetype)). Before the switch I xlog the value of the avp twice.**** As you can see in the log below, on the first xlog print, the value is 0 (as I expect). On the second print it resets to **** WHY?**** ** ** Log:**** Aug 12 13:38:50 net-ivr-KamIN-Test kamailio[29309]: [mem/q_malloc.c:413]: qm_malloc(0x7fe6f9aff000, 72) returns address 0x7fe6fcc4d330 frag. 0x7fe6fcc4d300 (size=72) on 1 -th hit**** Aug 12 13:38:50 net-ivr-KamIN-Test kamailio[29309]: CRITICAL: