[sr-dev] Simple module - beginner questions

Daniel-Constantin Mierla miconda at gmail.com
Mon Aug 19 11:11:30 CEST 2013


Hello,

On 8/16/13 10:03 AM, DanB wrote:
> Hey Guys,
>
> We are in the process of writing our first Kamailio module and would 
> need if possible some guidance.
>
> Following questions came up:
>
> * We need to keep track about call-start and call-stop events. Do you 
> recommend us dialog or dialog-ng module for that?
I guess that they export the same api for this situation, but afaik the 
dialog_ng was still missing some of the dialog features and it is more 
ims focused. dialog is known to stay compatible for the rest of modules 
such as presence, prepaid... so ti could be the safe bet until these two 
modules merge or a different decision is taken.

> * To learn the basic of Kamailio module development, can you recommend 
> us a very simple and basic module to have a look on (like a hello 
> world or something).

There are print and print_lib modules having the purpose of very 
simple/pedagogical content, but might not be really suitable to start 
from them. Here is a list of good modules to look at:
- alias_db - mainly if you need database interaction
- async - simple and also shows usage of asynchronous message processing
- benchmark - simple and exports variable to config
- cnxcc - prepaid, using dialog, so might fit many of your needs as well
- jsonrpc-c - communication with other applications via tcp/netstring (iirc)
- rtimers - show how to start custom timer processes

There is also the devel guide:
- http://www.asipto.com/pub/kamailio-devel-guide/
> * We would need to be able to control calls (eg kill them when the 
> account credits are finished, is dialog also the way to go for that)?

Dialog is the way now, unless you want to implement your own.

> * We would need to be able to receive rpc requests from a remote 
> server. What do you recommend us as approach: using existing rpc 
> modules and expose our own apis through that or fire up our own rpc 
> server instead?

xmrpc should be flexible enough. But in case you need to open a 
connection to your app, you may reuse that one with some self-defined 
api. Maybe we can discuss more and make some generic bi-directional 
interface that will include your needs as well.

Cheers,
Daniel
>
> Thanks in advance for any tip!
>
> DanB
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda




More information about the sr-dev mailing list