Hello,

$var(...) are variables with the value stored in private memory for each process, while accounting write event can happen in a different process than the one where you set the variable.

You have to use $avp(...) instead of $var(...).

Cheers,
Daniel

On 5/4/12 5:08 PM, Gary Chen wrote:

I using Mysql DB.

I need to add extra fields in acc table. The field having problem is the last one ‘account’

Here is my code in kamailio.cfg:
...
modparam("acc",
"db_extra",  
"src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;user_agent=$hdr(User-Agent);account=$var(s:account_number)")
...

route {

....

dp_translate("3", "$fU/$avp(s:dst)")
$v(s:account_number) = $avp(s:dst);

....
}

By
looking at the xlog message, $v(s:account_number) has correct value.
But the value in acc table is not always correct. Sometime account field
populated with 0 and sometime it populated with wrong account number.
It seems that $v(s:account_number) sometime corrupted.

Am I doing something wrong?

Gary

 



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda