[SR-Users] Re: KEMI: app_jsdt_run_ex(): js loading state not initialized (call: ksr_htable_event)
So is this the normal behaviour for 5.6? If yes, we need to document it somewhere. Other modules might be impacted. -ovidiu On Mon, Mar 27, 2023 at 6:57 AM Daniel-Constantin Mierla wrote: > > Hello, > > it could be due to commit 3c1851ad546f574d1fda869348c8f7e5186079d2, > which was done to avoid sharing the interpreter state before forking the > child processes. > > Cheers, > Daniel > > On 25.03.23 23:15, Ovidiu Sas wrote: > > Hello all, > > > > While using KEMI with app_jsdt I noticed the following possible > > regression between 5.5 and 5.6. > > > > The following config is working ok on 5.5 but throws an error on 5.6: > > ERROR: app_jsdt [app_jsdt_api.c:555]: app_jsdt_run_ex(): js loading > > state not initialized (call: ksr_htable_event) > > > > kamailio.cfg: > > debug=2 > > children=1 > > > > log_facility=LOG_LOCAL0 > > log_name="k" > > > > mpath="/home/osas/src/kamailio/src/modules" > > loadmodule "htable/htable.so" > > modparam("htable", "event_callback", "ksr_htable_event") > > modparam("htable", "event_callback_mode", 1) > > loadmodule "kemix/kemix.so" > > loadmodule "app_jsdt/app_jsdt.so" > > modparam("app_jsdt", "load", "/usr/local/etc/kamailio/kamailio.js") > > cfgengine "jsdt" > > > > kamailio.js: > > function ksr_htable_event(evname) { > > KSR.info("ksr_htable_event(" + evname + ")\n"); > > } > > > > function ksr_request_route() { > > KSR.x.exit(); > > } > > > > If we load the htable module after app_jsdt, then the error is gone. > > Is there something new during init in 5.6 that requires specific > > module loading order? > > > > -ovidiu > > __ > > Kamailio - Users Mailing List - Non Commercial Discussions > > To unsubscribe send an email to sr-users-le...@lists.kamailio.org > > Important: keep the mailing list in the recipients, do not reply only to > > the sender! > > Edit mailing list options or unsubscribe: > > -- > Daniel-Constantin Mierla -- www.asipto.com > www.twitter.com/miconda -- www.linkedin.com/in/miconda > Kamailio World Conference - June 5-7, 2023 - www.kamailioworld.com > Kamailio Advanced Training - Online - March 27-30, 2023 - www.asipto.com > -- VoIP Embedded, Inc. http://www.voipembedded.com __ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-le...@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
[SR-Users] Handling stateless replies with kemi
Hello all, How can we handle stateless replies with kemi? tm has the following param: modparam("tm", "on_sl_reply", "stateless_replies") What's the proper way to map the "stateless_reply" onreply_route to a kemi function. I'm playing with the app_jsdt module. Thanks, Ovidiu __ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-le...@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
[SR-Users] Re: Handling branch-level append_hf()
Hello, On 27.03.23 14:24, Alex Balashov wrote: > Hi, > > I’ve got a situation where I catch a 302 redirect in a failure_route (branch > #1), and use the Contact to set a custom header (append_hf()). > > This custom header is utilised on the subsequent branch (branch #2), but if > that branch fails (e.g. due to 4xx-5xx response), the custom header is not > preserved on subsequent branches (branch #3+). > > What’s the best way to preserve it across subsequent branches? The > documentation for msg_apply_changes() says it cannot be used once the > transaction is already created, and in any case, I have other branch-level > changes in branch #2 that I _would_ like to revert on subsequent branch > attempts (i.e. branch #3). > > I can certainly devise a transaction-persistent vehicle for this value which > can be checked on every branch, but I wondered if there’s an easier and more > best-practical way. I think leveraging avp/xavp(or variants) would be the choice here. Maybe even htable, if you prefer it. Cheers, Daniel -- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio World Conference - June 5-7, 2023 - www.kamailioworld.com __ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-le...@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
[SR-Users] Handling branch-level append_hf()
Hi, I’ve got a situation where I catch a 302 redirect in a failure_route (branch #1), and use the Contact to set a custom header (append_hf()). This custom header is utilised on the subsequent branch (branch #2), but if that branch fails (e.g. due to 4xx-5xx response), the custom header is not preserved on subsequent branches (branch #3+). What’s the best way to preserve it across subsequent branches? The documentation for msg_apply_changes() says it cannot be used once the transaction is already created, and in any case, I have other branch-level changes in branch #2 that I _would_ like to revert on subsequent branch attempts (i.e. branch #3). I can certainly devise a transaction-persistent vehicle for this value which can be checked on every branch, but I wondered if there’s an easier and more best-practical way. Thanks! — Alex -- Alex Balashov Principal Consultant Evariste Systems LLC Web: https://evaristesys.com Tel: +1-706-510-6800 __ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-le...@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
[SR-Users] Re: KEMI: app_jsdt_run_ex(): js loading state not initialized (call: ksr_htable_event)
Hello, it could be due to commit 3c1851ad546f574d1fda869348c8f7e5186079d2, which was done to avoid sharing the interpreter state before forking the child processes. Cheers, Daniel On 25.03.23 23:15, Ovidiu Sas wrote: > Hello all, > > While using KEMI with app_jsdt I noticed the following possible > regression between 5.5 and 5.6. > > The following config is working ok on 5.5 but throws an error on 5.6: > ERROR: app_jsdt [app_jsdt_api.c:555]: app_jsdt_run_ex(): js loading > state not initialized (call: ksr_htable_event) > > kamailio.cfg: > debug=2 > children=1 > > log_facility=LOG_LOCAL0 > log_name="k" > > mpath="/home/osas/src/kamailio/src/modules" > loadmodule "htable/htable.so" > modparam("htable", "event_callback", "ksr_htable_event") > modparam("htable", "event_callback_mode", 1) > loadmodule "kemix/kemix.so" > loadmodule "app_jsdt/app_jsdt.so" > modparam("app_jsdt", "load", "/usr/local/etc/kamailio/kamailio.js") > cfgengine "jsdt" > > kamailio.js: > function ksr_htable_event(evname) { > KSR.info("ksr_htable_event(" + evname + ")\n"); > } > > function ksr_request_route() { > KSR.x.exit(); > } > > If we load the htable module after app_jsdt, then the error is gone. > Is there something new during init in 5.6 that requires specific > module loading order? > > -ovidiu > __ > Kamailio - Users Mailing List - Non Commercial Discussions > To unsubscribe send an email to sr-users-le...@lists.kamailio.org > Important: keep the mailing list in the recipients, do not reply only to the > sender! > Edit mailing list options or unsubscribe: -- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio World Conference - June 5-7, 2023 - www.kamailioworld.com Kamailio Advanced Training - Online - March 27-30, 2023 - www.asipto.com __ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-le...@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: