Version 0.1.0 from FTP
[asterisk/asterisk.git] / doc / modules.txt
1 All modules must have at least the following functions:
2
3 int load_module():
4
5         Do what you need to do when you get started.  This function
6 returns 0 on sucess and non-zero on failure (it is not considered loaded
7 if it failes.
8
9 int unload_module():
10         
11         The module will soon be unloaded.  If any channels are using your
12 features, you should give them a softhangup in an effort to keep the
13 program from crashing.  Generally, unload_module is only called when the
14 usecount is 0 or less, but the user can force unloading at their
15 discression, and thus a module should do its best to comply (although in
16 some cases there may be no way to avoid a crash).  This function should
17 return 0 on success and non-zero on failure (i.e. it cannot yet be
18 unloaded).
19
20 char *description():
21
22         Return a description of the module's functionality.
23
24 int usecnt():
25         
26         Return the number of channels, etc that are using you.