Dear friends,
When a sip 4rU is entering my kamailio script I'm cutting down the prefix of this customer and added to a script variable. In the same same route after i do some checks then i add back the customer prefix which I had kept in the script variable. The problem: Some times the call goes to failure Route for rerouting and then i try to add the prefix again but the is empty.
How can I transfer a variable from route to route and be a unique variable for each call?
Thank you Alex
Alex,
Maybe you should use AVPs instead of vars.
Remember you always have the original request-URI username in $oU.
Cheers, Uriel
On Thu, Jan 21, 2010 at 9:10 AM, alex pappas rebel.pappas@gmail.com wrote:
Dear friends,
When a sip 4rU is entering my kamailio script I'm cutting down the prefix of this customer and added to a script variable. In the same same route after i do some checks then i add back the customer prefix which I had kept in the script variable. The problem: Some times the call goes to failure Route for rerouting and then i try to add the prefix again but the is empty.
How can I transfer a variable from route to route and be a unique variable for each call?
Thank you Alex
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
Thank you Uriel,
With Avp it works!
Cheers Alex
On Thu, Jan 21, 2010 at 2:28 PM, Uriel Rozenbaum uriel.rozenbaum@gmail.comwrote:
Alex,
Maybe you should use AVPs instead of vars.
Remember you always have the original request-URI username in $oU.
Cheers, Uriel
On Thu, Jan 21, 2010 at 9:10 AM, alex pappas rebel.pappas@gmail.comwrote:
Dear friends,
When a sip 4rU is entering my kamailio script I'm cutting down the prefix of this customer and added to a script variable. In the same same route after i do some checks then i add back the customer prefix which I had kept in the script variable. The problem: Some times the call goes to failure Route for rerouting and then i try to add the prefix again but the is empty.
How can I transfer a variable from route to route and be a unique variable for each call?
Thank you Alex
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
On 01/21/2010 08:22 AM, alex pappas wrote:
With Avp it works!
Yep. Remember that AVPs are transaction-persistent (including across multiple routes that can be called in the course of servicing that transaction), while user variables ($var(...)) are request/route-specific.
Alex Balashov schrieb:
On 01/21/2010 08:22 AM, alex pappas wrote:
With Avp it works!
Yep. Remember that AVPs are transaction-persistent (including across multiple routes that can be called in the course of servicing that transaction), while user variables ($var(...)) are request/route-specific.
Small addition: with kamailio3.0 you always have the AVPs also in the reply routes, with kamailio1.5 you have can configure in tm module of AVPs should be restored in reply-route too.
klaus
On 1/21/10 7:27 PM, Klaus Darilion wrote:
Alex Balashov schrieb:
On 01/21/2010 08:22 AM, alex pappas wrote:
With Avp it works!
Yep. Remember that AVPs are transaction-persistent (including across multiple routes that can be called in the course of servicing that transaction), while user variables ($var(...)) are request/route-specific.
Small addition: with kamailio3.0 you always have the AVPs also in the reply routes, with kamailio1.5 you have can configure in tm module of AVPs should be restored in reply-route too.
And another addition: beware that you have several lists, including global AVPs (not tied to transaction) if the name is string starting with "g.": http://sip-router.org/wiki/devel/avps-ser
I think we should document it better somewhere. $xy.name in ser is equivalent to $avp(xy.name) in K. If xy. is missing, the is same as 'f.'. So K avps are going in the from list (f).
Daniel