res_pjsip: Create human friendly serializer names.

PJSIP name formats:
pjsip/aor/<aor>-<seq> -- registrar thread pool serializer
pjsip/default-<seq> -- default thread pool serializer
pjsip/messaging -- messaging thread pool serializer
pjsip/outreg/<registration>-<seq> -- outbound registration thread pool
serializer
pjsip/pubsub/<endpoint>-<seq> -- pubsub thread pool serializer
pjsip/refer/<endpoint>-<seq> -- REFER thread pool serializer
pjsip/session/<endpoint>-<seq> -- session thread pool serializer
pjsip/websocket-<seq> -- websocket thread pool serializer

Change-Id: Iff9df8da3ddae1132cb2ef65f64df0c465c5e084
This commit is contained in:
Richard Mudgett
2016-01-06 19:10:16 -06:00
parent 4276f185f0
commit cf8e7a580b
9 changed files with 103 additions and 22 deletions

View File

@@ -303,14 +303,22 @@ static int get_write_timeout(void)
return write_timeout;
}
/*!
\brief WebSocket connection handler.
*/
static struct ast_taskprocessor *create_websocket_serializer(void)
{
char tps_name[AST_TASKPROCESSOR_MAX_NAME + 1];
/* Create name with seq number appended. */
ast_taskprocessor_build_name(tps_name, sizeof(tps_name), "pjsip/websocket");
return ast_sip_create_serializer_named(tps_name);
}
/*! \brief WebSocket connection handler. */
static void websocket_cb(struct ast_websocket *session, struct ast_variable *parameters, struct ast_variable *headers)
{
struct ast_taskprocessor *serializer = NULL;
struct ast_taskprocessor *serializer;
struct transport_create_data create_data;
struct ws_transport *transport = NULL;
struct ws_transport *transport;
struct transport_read_data read_data;
if (ast_websocket_set_nonblock(session)) {
@@ -323,7 +331,8 @@ static void websocket_cb(struct ast_websocket *session, struct ast_variable *par
return;
}
if (!(serializer = ast_sip_create_serializer())) {
serializer = create_websocket_serializer();
if (!serializer) {
ast_websocket_unref(session);
return;
}