/*! * \brief Load the module * * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static int load_module(void) { CHECK_PJSIP_SESSION_MODULE_LOADED(); ast_sockaddr_parse(&address_ipv4, "0.0.0.0", 0); ast_sockaddr_parse(&address_ipv6, "::", 0); if (ast_sip_session_register_supplement(&t38_supplement)) { ast_log(LOG_ERROR, "Unable to register T.38 session supplement\n"); goto end; } if (ast_sip_session_register_supplement(&t38_bye_supplement)) { ast_log(LOG_ERROR, "Unable to register T.38 BYE session supplement\n"); goto end; } if (ast_sip_session_register_sdp_handler(&image_sdp_handler, "image")) { ast_log(LOG_ERROR, "Unable to register SDP handler for image stream type\n"); goto end; } return AST_MODULE_LOAD_SUCCESS; end: unload_module(); return AST_MODULE_LOAD_FAILURE; }
static int load_module(void) { CHECK_PJSIP_SESSION_MODULE_LOADED(); ast_sip_session_register_supplement(&caller_id_supplement); return AST_MODULE_LOAD_SUCCESS; }
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 load_module(void) { CHECK_PJSIP_MODULE_LOADED(); if (ast_sip_session_register_supplement(&dlg_options_supplement)) { return AST_MODULE_LOAD_DECLINE; } return AST_MODULE_LOAD_SUCCESS; }
static int load_module(void) { CHECK_PJSIP_SESSION_MODULE_LOADED(); if (ast_sip_session_register_supplement(&refer_supplement)) { ast_log(LOG_ERROR, "Unable to register Send to Voicemail supplement\n"); return AST_MODULE_LOAD_FAILURE; } return AST_MODULE_LOAD_SUCCESS; }
static int load_module(void) { CHECK_PJSIP_SESSION_MODULE_LOADED(); if (ast_sip_register_supplement(&path_supplement)) { return AST_MODULE_LOAD_DECLINE; } if (ast_sip_session_register_supplement(&path_session_supplement)) { ast_sip_unregister_supplement(&path_supplement); return AST_MODULE_LOAD_DECLINE; } return AST_MODULE_LOAD_SUCCESS; }
static int load_module(void) { CHECK_PJSIP_SESSION_MODULE_LOADED(); if (ast_sip_register_service(&nat_module)) { ast_log(LOG_ERROR, "Could not register NAT module for incoming and outgoing requests\n"); return AST_MODULE_LOAD_FAILURE; } if (ast_sip_session_register_supplement(&nat_supplement)) { ast_log(LOG_ERROR, "Could not register NAT session supplement for incoming and outgoing INVITE requests\n"); unload_module(); return AST_MODULE_LOAD_FAILURE; } return AST_MODULE_LOAD_SUCCESS; }
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; }
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) { ast_sip_session_register_supplement(&rfc3326_supplement); return AST_MODULE_LOAD_SUCCESS; }