Hi Daniel,
but I see the first line of log:
xlog("L_INFO","Before assignment..");
My idea was to lock the slot...write something...unlock the slot.
But it seems that when I lock the slot I can't write anything..
Da: sr-users [mailto:sr-users-bounces@lists.sip-router.org] Per conto di Daniel-Constantin
Mierla
Inviato: giovedì 15 dicembre 2016 12:13
A: Kamailio (SER) - Users Mailing List
Oggetto: Re: [SR-Users] htable lock - unlock
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(a)alice.it
cid:006a01cb6b0e$67eecdae$_CDOSYS2.0Reduce your energy consumption and keep polar bears on
ice!
_____
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
Avast logo
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(a)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
---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus