[asterisk-dev] new module
Kelvin Chua
kelchy at gmail.com
Tue Jul 21 23:23:07 CDT 2015
i am building a proof of concept for a new module,
my first step was to create a socket to listen to, accept connections,
show remote IP, accept data and print it in asterisk console.
so far i am able to load, unload, setup the socket with a few lines of code.
then i got stuck. any pointers?
here is what i have so far:
static struct ast_tcptls_session_args desc = {
.accept_fd = -1,
.master = AST_PTHREADT_NULL,
.tls_cfg = NULL,
.poll_timeout = 5000, /* wake up every 5 seconds */
.periodic_fn = cleanup,
.name = "Control Module",
.accept_fn = ast_tcptls_server_root, /* thread doing the
accept() */
.worker_fn = session_do, /* thread handling the session */
};
static int load_module(void)
{
struct ast_sockaddr bindaddr;
ast_sockaddr_parse(&bindaddr, "0.0.0.0:2223", 0);
ast_sockaddr_copy(&desc.local_address, &bindaddr);
ast_tcptls_server_start(&desc);
return AST_MODULE_LOAD_SUCCESS;
}
question:
what would be the general flow of session_do() in this scenario?
Kelvin Chua
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150722/1397ef9e/attachment.html>
More information about the asterisk-dev
mailing list