当前位置: 首页>>代码示例>>C++>>正文


C++ pua_api_t::register_puacb方法代码示例

本文整理汇总了C++中pua_api_t::register_puacb方法的典型用法代码示例。如果您正苦于以下问题:C++ pua_api_t::register_puacb方法的具体用法?C++ pua_api_t::register_puacb怎么用?C++ pua_api_t::register_puacb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pua_api_t的用法示例。


在下文中一共展示了pua_api_t::register_puacb方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mod_init

/**
 * init module function
 */
static int mod_init(void)
{
	bind_pua_t bind_pua;

	LM_DBG("initializing\n");

	memset (&pua_rpc_api, 0, sizeof(pua_api_t));
	bind_pua= (bind_pua_t)find_export("bind_pua", 1,0);

	if (!bind_pua) {
		LM_ERR("can't find pua\n");
		return -1;
	}

	if (bind_pua(&pua_rpc_api) < 0) {
		LM_ERR("can't bind pua\n");
		return -1;
	}

	if (pua_rpc_api.send_publish == NULL) {
		LM_ERR("could not import send_publish\n");
		return -1;
	}

	if (pua_rpc_api.register_puacb(MI_ASYN_PUBLISH, pua_rpc_publish_callback, NULL) < 0) {
		LM_ERR("could not register callback\n");
		return -1;
	}

	return 0;
}
开发者ID:krys1976,项目名称:kamailio,代码行数:34,代码来源:pua_rpc.c

示例2: mod_init

/**
 * init module function
 */
static int mod_init(void)
{
	bind_pua_t bind_pua;

	if(presence_server.s)
		presence_server.len = strlen(presence_server.s);

	bind_pua= (bind_pua_t)find_export("bind_pua", 1,0);
	if (!bind_pua)
	{
		LM_ERR("Can't bind pua (check if pua module is loaded)\n");
		return -1;
	}

	if (bind_pua(&pua) < 0)
	{
		LM_ERR("Can't bind pua\n");
		return -1;
	}
	if(pua.send_publish == NULL)
	{
		LM_ERR("Could not import send_publish\n");
		return -1;
	}
	pua_send_publish= pua.send_publish;

	if(pua.send_subscribe == NULL)
	{
		LM_ERR("Could not import send_subscribe\n");
		return -1;
	}
	pua_send_subscribe= pua.send_subscribe;

	if(pua.register_puacb(MI_ASYN_PUBLISH, mi_publ_rpl_cback, NULL)< 0)
	{
		LM_ERR("Could not register callback\n");
		return -1;
	}

	return 0;
}
开发者ID:NormB,项目名称:opensips,代码行数:44,代码来源:pua_mi.c

示例3: mod_init


//.........这里部分代码省略.........

	if(XMLNodeGetAttrContentByName== NULL || XMLDocGetNodeByName== NULL ||
		XMLNodeGetNodeByName== NULL || XMLNodeGetNodeContentByName== NULL)
	{
		LM_ERR("libxml wrapper functions could not be bound\n");
		return -1;
	}


	/* bind xmpp */
	bind_xmpp= (bind_xmpp_t)find_export("bind_xmpp", 0,0);
	if (!bind_xmpp)
	{
		LM_ERR("Can't bind xmpp\n");
		return -1;
	}
	if(bind_xmpp(&xmpp_api)< 0)
	{
		LM_ERR("Can't bind xmpp\n");
		return -1;
	}
	if(xmpp_api.xsubscribe== NULL)
	{
		LM_ERR("Could not import xsubscribe from xmpp\n");
		return -1;
	}
	xmpp_subscribe= xmpp_api.xsubscribe;

	if(xmpp_api.xnotify== NULL)
	{
		LM_ERR("Could not import xnotify from xmpp\n");
		return -1;
	}
	xmpp_notify= xmpp_api.xnotify;

	if(xmpp_api.xpacket== NULL)
	{
		LM_ERR("Could not import xnotify from xmpp\n");
		return -1;
	}
	xmpp_packet= xmpp_api.xpacket;

	xmpp_uri_xmpp2sip = xmpp_api.uri_xmpp2sip;
	xmpp_uri_sip2xmpp = xmpp_api.uri_sip2xmpp;

	if(xmpp_api.register_callback== NULL)
	{
		LM_ERR("Could not import register_callback"
				" to xmpp\n");
		return -1;
	}
	if(xmpp_api.register_callback(XMPP_RCV_PRESENCE, pres_Xmpp2Sip, NULL)< 0)
	{
		LM_ERR("ERROR while registering callback"
				" to xmpp\n");
		return -1;
	}

	/* bind pua */
	bind_pua= (bind_pua_t)find_export("bind_pua", 1,0);
	if (!bind_pua)
	{
		LM_ERR("Can't bind pua\n");
		return -1;
	}

	if (bind_pua(&pua) < 0)
	{
		LM_ERR("Can't bind pua\n");
		return -1;
	}
	if(pua.send_publish == NULL)
	{
		LM_ERR("Could not import send_publish\n");
		return -1;
	}
	pua_send_publish= pua.send_publish;

	if(pua.send_subscribe == NULL)
	{
		LM_ERR("Could not import send_subscribe\n");
		return -1;
	}
	pua_send_subscribe= pua.send_subscribe;

	if(pua.is_dialog == NULL)
	{
		LM_ERR("Could not import send_subscribe\n");
		return -1;
	}
	pua_is_dialog= pua.is_dialog;

	if(pua.register_puacb(XMPP_INITIAL_SUBS, Sipreply2Xmpp, NULL)< 0)
	{
		LM_ERR("Could not register callback\n");
		return -1;
	}

	return 0;
}
开发者ID:zhangzheyuk,项目名称:opensips,代码行数:101,代码来源:pua_xmpp.c


注:本文中的pua_api_t::register_puacb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。