本文整理汇总了C++中pua_api_t::send_subscribe方法的典型用法代码示例。如果您正苦于以下问题:C++ pua_api_t::send_subscribe方法的具体用法?C++ pua_api_t::send_subscribe怎么用?C++ pua_api_t::send_subscribe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pua_api_t
的用法示例。
在下文中一共展示了pua_api_t::send_subscribe方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reginfo_event_process
void reginfo_event_process()
{
publ_info_t publ;
subs_info_t subs;
reginfo_event_t *ev;
for (;;) {
LM_DBG("POPPING REGINFO EVENT\n");
ev = pop_reginfo_event();
LM_DBG("PROCESSING REGINFO EVENT with event [%d]\n", ev->event);
switch (ev->event) {
case REG_EVENT_PUBLISH:
LM_DBG("Sending out-of-band publish with pres_uri [%.*s] publ_id [%.*s] publ_content_type [%.*s] extra_headers [%.*s]"
"expires [%d] event [%d]\n",
ev->pres_uri.len, ev->pres_uri.s, ev->publ_id.len, ev->publ_id.s, ev->publ_content_type.len, ev->publ_content_type.s,
ev->extra_headers.len, ev->extra_headers.s, ev->expires, ev->reg_info_event);
LM_DBG("publ_body [%.*s] \n",
ev->publ_body.len, ev->publ_body.s);
memset(&publ, 0, sizeof(publ_info_t));
publ.pres_uri = &ev->pres_uri;
publ.body = &ev->publ_body;
publ.id = ev->publ_id;
publ.content_type = ev->publ_content_type;
publ.expires = ev->expires;
/* make UPDATE_TYPE, as if this "publish dialog" is not found
by pua it will fallback to INSERT_TYPE anyway */
publ.flag |= ev->flag;
publ.source_flag |= ev->sourge_flag;
publ.event |= ev->reg_info_event;
publ.extra_headers = &ev->extra_headers;
if (pua.send_publish(&publ) < 0) {
LM_ERR("Error while sending publish\n");
}
break;
case REG_EVENT_SUBSCRIBE:
memset(&subs, 0, sizeof(subs_info_t));
subs.remote_target = &ev->subs_remote_target;
subs.pres_uri= &ev->pres_uri;
subs.watcher_uri= &ev->subs_watcher_uri;
subs.expires = ev->expires;
subs.source_flag= ev->sourge_flag;
subs.event= ev->reg_info_event;
subs.contact= &ev->subs_contact;
subs.extra_headers = &ev->extra_headers;
if(ev->subs_outbound_proxy.s) {
subs.outbound_proxy= &ev->subs_outbound_proxy;
}
subs.flag|= ev->flag;
LM_DBG("Sending out-of-band subscribe with remote_target [%.*s] pres_uri [%.*s] subs_watcher_uri [%.*s] subs_contact [%.*s] extra_headers [%.*s] "
"expires [%d] event [%d] flag [%d] source_flag [%d]\n",
subs.remote_target->len, subs.remote_target->s, subs.pres_uri->len, subs.pres_uri->s, subs.watcher_uri->len, subs.watcher_uri->s,
subs.contact->len, subs.contact->s, subs.extra_headers->len, subs.extra_headers->s, subs.expires, subs.event, subs.flag, subs.source_flag);
if(subs.outbound_proxy) {
LM_DBG("subs_outbound_proxy [%.*s]\n",
subs.outbound_proxy->len, subs.outbound_proxy->s);
}
if(pua.send_subscribe(&subs)< 0) {
LM_ERR("while sending subscribe\n");
}
break;
default:
LM_ERR("Unknown REG event.....ignoring\n");
break;
}
free_reginfo_event(ev);
}
}