Sorry for the late reply, was yesterday pretty busy as well.
Generally speaking, these are the different approaches that modules use for data access in kamailio child processes:
all children needs to access to a one shared data structure
Create one global structure in mod_init in shm_memory, and then access it from different children.
Protect the (possible) concurrent access with locks, if you support run-time modification of this data.
You find examples in the carrierroute module, mod_init() -> init_route_data() and its reload
functions and other modules.
All children needs access to a individual local data set
Just allocate it in pkg_memory and access it from the children individually.
You can find an example in the auth_diameter module, auth_diameter.c mod_child_init() function.
All children needs access to all local sets
Then you need to implement a solution like you choose with a shared data structure, e.g. in a hash
table that you write in child_init to. I did not fully understand why you need this here, maybe you can
elaborate a bit on the requirements of the HSM child_init.
I have another remark about the hash table you' added. The hash table uses system malloc() to allocate memory. Please change this to pkg_memory, if you need per-process individual memory, or shm_memory for shared memory. If you have more detailed questions, feel free to contact me per e-mail as well (hw at kamailio dot org).
@miconda - as you currently traveling, I can do the further processing of this patch, no need to hurry from your side.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.