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
-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to