<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hi Nick,<br><br>Thanks for the replying.<br><br>It's working for the first INVITE but it's giving the null value for any subsequent requests! I will post part of the script:<br><br>The scenario is the following:<br>1 - User A register and I store the value of the header from the 200OK response of the REGISTER.<br>2 - User A make a call, I retrieve the previously stored value from the cache and append it to the INVITE.<br>3 - Until now the call is successfully established.<br>4 - User A attempt a second call (after hanging the first) and before the cache expiration time, it sends an INVITE, but I get a null value.<br><br>To overcome this problem, I need, for each call, to re-register the user!<br><br>What I'm trying to do is whenever a user register, only one time, I want to retrieve the header value from the 200Ok, store it somewhere, and then retrieve for each new request.<br><br>route{<br><br> if (method=="REGISTER") {<br> t_on_reply("2");<br> return;<br> };<br><br> if (method=="INVITE") {<br> cache_fetch("local","variable_name_1",$avp(new_hdr));<br> return;<br> };<br>}<br><br>onreply_route[2] {<br> if (t_check_status("200")) {<br> cache_store("local","variable_name_1","$hdr(header_name)",7200);<br> }<br> exit;<br>}<br><br>Thank you in advance.<br><br>Regards,<br>Marwan<br><br>> Message: 2<br><div>> Date: Tue, 2 Oct 2012 14:34:02 +0400<br>> From: Nick Altmann <nick.altmann@gmail.com><br>> Subject: Re: [OpenSIPS-Users] Store values of the REGISTER and<br>>         Retrieve them in the INVITE<br>> To: OpenSIPS users mailling list <users@lists.opensips.org><br>> Message-ID:<br>>         <CAJOe1EMWtp_K=-FOm6qQFwBa2fRkZeMddGcGzukd=BU-mnGAHw@mail.gmail.com><br>> Content-Type: text/plain; charset="utf-8"<br>> <br>> You cat getting null value only if "$hdr(header_name)" and "$avp(new_hdr)"<br>> are not the same. Check it.<br>> <br>> --<br>> Nick<br>> <br>> <br>> 2012/10/2 Marwan El-Sadek <marwan_sadek@hotmail.com><br>> <br>> ><br>> > Hello,<br>> ><br>> > Can anyone please help me with this point?<br>> ><br>> > Regards,<br>> > Marwan<br>> ><br>> ><br>> > ------------------------------<br>> > From: marwan_sadek@hotmail.com<br>> > To: users@lists.opensips.org<br>> > CC: marwan_sadek@hotmail.com<br>> > Subject: Store values of the REGISTER and Retrieve them in the INVITE<br>> > Date: Fri, 28 Sep 2012 12:08:33 +0300<br>> ><br>> ><br>> > Hello,<br>> ><br>> > I am trying, once I receive the first REGISTER, to store a specific header<br>> > and then retrieve its value in the subsequent requests, like the following<br>> > INVITE's.<br>> ><br>> > I'm currently using the cache memory, but for some reason its not working<br>> > properly, the value cannot be used after only one INVITE and I'm not able<br>> > to use it for other subsequent calls for the same user, I'm getting an null<br>> > value.<br>> ><br>> ><br>> > cache_store("local","variable_name_1","$hdr(header_name)",$ct.fields(expires));<br>> > cache_fetch("local","variable_name_1",$avp(new_hdr));<br>> ><br>> > Is there a better way to do this? Thank you in advance.<br>> ><br>> > Thanks,<br>> > Marwan<br>> ><br>> > _______________________________________________<br>> > Users mailing list<br>> > Users@lists.opensips.org<br>> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br>> ><br>> ><br>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>> URL: <http://lists.opensips.org/pipermail/users/attachments/20121002/87365553/attachment-0001.htm><br>> <br><br></div>                                            </div></body>
</html>