static int load_module(void) { CHECK_PJSIP_SESSION_MODULE_LOADED(); if (ast_sip_register_service(&messaging_module) != PJ_SUCCESS) { return AST_MODULE_LOAD_DECLINE; } if (pjsip_endpt_add_capability(ast_sip_get_pjsip_endpoint(), NULL, PJSIP_H_ALLOW, NULL, 1, &pjsip_message_method.name) != PJ_SUCCESS) { ast_sip_unregister_service(&messaging_module); return AST_MODULE_LOAD_DECLINE; } if (ast_msg_tech_register(&msg_tech)) { ast_sip_unregister_service(&messaging_module); return AST_MODULE_LOAD_DECLINE; } message_serializer = ast_sip_create_serializer("pjsip/messaging"); if (!message_serializer) { ast_sip_unregister_service(&messaging_module); ast_msg_tech_unregister(&msg_tech); return AST_MODULE_LOAD_DECLINE; } ast_sip_session_register_supplement(&messaging_supplement); return AST_MODULE_LOAD_SUCCESS; }
static int ami_show_registrations(struct mansession *s, const struct message *m) { int count = 0; struct ast_sip_ami ami = { .s = s, .m = m, .arg = &count, .action_id = astman_get_header(m, "ActionID"), }; astman_send_listack(s, m, "Following are Events for each Inbound " "registration", "start"); ami_registrations_endpoints(&ami); astman_send_list_complete_start(s, m, "InboundRegistrationDetailComplete", count); astman_send_list_complete_end(s); return 0; } #define AMI_SHOW_REGISTRATIONS "PJSIPShowRegistrationsInbound" static pjsip_module registrar_module = { .name = { "Registrar", 9 }, .id = -1, .priority = PJSIP_MOD_PRIORITY_APPLICATION, .on_rx_request = registrar_on_rx_request, }; static int load_module(void) { const pj_str_t STR_REGISTER = { "REGISTER", 8 }; CHECK_PJSIP_MODULE_LOADED(); if (!(serializers = ao2_container_alloc( SERIALIZER_BUCKETS, serializer_hash, serializer_cmp))) { return AST_MODULE_LOAD_DECLINE; } if (ast_sip_register_service(®istrar_module)) { return AST_MODULE_LOAD_DECLINE; } if (pjsip_endpt_add_capability(ast_sip_get_pjsip_endpoint(), NULL, PJSIP_H_ALLOW, NULL, 1, &STR_REGISTER) != PJ_SUCCESS) { ast_sip_unregister_service(®istrar_module); return AST_MODULE_LOAD_DECLINE; } ast_manager_register_xml(AMI_SHOW_REGISTRATIONS, EVENT_FLAG_SYSTEM, ami_show_registrations); return AST_MODULE_LOAD_SUCCESS; } static int unload_module(void) { ast_manager_unregister(AMI_SHOW_REGISTRATIONS); ast_sip_unregister_service(®istrar_module); ao2_cleanup(serializers); return 0; }
static int unload_module(void) { ast_sip_unregister_service(®istrar_module); ao2_cleanup(serializers); return 0; }
static int unload_module(void) { ast_sip_session_unregister_supplement(&messaging_supplement); ast_msg_tech_unregister(&msg_tech); ast_sip_unregister_service(&messaging_module); return 0; }
static int unload_module(void) { ast_sip_unregister_service(&websocket_module); ast_sip_session_unregister_supplement(&websocket_supplement); ast_websocket_remove_protocol("sip", websocket_cb); return 0; }
static int unload_module(void) { ast_sip_session_unregister_supplement(&messaging_supplement); ast_msg_tech_unregister(&msg_tech); ast_sip_unregister_service(&messaging_module); ast_taskprocessor_unreference(message_serializer); return 0; }
static int unload_module(void) { ast_cli_unregister_multiple(cli_pjsip, ARRAY_LEN(cli_pjsip)); ast_sip_unregister_service(&logging_module); ast_sorcery_observer_remove( ast_sip_get_sorcery(), "global", &global_observer); return 0; }
static int load_module(void) { if (ast_sip_register_service(&messaging_module) != PJ_SUCCESS) { return AST_MODULE_LOAD_DECLINE; } if (pjsip_endpt_add_capability(ast_sip_get_pjsip_endpoint(), NULL, PJSIP_H_ALLOW, NULL, 1, &pjsip_message_method.name) != PJ_SUCCESS) { ast_sip_unregister_service(&messaging_module); return AST_MODULE_LOAD_DECLINE; } if (ast_msg_tech_register(&msg_tech)) { ast_sip_unregister_service(&messaging_module); return AST_MODULE_LOAD_DECLINE; } ast_sip_session_register_supplement(&messaging_supplement); return AST_MODULE_LOAD_SUCCESS; }
void ast_sip_destroy_distributor(void) { ast_cli_unregister_multiple(cli_commands, ARRAY_LEN(cli_commands)); ast_sip_unregister_cli_formatter(unid_formatter); ast_sip_unregister_service(&auth_mod); ast_sip_unregister_service(&endpoint_mod); ast_sip_unregister_service(&distributor_mod); ao2_global_obj_release(artificial_auth); ao2_cleanup(artificial_endpoint); ast_sorcery_observer_remove(ast_sip_get_sorcery(), "global", &global_observer); if (prune_context) { ast_sched_context_destroy(prune_context); } distributor_pool_shutdown(); ao2_cleanup(dialog_associations); ao2_cleanup(unidentified_requests); }
static int load_module(void) { CHECK_PJSIP_MODULE_LOADED(); pjsip_transport_register_type(PJSIP_TRANSPORT_RELIABLE, "WS", 5060, &transport_type_ws); pjsip_transport_register_type(PJSIP_TRANSPORT_RELIABLE | PJSIP_TRANSPORT_SECURE, "WSS", 5060, &transport_type_wss); if (ast_sip_register_service(&websocket_module) != PJ_SUCCESS) { return AST_MODULE_LOAD_DECLINE; } if (ast_sip_session_register_supplement(&websocket_supplement)) { ast_sip_unregister_service(&websocket_module); return AST_MODULE_LOAD_DECLINE; } if (ast_websocket_add_protocol("sip", websocket_cb)) { ast_sip_session_unregister_supplement(&websocket_supplement); ast_sip_unregister_service(&websocket_module); return AST_MODULE_LOAD_DECLINE; } return AST_MODULE_LOAD_SUCCESS; }
static int load_module(void) { const pj_str_t STR_REGISTER = { "REGISTER", 8 }; if (!(serializers = ao2_container_alloc( SERIALIZER_BUCKETS, serializer_hash, serializer_cmp))) { return AST_MODULE_LOAD_DECLINE; } if (ast_sip_register_service(®istrar_module)) { return AST_MODULE_LOAD_DECLINE; } if (pjsip_endpt_add_capability(ast_sip_get_pjsip_endpoint(), NULL, PJSIP_H_ALLOW, NULL, 1, &STR_REGISTER) != PJ_SUCCESS) { ast_sip_unregister_service(®istrar_module); return AST_MODULE_LOAD_DECLINE; } return AST_MODULE_LOAD_SUCCESS; }
static int unload_module(void) { ast_sip_unregister_service(&logging_module); return 0; }
static int unload_module(void) { ast_sip_unregister_service(&multihomed_module); return 0; }
static int unload_module(void) { ast_sip_session_unregister_supplement(&nat_supplement); ast_sip_unregister_service(&nat_module); return 0; }