Hello,
based on a recent discussion with Alex Balashov (at Kazoocon this week),
I pushed a patch that enables the execution of
event_route[core:worker-one-init] when kamailio is started. It would be
more like an alternative for event_route[htable:mod-init], for the cases
when htable is not used, but also should ensure that all the modules are
initialized. Moreover, because most of the modules close connection in
mod init, I though of doing it when child one (udp receiver)
initialization for all modules is finished, which means that all is
ready for runtime, still this is before receiving any packet.
On the other hand, forking is done by main process, so other children
can start listening for sip.
More or less what I want to ask here is whether the forking of the other
children should wait until the event_route[core:worker-one-init] is
finished (e.g., what is done in this event route is important before any
sip packet is routed) or just leave it like it is.
Worth to say that some modules do special processing in child init of
worker one, like usrloc module loads the records from database to
memory, which means that overall start of kamailio could be slower.
Also, if there are time consuming actions in the
event_route[core:worker-one-init], getting to the stage of routing sip
packets will take longer.
What would you find important, fork the other processes so routing sip
will happen as soon as possible, or block until execution
ofevent_route[core:worker-one-init] is finished.
I guess that making it cusomizable in some way would be a solution, but
knowing what use cases would be important may help in reducing the
complexity to get it enabled.
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
This fix try to solve the crash reported in http://lists.sip-router.org/pipermail/sr-users/2015-September/089846.html. The cause of the crash was that the sip message used to append branch was the shmem clone of the original message. When the new branches were going through their configured branch route, modifications done by other modules' function (like rtpproxy) were applied to this stored copy directly, causing the crash once a failure route was run.
This patch take the same approach as the failure handler one, creating a fake request from the origin message and using this one to append branches. I am not sure if this is a good approach, since the appended branch are going through the branch route and some function called there could not be compatible with a faked request.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/346
-- Commit Summary --
* tm: fake msg and environment to append new branches
-- File Changes --
M modules/tm/t_append_branches.c (54)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/346.patchhttps://github.com/kamailio/kamailio/pull/346.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/346
Module: kamailio
Branch: master
Commit: 7185a8a708001a6e2d2150e2541880c04c2374b4
URL: https://github.com/kamailio/kamailio/commit/7185a8a708001a6e2d2150e2541880c…
Author: jaybeepee <jason.penton(a)gmail.com>
Committer: jaybeepee <jason.penton(a)gmail.com>
Date: 2015-10-07T15:48:53+02:00
modules/ims_charging: set the last_event timestamp if there was failure to get credit
---
Modified: modules/ims_charging/ro_timer.c
---
Diff: https://github.com/kamailio/kamailio/commit/7185a8a708001a6e2d2150e2541880c…
Patch: https://github.com/kamailio/kamailio/commit/7185a8a708001a6e2d2150e2541880c…
---
diff --git a/modules/ims_charging/ro_timer.c b/modules/ims_charging/ro_timer.c
index 4e1c268..df1fc59 100644
--- a/modules/ims_charging/ro_timer.c
+++ b/modules/ims_charging/ro_timer.c
@@ -332,6 +332,7 @@ void resume_ro_session_ontimeout(struct interim_ccr *i_req) {
/* just put the timer back in with however many seconds are left (if any!!! in which case we need to kill */
/* also update the event type to no_more_credit to save on processing the next time we get here */
i_req->ro_session->event_type = no_more_credit;
+ i_req->ro_session->last_event_timestamp = get_current_time_micro();
int whatsleft = i_req->ro_session->reserved_secs - used_secs;
if (whatsleft <= 0) {
// TODO we need to handle this situation more precisely.