本文整理汇总了C++中rpc_register_array函数的典型用法代码示例。如果您正苦于以下问题:C++ rpc_register_array函数的具体用法?C++ rpc_register_array怎么用?C++ rpc_register_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rpc_register_array函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: mod_init
/**
* init module function
*/
static int mod_init(void)
{
evrexec_task_t *it;
if(rpc_register_array(evr_rpc_methods)!=0) {
LM_ERR("failed to register RPC commands\n");
return -1;
}
if(_evrexec_list==NULL)
return 0;
/* init faked sip msg */
if(faked_msg_init()<0) {
LM_ERR("failed to init evrexec local sip msg\n");
return -1;
}
/* register additional processes */
it = _evrexec_list;
while(it) {
register_procs(it->workers);
it = it->next;
}
return 0;
}
开发者ID:adubovikov,项目名称:kamailio,代码行数:30,代码来源:evrexec_mod.c
示例2: ds_init_rpc
/**
* register RPC commands
*/
static int ds_init_rpc(void)
{
if(rpc_register_array(dispatcher_rpc_cmds) != 0) {
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:TheGrandWazoo,项目名称:kamailio,代码行数:11,代码来源:dispatcher.c
示例3: statsc_init_rpc
int statsc_init_rpc(void)
{
if (rpc_register_array(statsc_rpc)!=0) {
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:TheGrandWazoo,项目名称:kamailio,代码行数:8,代码来源:statsc_mod.c
示例4: domain_init_rpc
static int domain_init_rpc(void)
{
if (rpc_register_array(domain_rpc_list) != 0) {
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:khaledaljorreshy1993,项目名称:kamailio,代码行数:8,代码来源:domain_mod.c
示例5: sctp_register_rpc
int sctp_register_rpc(void)
{
if(rpc_register_array(sctp_rpc_methods) != 0) {
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:adubovikov,项目名称:kamailio,代码行数:9,代码来源:sctp_rpc.c
示例6: permissions_init_rpc
static int permissions_init_rpc(void)
{
if (rpc_register_array(permissions_rpc)!=0)
{
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:Jared-Prime,项目名称:kamailio,代码行数:9,代码来源:permissions.c
示例7: presence_init_rpc
static int presence_init_rpc(void)
{
if (rpc_register_array(presence_rpc)!=0)
{
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:AlessioCasco,项目名称:kamailio,代码行数:9,代码来源:presence.c
示例8: mqueue_rpc_init
static int mqueue_rpc_init(void)
{
if (rpc_register_array(mqueue_rpc)!=0)
{
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:TheGrandWazoo,项目名称:kamailio,代码行数:9,代码来源:mqueue_mod.c
示例9: curl_init_rpc
/**
* register RPC commands
*/
int curl_init_rpc(void)
{
if (rpc_register_array(curl_rpc_cmds)!=0)
{
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:kamailio,项目名称:kamailio,代码行数:12,代码来源:curlrpc.c
示例10: ap_init_rpc
/**
* register RPC commands
*/
static int ap_init_rpc(void)
{
if (rpc_register_array(app_perl_rpc_cmds)!=0)
{
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:carlosp,项目名称:kamailio,代码行数:12,代码来源:app_perl_mod.c
示例11: pkg_proc_stats_init_rpc
int pkg_proc_stats_init_rpc(void)
{
if (rpc_register_array(kex_pkg_rpc)!=0)
{
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:AndreyRybkin,项目名称:kamailio,代码行数:9,代码来源:pkg_stats.c
示例12: xcap_client_init_rpc
/**
* register RPC commands
*/
static int xcap_client_init_rpc(void)
{
if (rpc_register_array(xcap_client_rpc_cmds)!=0)
{
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:TheGrandWazoo,项目名称:kamailio,代码行数:12,代码来源:xcap_client.c
示例13: matrix_rpc_init
int matrix_rpc_init(void)
{
if (rpc_register_array(matrix_rpc_cmds)!=0)
{
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:GreenfieldTech,项目名称:kamailio,代码行数:10,代码来源:matrix.c
示例14: mod_init
/*! \brief
* Module initialization function
*/
static int mod_init(void) {
if (usrloc_debug){
LM_INFO("Logging usrloc records to %.*s\n", usrloc_debug_file.len, usrloc_debug_file.s);
debug_file = fopen(usrloc_debug_file.s, "a");
fprintf(debug_file, "starting\n");
fflush(debug_file);
}
#ifdef STATISTICS
/* register statistics */
if (register_module_stats( exports.name, mod_stats)!=0 ) {
LM_ERR("failed to register core statistics\n");
return -1;
}
#endif
/* Compute the lengths of string parameters */
usrloc_debug_file.len = strlen(usrloc_debug_file.s);
if (ul_hash_size <= 1)
ul_hash_size = 512;
else
ul_hash_size = 1 << ul_hash_size;
ul_locks_no = ul_hash_size;
if (ul_init_locks() != 0) {
LM_ERR("locks array initialization failed\n");
return -1;
}
/* Regsiter RPC */
if (rpc_register_array(ul_rpc) != 0) {
LM_ERR("failed to register RPC commands\n");
return -1;
}
/* Register cache timer */
LM_DBG("Registering cache timer");
register_timer(timer, 0, timer_interval);
/* init the callbacks list */
if (init_ulcb_list() < 0) {
LM_ERR("usrloc/callbacks initialization failed\n");
return -1;
}
init_flag = 1;
return 0;
}
开发者ID:aallamaa,项目名称:kamailio,代码行数:54,代码来源:ul_mod.c
示例15: corex_init_rpc
/**
* register RPC commands
*/
int corex_init_rpc(void)
{
if (cfg_register_ctx(&_cfg_corex_ctx, NULL)) {
LOG(L_ERR, "failed to register cfg context\n");
return -1;
}
if (rpc_register_array(corex_rpc_cmds)!=0)
{
LM_ERR("failed to register RPC commands\n");
return -1;
}
return 0;
}
开发者ID:4N7HR4X,项目名称:kamailio,代码行数:17,代码来源:corex_rpc.c
示例16: km_mod_init
int km_mod_init(void)
{
if (rpc_register_array(k_rpc_methods)!=0) {
LM_ERR("failed to register RPC commands\n");
return -1;
}
if (strlen(km_flat_delimiter) != 1) {
LM_ERR("delimiter has to be exactly one character\n");
return -1;
}
km_flat_rotate = (time_t*)shm_malloc(sizeof(time_t));
if (!km_flat_rotate) {
LM_ERR("no shared memory left\n");
return -1;
}
*km_flat_rotate = time(0);
km_local_timestamp = *km_flat_rotate;
return 0;
}
开发者ID:GreenfieldTech,项目名称:kamailio,代码行数:23,代码来源:km_flatstore_mod.c
示例17: mod_init
/*! \brief
* Module initialization function
*/
static int mod_init(void)
{
int i;
udomain_t* d;
if(sruid_init(&_ul_sruid, '-', "ulcx", SRUID_INC)<0)
return -1;
#ifdef STATISTICS
/* register statistics */
if (register_module_stats( exports.name, mod_stats)!=0 ) {
LM_ERR("failed to register core statistics\n");
return -1;
}
#endif
if(register_mi_mod(exports.name, mi_cmds)!=0)
{
LM_ERR("failed to register MI commands\n");
return -1;
}
if (rpc_register_array(ul_rpc)!=0)
{
LM_ERR("failed to register RPC commands\n");
return -1;
}
/* Compute the lengths of string parameters */
ruid_col.len = strlen(ruid_col.s);
user_col.len = strlen(user_col.s);
domain_col.len = strlen(domain_col.s);
contact_col.len = strlen(contact_col.s);
expires_col.len = strlen(expires_col.s);
q_col.len = strlen(q_col.s);
callid_col.len = strlen(callid_col.s);
cseq_col.len = strlen(cseq_col.s);
flags_col.len = strlen(flags_col.s);
cflags_col.len = strlen(cflags_col.s);
user_agent_col.len = strlen(user_agent_col.s);
received_col.len = strlen(received_col.s);
path_col.len = strlen(path_col.s);
sock_col.len = strlen(sock_col.s);
methods_col.len = strlen(methods_col.s);
instance_col.len = strlen(instance_col.s);
reg_id_col.len = strlen(reg_id_col.s);
last_mod_col.len = strlen(last_mod_col.s);
db_url.len = strlen(db_url.s);
if(ul_xavp_contact_name.s!=NULL)
ul_xavp_contact_name.len = strlen(ul_xavp_contact_name.s);
if(ul_hash_size<=1)
ul_hash_size = 512;
else
ul_hash_size = 1<<ul_hash_size;
ul_locks_no = ul_hash_size;
/* check matching mode */
switch (matching_mode) {
case CONTACT_ONLY:
case CONTACT_CALLID:
case CONTACT_PATH:
break;
default:
LM_ERR("invalid matching mode %d\n", matching_mode);
}
if(ul_init_locks()!=0)
{
LM_ERR("locks array initialization failed\n");
return -1;
}
/* Register cache timer */
if(ul_timer_procs<=0)
{
if (timer_interval > 0)
register_timer(ul_core_timer, 0, timer_interval);
}
else
register_sync_timers(ul_timer_procs);
/* init the callbacks list */
if ( init_ulcb_list() < 0) {
LM_ERR("usrloc/callbacks initialization failed\n");
return -1;
}
/* Shall we use database ? */
if (db_mode != NO_DB) { /* Yes */
if (db_bind_mod(&db_url, &ul_dbf) < 0) { /* Find database module */
LM_ERR("failed to bind database module\n");
return -1;
}
if (!DB_CAPABILITY(ul_dbf, DB_CAP_ALL)) {
LM_ERR("database module does not implement all functions"
//.........这里部分代码省略.........
开发者ID:gbour,项目名称:kamailio,代码行数:101,代码来源:ul_mod.c
示例18: mod_init
static int mod_init(void)
{
int method;
if (tls_disable){
LOG(L_WARN, "tls support is disabled "
"(set enable_tls=1 in the config to enable it)\n");
return 0;
}
if (fix_tls_cfg(&default_tls_cfg) < 0 ) {
ERR("initial tls configuration fixup failed\n");
return -1;
}
/* declare configuration */
if (cfg_declare("tls", tls_cfg_def, &default_tls_cfg,
cfg_sizeof(tls), (void **)&tls_cfg)) {
ERR("failed to register the configuration\n");
return -1;
}
/* Convert tls_method parameter to integer */
method = tls_parse_method(&cfg_get(tls, tls_cfg, method));
if (method < 0) {
ERR("Invalid tls_method parameter value\n");
return -1;
}
/* fill mod_params */
mod_params.method = method;
mod_params.verify_cert = cfg_get(tls, tls_cfg, verify_cert);
mod_params.verify_depth = cfg_get(tls, tls_cfg, verify_depth);
mod_params.require_cert = cfg_get(tls, tls_cfg, require_cert);
mod_params.pkey_file = cfg_get(tls, tls_cfg, private_key);
mod_params.ca_file = cfg_get(tls, tls_cfg, ca_list);
mod_params.crl_file = cfg_get(tls, tls_cfg, crl);
mod_params.cert_file = cfg_get(tls, tls_cfg, certificate);
mod_params.cipher_list = cfg_get(tls, tls_cfg, cipher_list);
mod_params.server_name = cfg_get(tls, tls_cfg, server_name);
tls_domains_cfg =
(tls_domains_cfg_t**)shm_malloc(sizeof(tls_domains_cfg_t*));
if (!tls_domains_cfg) {
ERR("Not enough shared memory left\n");
goto error;
}
*tls_domains_cfg = NULL;
register_select_table(tls_sel);
/* register the rpc interface */
if (rpc_register_array(tls_rpc)!=0) {
LOG(L_ERR, "failed to register RPC commands\n");
goto error;
}
/* if (init_tls() < 0) return -1; */
tls_domains_cfg_lock = lock_alloc();
if (tls_domains_cfg_lock == 0) {
ERR("Unable to create TLS configuration lock\n");
goto error;
}
if (lock_init(tls_domains_cfg_lock) == 0) {
lock_dealloc(tls_domains_cfg_lock);
ERR("Unable to initialize TLS configuration lock\n");
goto error;
}
if (tls_ct_wq_init() < 0) {
ERR("Unable to initialize TLS buffering\n");
goto error;
}
if (cfg_get(tls, tls_cfg, config_file).s) {
*tls_domains_cfg =
tls_load_config(&cfg_get(tls, tls_cfg, config_file));
if (!(*tls_domains_cfg)) goto error;
} else {
*tls_domains_cfg = tls_new_cfg();
if (!(*tls_domains_cfg)) goto error;
}
if (tls_check_sockets(*tls_domains_cfg) < 0)
goto error;
#ifndef OPENSSL_NO_ECDH
LM_INFO("With ECDH-Support!\n");
#endif
#ifndef OPENSSL_NO_DH
LM_INFO("With Diffie Hellman\n");
#endif
tls_lookup_event_routes();
return 0;
error:
destroy_tls_h();
return -1;
}
开发者ID:AlessioCasco,项目名称:kamailio,代码行数:92,代码来源:tls_mod.c
示例19: sca_mod_init
static int sca_mod_init(void)
{
sca = (sca_mod *) shm_malloc(sizeof(sca_mod));
if (sca == NULL) {
LM_ERR("Failed to shm_malloc module object\n");
return (-1);
}
memset(sca, 0, sizeof(sca_mod));
if (sca_set_config(sca) != 0) {
LM_ERR("Failed to set configuration\n");
goto error;
}
if (rpc_register_array(sca_rpc) != 0) {
LM_ERR("Failed to register RPC commands\n");
goto error;
}
if (sca_bind_srdb1(sca, &dbf) != 0) {
LM_ERR("Failed to initialize required DB API\n");
goto error;
}
if (load_tm_api(&tmb) != 0) {
LM_ERR("Failed to initialize required tm API. Check that the \"tm\" module is loaded before this module.\n");
goto error;
}
sca->tm_api = &tmb;
if (sca_bind_sl(sca, &slb) != 0) {
LM_ERR("Failed to initialize required sl API. Check that the \"sl\" module is loaded before this module.\n");
goto error;
}
if (sca_hash_table_create(&sca->subscriptions, sca->cfg->hash_table_size)
!= 0) {
LM_ERR("Failed to create subscriptions hash table\n");
goto error;
}
if (sca_hash_table_create(&sca->appearances, sca->cfg->hash_table_size)
!= 0) {
LM_ERR("Failed to create appearances hash table\n");
goto error;
}
sca_subscriptions_restore_from_db(sca);
register_timer(sca_subscription_purge_expired, sca,
sca->cfg->purge_expired_interval);
register_timer(sca_appearance_purge_stale, sca,
sca->cfg->purge_expired_interval);
// register separate timer process to write subscriptions to DB.
// move to 3.3+ timer API (register_basic_timer) at some point.
// timer process forks in sca_child_init, above.
register_dummy_timers(1);
LM_INFO("SCA initialized \n");
return (0);
error: if (sca != NULL) {
if (sca->cfg != NULL) {
shm_free(sca->cfg);
}
if (sca->subscriptions != NULL) {
sca_hash_table_free(sca->subscriptions);
}
if (sca->appearances != NULL) {
sca_hash_table_free(sca->appearances);
}
shm_free(sca);
sca = NULL;
}
return (-1);
}
开发者ID:btriller,项目名称:kamailio,代码行数:78,代码来源:sca.c
示例20: mod_init
static int mod_init(void) {
pv_spec_t avp_spec;
str s;
bind_usrloc_t bind_usrloc;
qvalue_t dq;
if (rpc_register_array(reg_rpc) != 0) {
LM_ERR("failed to register RPC commands\n");
return -1;
}
callback_singleton = shm_malloc(sizeof (int));
*callback_singleton = 0;
/*build the required strings */
scscf_serviceroute_uri_str.s =
(char*) pkg_malloc(orig_prefix.len + scscf_name_str.len);
if (!scscf_serviceroute_uri_str.s) {
LM_ERR("Unable to allocate memory for service route uri\n");
return -1;
}
if (contact_expires_buffer_percentage < 0 || contact_expires_buffer_percentage > 90) {
LM_ERR("contact expires percentage not valid, must be >0 and <=90");
return -1;
}
memcpy(scscf_serviceroute_uri_str.s, orig_prefix.s, orig_prefix.len);
scscf_serviceroute_uri_str.len = orig_prefix.len;
if (scscf_name_str.len > 4
&& strncasecmp(scscf_name_str.s, "sip:", 4) == 0) {
memcpy(scscf_serviceroute_uri_str.s + scscf_serviceroute_uri_str.len,
scscf_name_str.s + 4, scscf_name_str.len - 4);
scscf_serviceroute_uri_str.len += scscf_name_str.len - 4;
} else {
memcpy(scscf_serviceroute_uri_str.s + scscf_serviceroute_uri_str.len,
scscf_name_str.s, scscf_name_str.len);
scscf_serviceroute_uri_str.len += scscf_name_str.len;
}
pv_tmx_data_init();
/* </build required strings> */
#ifdef STATISTICS
/* register statistics */
if (register_module_stats(exports.name, mod_stats) != 0) {
LM_ERR("failed to register core statistics\n");
return -1;
}
if (!register_stats()) {
LM_ERR("Unable to register statistics\n");
return -1;
}
#endif
/*register space for notification processors*/
register_procs(notification_processes);
cfg_register_child(notification_processes);
/* bind the SL API */
if (sl_load_api(&slb) != 0) {
LM_ERR("cannot bind to SL API\n");
return -1;
}
/* load the TM API */
if (load_tm_api(&tmb) != 0) {
LM_ERR("can't load TM API\n");
return -1;
}
/* load the CDP API */
if (load_cdp_api(&cdpb) != 0) {
LM_ERR("can't load CDP API\n");
return -1;
}
cdp_avp = load_cdp_avp();
if (!cdp_avp) {
LM_ERR("can't load CDP_AVP API\n");
return -1;
}
if (cfg_declare("registrar", registrar_cfg_def, &default_registrar_cfg,
cfg_sizeof(registrar), ®istrar_cfg)) {
LM_ERR("Fail to declare the configuration\n");
return -1;
}
if (rcv_avp_param && *rcv_avp_param) {
s.s = rcv_avp_param;
s.len = strlen(s.s);
if (pv_parse_spec(&s, &avp_spec) == 0 || avp_spec.type != PVT_AVP) {
LM_ERR("malformed or non AVP %s AVP definition\n", rcv_avp_param);
return -1;
}
if (pv_get_avp_name(0, &avp_spec.pvp, &rcv_avp_name, &rcv_avp_type)
//.........这里部分代码省略.........
开发者ID:4N7HR4X,项目名称:kamailio,代码行数:101,代码来源:reg_mod.c
注:本文中的rpc_register_array函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论