Handling INVITE messages in a custom asterisk module

Hi, I have some questions and I was wondering if you guys could help me. First let me explain my task.

I must implement a module in asterisk, for research purposes, that handle INVITE messages, I’m dealing only with SIP here. To do that, I must be able to register some kind of hook with asterisk, so that a function in my module is called when a new request arrives.

My first question is: I know that applications are called and given a pointer to a channel, is there a way to have my module called before the channel is created? So to avoid overload in case of a massive number of calls being generated. Maybe using some hook in chan_sip.

My second questions is: Is there a maximum number of channels that asterisk can create? If so, would having my module called only after the channel is created, just like a normal application, possibly have a negative impact on asterisk’s performance in case of a massive number of calls being generated?

Thanks in advance!

This is an end user support forum. If you are to get any help, you need to use the developer mailing list or IRC channel. However, my suspicion is that, as there is no benefit to the wider community, you may find that even those are not very productive.

There are no hard limits to the numbers of channels, but channels consume memory, file descriptors and threads.

The chan_sip module has no ability to have modules hook themselves in to be able to interact with and see traffic. This is only available in chan_pjsip as part of its architecture.