[SR-Users] 302 rewrite ruri based on contact
Omar
omar at 321communications.com
Wed Jun 15 02:04:08 CEST 2011
what other option can i use for the following scenario
In Kamailio 1.4.3
I have the following scenario:
$var(a) = 0
$var(b) = 0
$var(a) = $(tU{s.len});
$var(b) = $var(a) - 5;
xlog(" $var(b)");
$var(a) is 8
the result $var(b) is always the same as $var(a)
I used cfgutils to initialize the variables as integer
and nothing works.
if i use AVP
$avp(i:a) = $(tU{s.len}); i got an errors showing the a name is not correct, and does not contain a number !
s.len is a number right?
regards
O
On Jun 8, 2011, at 9:15 AM, Ovidiu Sas wrote:
> $var are script variables (read more here):
> http://www.kamailio.org/dokuwiki/doku.php/pseudovariables:1.4.x#script_variables
> Best thing to do is to initialize the variable every time before using it.
> The variable is not transaction or call persistent (it's scope is in
> context of the message being processed).
>
> $avp may be transaction persistent (enable it in tm):
> http://www.kamailio.org/dokuwiki/doku.php/pseudovariables:1.4.x#avps
> http://www.kamailio.org/docs/modules/1.4.x/tm.html#id2530425
>
>
> Regards,
> Ovidiu Sas
>
>
> On Wed, Jun 8, 2011 at 7:10 AM, Omar <omar at 321communications.com> wrote:
>> Do i have to clear the variable in $var everytime a call ends a Bye or cancels, or the variable will clear it up automatically in Kamailio1.4.3? i think this acts as a vector, but i have some doubt regarding
>>
>> $avp i think uses shared memory, then i have to take care to reserve enough memory for it in the shared memory right?
>>
>>
>> thanks
>>
>> O
>>
>>
>> On May 24, 2011, at 6:58 PM, Ovidiu Sas wrote:
>>
>>> Here's an example on how to perform forking on failure on 1.4:
>>> https://openser.svn.sourceforge.net/svnroot/openser/branches/1.4/examples/serial_183.cfg
>>>
>>>
>>> Regards,
>>> Ovidiu Sas
>>>
>>> On Tue, May 24, 2011 at 4:30 PM, Omar <omar at 321communications.com> wrote:
>>>>
>>>> I need to rewrite the destination after I receive 302
>>>> I have this logic
>>>>
>>>> Onreply
>>>> Loads in avp the information needed
>>>>
>>>> I try sending to failure route and to a route in both cases the $ru become <null>
>>>>
>>>> In the route and failureroute
>>>> I did try rewritehost, rewriteuri, $ru= number+ host
>>>> And append the route
>>>> But $ru is always null.
>>>> Inside the route or failure route
>>>>
>>>> If there are no 302 nor the onreply involved everything works fine
>>>>
>>>> Any suggestion to rewrite the ruri after a 302 is welcome
>>>>
>>>> I am still using Kamailo1.4.3
>>>>
>>>>
>>>> Omar
>>>> _______________________________________________
>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>>> sr-users at lists.sip-router.org
>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>>
>>>
>>> _______________________________________________
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>> sr-users at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
More information about the sr-users
mailing list