Summary:ASTERISK-12929: [patch] Add ability to register callback that should run just prior to when asterisk is fully loaded
Reporter:Michiel van Baak (mvanbaak)Labels:
Date Opened:2008-10-17 13:15:28Date Closed:2011-06-07 14:07:57
Versions:Frequency of
Environment:Attachments:( 0) 2008101700_callbackonstarted.diff.txt
( 1) 2008101700_callbackonstarted-4.diff
Description:When asterisk is done starting, execute registered callback functions.

Usecase: the soon to be merged res_clialiases that will check if a CLI function exists before allowing it to be aliased. For this, everything needs to be loaded.
Comments:By: Mark Michelson (mmichelson) 2008-10-17 13:54:58

Cool idea. I have a couple of suggestions.

1. I think it would be a good idea for the function pointer in the ast_atstarted struct to take a void * as its argument instead of having a void parameter list. This would allow for data to be passed into the callback.

2. I'm not sure that any of the locking is necessary. The reason is that unlike at exit, the modules are all loaded serially, and so there is no contention.

By: Michiel van Baak (mvanbaak) 2008-10-18 06:37:11

Latest version that has been ok-ed by russellb on the reviewboard.
He also noted: "However, I'd rather not add it to trunk until you're ready to add whatever uses it to trunk."

So I merged it into the res_clialiases branch because we are going to need it there.

By: Jason Parker (jparker) 2008-10-20 15:50:15

suspending per discussion on IRC