[SR-Users] htable lock - unlock
Daniel-Constantin Mierla
miconda at gmail.com
Thu Dec 15 12:13:16 CET 2016
Hello,
the log message you refer to is inside the if block:
if ($sht(pht=>$ci)!=$null) { ... }
but you don't set the item in memory, no assignment like:
$sht(pht=>$ci) = ...;
The sht_lock(pht=>$ci) is just locking the slot where the value of
$sht(pht=>$ci) will be stored, but don't store any valye for that variable.
Cheers,
Daniel
On 15/12/2016 11:46, Marino Mileti wrote:
>
> Hi guys,
>
>
>
> I'm going out of mind J
>
> I've this piece of script inside an "on_reply_route" that captures
> only 200OK of INVITE (i would like to save in ht the contact of who
> has answered a call)
>
>
>
> sht_lock("pht=>$ci");
>
> if ($sht(pht=>$ci)!=$null){
>
> xlog("L_INFO","Before assignment..");
>
> $sht(pht=>$ci)=$var(myvar);
>
> xlog("L_INFO","Assigned done...");
>
> sht_unlock("pht=>$ci");
>
> }
>
> else{
>
> xlog("L_INFO","Skipping..");
>
> }
>
> sht_unlock("pht=>$(hdr(Call-ID))");
>
>
>
> The situation is that I never see the "Assigned done" message in log
> file...
>
>
>
> Is this the right use of sht_lock/sht_unlock method?
>
>
>
> /Marino Maria Mileti///
>
> /marino.mileti at alice.it <mailto:marino.mileti at alice.it>/
>
> / /
>
> /cid:006a01cb6b0e$67eecdae$_CDOSYS2.0//Reduce your energy consumption
> and keep polar bears on ice!/
>
>
>
>
>
> ------------------------------------------------------------------------
> Avast logo
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>
>
> Questa e-mail รจ stata controllata per individuare virus con Avast
> antivirus.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>
>
>
>
>
> _______________________________________________
> 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
--
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20161215/6ae1488d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 691 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20161215/6ae1488d/attachment.jpe>
More information about the sr-users
mailing list