Hello, are you using kamailio 3.1.x? If not, you have to upgrade, the $branch(...) variable was updated to be writable starting with this version.
I played last week with it in a need of combining serial forking with parallel forking and all is ok with assigning values to $branch(...). Cheers, Daniel On 3/14/11 5:25 AM, 侯旭光 wrote: > sorry to bother again > > > $(branch(q)[-1]) = $var(q); > > this script line doesn't work and the pv $branch() aren't > writable,just readable . index -1 is not accessable either. > > if append_branch() function doesn't take the q value parameter,the > $branch(q) just return NULL (which I think is the default value > Q_UNSPECFIED=-1) > > I find a function set_ruri_q() in dset.c but I don't know how to call > it in the configure file. > > > 2011/2/23 Daniel-Constantin Mierla <mico...@gmail.com>: >> Hello, >> >> On 2/21/11 10:28 AM, 侯旭光 wrote: >> >> Hello >> I need to add q value while using function append_branch(),but the function >> only takes decimal fraction as the parameter. >> What if I want to use pv to add q value? >> The $var and $avp just have string and integer type. >> Thanks a lot! >> >> do: >> >> km_append_branch("$var(branchuri)"); >> $(branch(q)[-1]) = $var(q); >> >> $var(q) has to hold an integer value that represents the decimal fraction >> value multiplied with 100 (so if q should be 0.5, then $var(q) = 50). >> >> Cheers, >> Daniel >> >> -- >> Daniel-Constantin Mierla >> http://www.asipto.com > _______________________________________________ > 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 _______________________________________________ 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