i have not been able to figure out, how to give integer avp name in a pseudo variable. test
$var(name) = "i:1000"; $avp($var(name)) = "value"; xlog("L_INFO", "avp i:1000 has value <$avp(i:1000)>\n"); xlog("L_INFO", "avp s:i1000 has value <$avp(s:i:1000)>\n");
produces to syslog
Nov 8 13:17:23 sip /usr/sbin/sip-proxy[8642]: INFO: avp i:1000 has value <<null>> Nov 8 13:17:23 sip /usr/sbin/sip-proxy[8642]: INFO: avp s:i1000 has value <value>
that is, $var(name) value i:1000 is interpreted as string name even when its syntax conforms to integer name.
is this is a bug or how should value of $var(name) look like?
-- juha
answering to myself, the solution is to assign integer value to $var(name). test
$var(name) = 1000; $avp($var(name)) = "value"; xlog("L_INFO", "avp i:1000 has value <$avp(i:1000)>\n"); xlog("L_INFO", "avp s:i1000 has value <$avp(s:i:1000)>\n");
produces to syslog
Nov 8 13:26:25 sip /usr/sbin/sip-proxy[8980]: INFO: avp i:1000 has value <value> Nov 8 13:26:25 sip /usr/sbin/sip-proxy[8980]: INFO: avp s:i1000 has value <<null>>
i didn't find this documented anywhere. should it be added to pv wiki page or is it too obvious?
-- juha
Hello,
On 11/8/11 12:29 PM, Juha Heinanen wrote:
answering to myself, the solution is to assign integer value to $var(name). test
$var(name) = 1000; $avp($var(name)) = "value"; xlog("L_INFO", "avp i:1000 has value<$avp(i:1000)>\n"); xlog("L_INFO", "avp s:i1000 has value<$avp(s:i:1000)>\n");
produces to syslog
Nov 8 13:26:25 sip /usr/sbin/sip-proxy[8980]: INFO: avp i:1000 has value<value> Nov 8 13:26:25 sip /usr/sbin/sip-proxy[8980]: INFO: avp s:i1000 has value<<null>>
i didn't find this documented anywhere. should it be added to pv wiki page or is it too obvious?
go ahead and add notes about it -- any improvement to documentation is welcome and always good, no matter how obvious the information is for some people or not Thanks, Daniel
Daniel-Constantin Mierla writes:
go ahead and add notes about it -- any improvement to documentation is welcome and always good, no matter how obvious the information is for some people or not.
i added in pv doc third (pseudo variable) option for avp id.
i'm a bit confused about the two wiki sites: kamailio and sip-router one. on k wiki, devel pseudo variable link points to sip-router site, but 3.2.x pv link points to k site. if i then loop at sr wiki site, it seems to be out of date.
if no-one is willing to maintain sr site, should be just make it point to k site? an out-of-date site is not good for the reputation of the project.
-- juha