Hi, John!
Some answers below:
My question is this: Can I use async() or launch() as a wrapper for a
cache_store() function call made from within an event handler?
Calling async() or launch() from an event handler SHOULD work (see
below). Unfortunately, the "cache_" family of functions do not
Hi Bogdan,
I call save(location) from the script in the usual way.
From observation of events triggered by this process, I found (as you would
expect):
E_UL_CONTACT_INSERT event is triggered whenever a contact is inserted
E_UL_CONTATC_DELETE event is triggered whenever a contact is deleted
It
Hi John,
I don't think you can "replicate" the event triggers with some
avp_db_query() from script. When you so a save(location), you never know
if that call will translate into updating an existing contact or in
inserting a new one - this is no visible at script level
Regards,
Ben,
Thanks. I hadn't spotted that little detail in the Event Handler
documentation.
My event handler first retrieves some data about the relevant AOR from the
DB, then updates it, then writes it back.
Interestingly, when I add "async" as a 2nd parameter in the event handler
definition, this
I think it would depend on whether you have defined the event handler itself to
be sync or async. [1]
[1] https://opensips.org/html/docs/modules/2.4.x/event_route.html#overview
Ben Newlin
On 3/20/19, 10:56 AM, "Users on behalf of John Quick"
wrote:
I have a script which employs USRLOC
I have a script which employs USRLOC to save registrations and also has an
event handler defined for E_UL_CONTACT_INSERT.
It is convenient, for the required logic/business rules, that I update a
user database from within the event handler.
If the DB update were happening directly from the main