本文整理汇总了C++中pjsip_endpt_register_module函数的典型用法代码示例。如果您正苦于以下问题:C++ pjsip_endpt_register_module函数的具体用法?C++ pjsip_endpt_register_module怎么用?C++ pjsip_endpt_register_module使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pjsip_endpt_register_module函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: init_stack
static pj_status_t init_stack()
{
pj_sockaddr addr;
pjsip_inv_callback inv_cb;
pj_status_t status;
pj_log_set_level(5);
status = pj_init();
CHECK_STATUS();
pj_log_set_level(3);
status = pjlib_util_init();
CHECK_STATUS();
pj_caching_pool_init(&app.cp, NULL, 0);
app.pool = pj_pool_create( &app.cp.factory, "sipecho", 512, 512, 0);
status = pjsip_endpt_create(&app.cp.factory, NULL, &app.sip_endpt);
CHECK_STATUS();
pj_log_set_level(4);
pj_sockaddr_init(AF, &addr, NULL, (pj_uint16_t)SIP_PORT);
if (AF == pj_AF_INET()) {
status = pjsip_udp_transport_start( app.sip_endpt, &addr.ipv4, NULL,
1, NULL);
} else if (AF == pj_AF_INET6()) {
status = pjsip_udp_transport_start6(app.sip_endpt, &addr.ipv6, NULL,
1, NULL);
} else {
status = PJ_EAFNOTSUP;
}
pj_log_set_level(3);
CHECK_STATUS();
status = pjsip_tsx_layer_init_module(app.sip_endpt) ||
pjsip_ua_init_module( app.sip_endpt, NULL );
CHECK_STATUS();
pj_bzero(&inv_cb, sizeof(inv_cb));
inv_cb.on_state_changed = &call_on_state_changed;
inv_cb.on_new_session = &call_on_forked;
inv_cb.on_media_update = &call_on_media_update;
inv_cb.on_rx_offer = &call_on_rx_offer;
status = pjsip_inv_usage_init(app.sip_endpt, &inv_cb) ||
pjsip_100rel_init_module(app.sip_endpt) ||
pjsip_endpt_register_module( app.sip_endpt, &mod_sipecho) ||
pjsip_endpt_register_module( app.sip_endpt, &msg_logger) ||
//pjmedia_endpt_create(&app.cp.factory,
// pjsip_endpt_get_ioqueue(app.sip_endpt),
// 0, &app.med_endpt) ||
pj_thread_create(app.pool, "sipecho", &worker_proc, NULL, 0, 0,
&app.worker_thread);
CHECK_STATUS();
return PJ_SUCCESS;
}
开发者ID:xhook,项目名称:asterisk-v11,代码行数:60,代码来源:sipecho.c
示例2: inv_offer_answer_test
int inv_offer_answer_test(void)
{
unsigned i;
int rc = 0;
/* Init UA layer */
if (pjsip_ua_instance()->id == -1) {
pjsip_ua_init_param ua_param;
pj_bzero(&ua_param, sizeof(ua_param));
ua_param.on_dlg_forked = &on_dlg_forked;
pjsip_ua_init_module(endpt, &ua_param);
}
/* Init inv-usage */
if (pjsip_inv_usage_instance()->id == -1) {
pjsip_inv_callback inv_cb;
pj_bzero(&inv_cb, sizeof(inv_cb));
inv_cb.on_media_update = &on_media_update;
inv_cb.on_rx_offer = &on_rx_offer;
inv_cb.on_create_offer = &on_create_offer;
inv_cb.on_state_changed = &on_state_changed;
inv_cb.on_new_session = &on_new_session;
pjsip_inv_usage_init(endpt, &inv_cb);
}
/* 100rel module */
pjsip_100rel_init_module(endpt);
/* Our module */
pjsip_endpt_register_module(endpt, &mod_inv_oa_test);
pjsip_endpt_register_module(endpt, &mod_msg_logger);
/* Create SIP UDP transport */
{
pj_sockaddr_in addr;
pjsip_transport *tp;
pj_status_t status;
pj_sockaddr_in_init(&addr, NULL, PORT);
status = pjsip_udp_transport_start(endpt, &addr, NULL, 1, &tp);
pj_assert(status == PJ_SUCCESS);
}
/* Do tests */
for (i=0; i<PJ_ARRAY_SIZE(test_params); ++i) {
rc = perform_test(&test_params[i]);
if (rc != 0)
goto on_return;
}
on_return:
return rc;
}
开发者ID:kaaustubh,项目名称:pjsip,代码行数:54,代码来源:inv_offer_answer_test.c
示例3: init_stateful_proxy
static pj_status_t init_stateful_proxy(void)
{
pj_status_t status;
status = pjsip_endpt_register_module( global.endpt, &mod_stateful_proxy);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
status = pjsip_endpt_register_module( global.endpt, &mod_tu);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
return PJ_SUCCESS;
}
开发者ID:carlosdelfino,项目名称:WorkshopTelefoniaAutomacao,代码行数:12,代码来源:stateful_proxy.c
示例4: PJ_DEF
/*
* Initialize the REFER subsystem.
*/
PJ_DEF(pj_status_t) pjsip_xfer_init_module(pjsip_endpoint *endpt)
{
const pj_str_t accept = { "message/sipfrag;version=2.0", 27 };
pj_status_t status;
PJ_ASSERT_RETURN(endpt != NULL, PJ_EINVAL);
PJ_ASSERT_RETURN(mod_xfer.id == -1, PJ_EINVALIDOP);
status = pjsip_endpt_register_module(endpt, &mod_xfer);
if (status != PJ_SUCCESS)
return status;
status = pjsip_endpt_add_capability( endpt, &mod_xfer, PJSIP_H_ALLOW,
NULL, 1,
&pjsip_get_refer_method()->name);
if (status != PJ_SUCCESS)
return status;
status = pjsip_evsub_register_pkg(&mod_xfer, &STR_REFER,
PJSIP_XFER_EXPIRES, 1, &accept);
if (status != PJ_SUCCESS)
return status;
return PJ_SUCCESS;
}
开发者ID:iamroger,项目名称:voip,代码行数:28,代码来源:sip_xfer.c
示例5: init_authentication
pj_status_t init_authentication(const std::string& realm_name,
AvStore* avstore,
HSSConnection* hss_connection,
ChronosConnection* chronos_connection,
ACRFactory* rfacr_factory,
AnalyticsLogger* analytics_logger)
{
pj_status_t status;
aka_realm = (realm_name != "") ? pj_strdup3(stack_data.pool, realm_name.c_str()) : stack_data.local_host;
av_store = avstore;
hss = hss_connection;
chronos = chronos_connection;
acr_factory = rfacr_factory;
analytics = analytics_logger;
// Register the authentication module. This needs to be in the stack
// before the transaction layer.
status = pjsip_endpt_register_module(stack_data.endpt, &mod_auth);
// Initialize the authorization server.
pjsip_auth_srv_init_param params;
params.realm = &WILDCARD_REALM;
params.lookup3 = user_lookup;
params.options = 0;
status = pjsip_auth_srv_init2(stack_data.pool, &auth_srv, ¶ms);
return status;
}
开发者ID:rugge-90,项目名称:sprout,代码行数:29,代码来源:authentication.cpp
示例6: init_stateless_proxy
static pj_status_t init_stateless_proxy(void)
{
static pjsip_module mod_stateless_proxy =
{
NULL, NULL, /* prev, next. */
{ "mod-stateless-proxy", 19 }, /* Name. */
-1, /* Id */
PJSIP_MOD_PRIORITY_UA_PROXY_LAYER, /* Priority */
NULL, /* load() */
NULL, /* start() */
NULL, /* stop() */
NULL, /* unload() */
&on_rx_request, /* on_rx_request() */
&on_rx_response, /* on_rx_response() */
NULL, /* on_tx_request. */
NULL, /* on_tx_response() */
NULL, /* on_tsx_state() */
};
pj_status_t status;
/* Register our module to receive incoming requests. */
status = pjsip_endpt_register_module( global.endpt, &mod_stateless_proxy);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
return PJ_SUCCESS;
}
开发者ID:LuLei2013,项目名称:pjproject,代码行数:27,代码来源:stateless_proxy.c
示例7: pjsua_im_init
/*
* Init pjsua IM module.
*/
pj_status_t pjsua_im_init(void)
{
const pj_str_t msg_tag = { "MESSAGE", 7 };
const pj_str_t STR_MIME_TEXT_PLAIN = { "text/plain", 10 };
const pj_str_t STR_MIME_APP_ISCOMPOSING =
{ "application/im-iscomposing+xml", 30 };
pj_status_t status;
/* Register module */
status = pjsip_endpt_register_module(pjsua_var.endpt, &mod_pjsua_im);
if (status != PJ_SUCCESS)
return status;
/* Register support for MESSAGE method. */
pjsip_endpt_add_capability( pjsua_var.endpt, &mod_pjsua_im, PJSIP_H_ALLOW,
NULL, 1, &msg_tag);
/* Register support for "application/im-iscomposing+xml" content */
pjsip_endpt_add_capability( pjsua_var.endpt, &mod_pjsua_im, PJSIP_H_ACCEPT,
NULL, 1, &STR_MIME_APP_ISCOMPOSING);
/* Register support for "text/plain" content */
pjsip_endpt_add_capability( pjsua_var.endpt, &mod_pjsua_im, PJSIP_H_ACCEPT,
NULL, 1, &STR_MIME_TEXT_PLAIN);
return PJ_SUCCESS;
}
开发者ID:CloudStyleStudio,项目名称:csip,代码行数:30,代码来源:pjsua_im.c
示例8: PJ_DEF
/*
* init module
*/
PJ_DEF(pj_status_t) pjsip_100rel_init_module(pjsip_endpoint *endpt)
{
if (mod_100rel.mod.id != -1)
return PJ_SUCCESS;
return pjsip_endpt_register_module(endpt, &mod_100rel.mod);
}
开发者ID:iamroger,项目名称:voip,代码行数:10,代码来源:sip_100rel.c
示例9: PJ_DEF
/*
* Init presence module.
*/
PJ_DEF(pj_status_t) pjsip_pres_init_module( pjsip_endpoint *endpt,
pjsip_module *mod_evsub)
{
pj_status_t status;
pj_str_t accept[2];
/* Check arguments. */
PJ_ASSERT_RETURN(endpt && mod_evsub, PJ_EINVAL);
/* Must have not been registered */
PJ_ASSERT_RETURN(mod_presence.id == -1, PJ_EINVALIDOP);
/* Register to endpoint */
status = pjsip_endpt_register_module(endpt, &mod_presence);
if (status != PJ_SUCCESS)
return status;
accept[0] = STR_APP_PIDF_XML;
accept[1] = STR_APP_XPIDF_XML;
/* Register event package to event module. */
status = pjsip_evsub_register_pkg( &mod_presence, &STR_PRESENCE,
PRES_DEFAULT_EXPIRES,
PJ_ARRAY_SIZE(accept), accept);
if (status != PJ_SUCCESS) {
pjsip_endpt_unregister_module(endpt, &mod_presence);
return status;
}
return PJ_SUCCESS;
}
开发者ID:zbarni,项目名称:csipsimple,代码行数:34,代码来源:presence.c
示例10: PJ_DEF
/*
* Init mwi module.
*/
PJ_DEF(pj_status_t) pjsip_mwi_init_module( pjsip_endpoint *endpt,
pjsip_module *mod_evsub)
{
pj_status_t status;
pj_str_t accept[1];
/* Check arguments. */
PJ_ASSERT_RETURN(endpt && mod_evsub, PJ_EINVAL);
/* Must have not been registered */
PJ_ASSERT_RETURN(mod_mwi.id == -1, PJ_EINVALIDOP);
/* Register to endpoint */
status = pjsip_endpt_register_module(endpt, &mod_mwi);
if (status != PJ_SUCCESS)
return status;
accept[0] = STR_APP_SIMPLE_SMS;
/* Register event package to event module. */
status = pjsip_evsub_register_pkg( &mod_mwi, &STR_MWI,
MWI_DEFAULT_EXPIRES,
PJ_ARRAY_SIZE(accept), accept);
if (status != PJ_SUCCESS) {
pjsip_endpt_unregister_module(endpt, &mod_mwi);
return status;
}
return PJ_SUCCESS;
}
开发者ID:carlosdelfino,项目名称:WorkshopTelefoniaAutomacao,代码行数:33,代码来源:mwi.c
示例11: PJ_DECL
PJ_DECL(pj_status_t) pjsip_opus_sdp_rewriter_init(unsigned target_clock_rate) {
if(target_clock_rate > 0 && target_clock_rate <= 48000){
pjopus_internal_clockrate = target_clock_rate;
}else{
pjopus_internal_clockrate = 48000;
}
return pjsip_endpt_register_module(pjsua_get_pjsip_endpt(),
&pjsua_opus_sdp_rewriter);
}
开发者ID:Archipov,项目名称:android-client,代码行数:9,代码来源:pjsip_opus_sdp_rewriter.c
示例12: init_registrar
pj_status_t init_registrar(RegData::Store* registrar_store, HSSConnection* hss_connection, AnalyticsLogger* analytics_logger, IfcHandler* ifchandler_ref)
{
pj_status_t status;
store = registrar_store;
hss = hss_connection;
analytics = analytics_logger;
ifchandler = ifchandler_ref;
status = pjsip_endpt_register_module(stack_data.endpt, &mod_registrar);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
return status;
}
开发者ID:sa4250mnpo70,项目名称:sprout,代码行数:14,代码来源:registrar.cpp
示例13: init_stack
static pj_status_t init_stack(void)
{
pj_status_t status;
/* Must init PJLIB first: */
status = pj_init();
PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
/* Then init PJLIB-UTIL: */
status = pjlib_util_init();
PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
/* Must create a pool factory before we can allocate any memory. */
pj_caching_pool_init(&global.cp, &pj_pool_factory_default_policy, 0);
/* Create the endpoint: */
status = pjsip_endpt_create(&global.cp.factory, NULL, &global.endpt);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
/* Init transaction layer for stateful proxy only */
#if STATEFUL
status = pjsip_tsx_layer_init_module(global.endpt);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
#endif
/* Create listening transport */
{
pj_sockaddr_in addr;
addr.sin_family = pj_AF_INET();
addr.sin_addr.s_addr = 0;
addr.sin_port = pj_htons((pj_uint16_t)global.port);
status = pjsip_udp_transport_start( global.endpt, &addr,
NULL, 1, NULL);
if (status != PJ_SUCCESS)
return status;
}
/* Create pool for the application */
global.pool = pj_pool_create(&global.cp.factory, "proxyapp",
4000, 4000, NULL);
/* Register the logger module */
pjsip_endpt_register_module(global.endpt, &mod_msg_logger);
return PJ_SUCCESS;
}
开发者ID:tasosbull,项目名称:yewtic,代码行数:50,代码来源:stateful_proxy.c
示例14: init_msg_logger
int init_msg_logger(void)
{
pj_status_t status;
if (mod_msg_logger.id != -1)
return 0;
status = pjsip_endpt_register_module(endpt, &mod_msg_logger);
if (status != PJ_SUCCESS) {
app_perror(" error registering module", status);
return -10;
}
return 0;
}
开发者ID:Agostin,项目名称:csipsimple,代码行数:15,代码来源:msg_logger.c
示例15: PJ_DEF
/*
* Init user agent module and register it to the endpoint.
*/
PJ_DEF(pj_status_t) pjsip_ua_init_module( pjsip_endpoint *endpt,
const pjsip_ua_init_param *prm)
{
pj_status_t status;
/* Check if module already registered. */
PJ_ASSERT_RETURN(mod_ua.mod.id == -1, PJ_EINVALIDOP);
/* Copy param, if exists. */
if (prm)
pj_memcpy(&mod_ua.param, prm, sizeof(pjsip_ua_init_param));
/* Register the module. */
status = pjsip_endpt_register_module(endpt, &mod_ua.mod);
return status;
}
开发者ID:nishantjr,项目名称:pjproject,代码行数:20,代码来源:sip_ua_layer.c
示例16: pjsua_pres_init
/*
* Init presence
*/
pj_status_t pjsua_pres_init()
{
unsigned i;
pj_status_t status;
status = pjsip_endpt_register_module( pjsua_var.endpt, &mod_pjsua_pres);
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Unable to register pjsua presence module",
status);
}
for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.buddy); ++i) {
reset_buddy(i);
}
return status;
}
开发者ID:svn2github,项目名称:pjproject,代码行数:20,代码来源:pjsua_pres.c
示例17: ast_res_pjsip_init_options_handling
int ast_res_pjsip_init_options_handling(int reload)
{
static const pj_str_t STR_OPTIONS = { "OPTIONS", 7 };
if (reload) {
qualify_and_schedule_all();
return 0;
}
sched_qualifies = ao2_t_container_alloc(QUALIFIED_BUCKETS,
sched_qualifies_hash_fn, sched_qualifies_cmp_fn,
"Create container for scheduled qualifies");
if (!sched_qualifies) {
return -1;
}
if (pjsip_endpt_register_module(ast_sip_get_pjsip_endpoint(), &options_module) != PJ_SUCCESS) {
ao2_cleanup(sched_qualifies);
sched_qualifies = NULL;
return -1;
}
if (pjsip_endpt_add_capability(ast_sip_get_pjsip_endpoint(), NULL, PJSIP_H_ALLOW,
NULL, 1, &STR_OPTIONS) != PJ_SUCCESS) {
pjsip_endpt_unregister_module(ast_sip_get_pjsip_endpoint(), &options_module);
ao2_cleanup(sched_qualifies);
sched_qualifies = NULL;
return -1;
}
if (ast_sorcery_observer_add(ast_sip_get_sorcery(), "aor", &observer_callbacks_options)) {
pjsip_endpt_unregister_module(ast_sip_get_pjsip_endpoint(), &options_module);
ao2_cleanup(sched_qualifies);
sched_qualifies = NULL;
return -1;
}
internal_sip_register_endpoint_formatter(&contact_status_formatter);
ast_manager_register_xml("PJSIPQualify", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, ami_sip_qualify);
ast_cli_register_multiple(cli_options, ARRAY_LEN(cli_options));
update_all_unqualified_endpoints();
qualify_and_schedule_all();
return 0;
}
开发者ID:litnimax,项目名称:asterisk,代码行数:46,代码来源:pjsip_options.c
示例18: init_subscription
pj_status_t init_subscription(RegStore* registrar_store,
RegStore* remote_reg_store,
HSSConnection* hss_connection,
ACRFactory* rfacr_factory,
AnalyticsLogger* analytics_logger)
{
pj_status_t status;
store = registrar_store;
remote_store = remote_reg_store;
hss = hss_connection;
acr_factory = rfacr_factory;
analytics = analytics_logger;
status = pjsip_endpt_register_module(stack_data.endpt, &mod_subscription);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
return status;
}
开发者ID:oldurecu,项目名称:sprout,代码行数:19,代码来源:subscription.cpp
示例19: init_common_sip_processing
pj_status_t
init_common_sip_processing(LoadMonitor* load_monitor_arg,
SNMP::CounterByScopeTable* requests_counter_arg,
SNMP::CounterByScopeTable* overload_counter_arg,
HealthChecker* health_checker_arg)
{
// Register the stack modules.
pjsip_endpt_register_module(stack_data.endpt, &mod_common_processing);
stack_data.sas_logging_module_id = mod_common_processing.id;
overload_counter = overload_counter_arg;
requests_counter = requests_counter_arg;
load_monitor = load_monitor_arg;
health_checker = health_checker_arg;
return PJ_SUCCESS;
}
开发者ID:ClearwaterCore,项目名称:sprout,代码行数:19,代码来源:common_sip_processing.cpp
示例20: init_registrar
pj_status_t init_registrar(RegStore* registrar_store,
RegStore* remote_reg_store,
HSSConnection* hss_connection,
AnalyticsLogger* analytics_logger,
ACRFactory* rfacr_factory,
int cfg_max_expires)
{
pj_status_t status;
store = registrar_store;
remote_store = remote_reg_store;
hss = hss_connection;
analytics = analytics_logger;
max_expires = cfg_max_expires;
acr_factory = rfacr_factory;
// Construct a Service-Route header pointing at the S-CSCF ready to be added
// to REGISTER 200 OK response.
pjsip_sip_uri* service_route_uri = (pjsip_sip_uri*)
pjsip_parse_uri(stack_data.pool,
stack_data.scscf_uri.ptr,
stack_data.scscf_uri.slen,
0);
service_route_uri->lr_param = 1;
// Add the orig parameter. The UE must provide this back on future messages
// to ensure we perform originating processing.
pjsip_param *orig_param = PJ_POOL_ALLOC_T(stack_data.pool, pjsip_param);
pj_strdup(stack_data.pool, &orig_param->name, &STR_ORIG);
pj_strdup2(stack_data.pool, &orig_param->value, "");
pj_list_insert_after(&service_route_uri->other_param, orig_param);
service_route = pjsip_route_hdr_create(stack_data.pool);
service_route->name = STR_SERVICE_ROUTE;
service_route->sname = pj_str("");
service_route->name_addr.uri = (pjsip_uri*)service_route_uri;
status = pjsip_endpt_register_module(stack_data.endpt, &mod_registrar);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
return status;
}
开发者ID:jmmL,项目名称:sprout,代码行数:42,代码来源:registrar.cpp
注:本文中的pjsip_endpt_register_module函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论