本文整理汇总了C++中usrloc_api_t::unlock_contact_slot_i方法的典型用法代码示例。如果您正苦于以下问题:C++ usrloc_api_t::unlock_contact_slot_i方法的具体用法?C++ usrloc_api_t::unlock_contact_slot_i怎么用?C++ usrloc_api_t::unlock_contact_slot_i使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类usrloc_api_t
的用法示例。
在下文中一共展示了usrloc_api_t::unlock_contact_slot_i方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cxdx_process_rtr
AAAMessage* cxdx_process_rtr(AAAMessage *rtr) {
LM_DBG("Processing RTR");
AAAMessage *rta_msg;
AAA_AVP* avp;
str public_id;
impurecord_t* r;
int res = 0;
udomain_t* udomain;
impu_contact_t *impucontact;
rta_msg = cdpb.AAACreateResponse(rtr);//session ID?
if (!rta_msg) return 0;
avp = cxdx_get_next_public_identity(rtr,0,AVP_IMS_Public_Identity,IMS_vendor_id_3GPP,__FUNCTION__);
if(avp==0){
LM_WARN("RTR received with only IMPI (username AVP) - currently S-CSCF does not support this kind of RTR\n");
return 0;
//TODO add support for receiving RTR with IMPI
//get all impus related to this impu
//get all contacts related to each impu
//set the contact expire for each contact to now
}else{
public_id=avp->data;
LM_DBG("RTR received with IMPU [%.*s] in public identity AVP - this is supported\n", public_id.len, public_id.s);
//TODO this should be a configurable module param
if (ul.register_udomain(domain, &udomain) < 0) {
LM_ERR("Unable to register usrloc domain....aborting\n");
return 0;
}
ul.lock_udomain(udomain, &public_id);
res = ul.get_impurecord(udomain, &public_id, &r);
if (res != 0) {
LM_WARN("Strange, '%.*s' Not found in usrloc\n", public_id.len, public_id.s);
ul.unlock_udomain(udomain, &public_id);
//no point in continuing
return 0;
}
impucontact = r->linked_contacts.head;
while (impucontact) {
LM_DBG("Deleting contact with AOR [%.*s]\n", impucontact->contact->aor.len, impucontact->contact->aor.s);
ul.lock_contact_slot_i(impucontact->contact->sl);
impucontact->contact->state = CONTACT_DELETE_PENDING;
if (r->shead) {
//send NOTIFY to all subscribers of this IMPU.
notify_subscribers(r, 0, 0);
}
impucontact->contact->state = CONTACT_DELETED;
ul.unlock_contact_slot_i(impucontact->contact->sl);
impucontact = impucontact->next;
}
ul.unlock_udomain(udomain, &public_id);
while(cdpb.AAAGetNextAVP(avp) && (avp=cxdx_get_next_public_identity(rtr,cdpb.AAAGetNextAVP(avp),AVP_IMS_Public_Identity,IMS_vendor_id_3GPP,__FUNCTION__))!=0){
public_id=avp->data;
LM_DBG("RTR also has public id [%.*s]\n", public_id.len, public_id.s);
ul.lock_udomain(udomain, &public_id);
res = ul.get_impurecord(udomain, &public_id, &r);
if (res != 0) {
LM_WARN("Strange, '%.*s' Not found in usrloc\n", public_id.len, public_id.s);
ul.unlock_udomain(udomain, &public_id);
//no point in continuing
return 0;
}
impucontact = r->linked_contacts.head;
while (impucontact) {
LM_DBG("Deleting contact with AOR [%.*s]\n", impucontact->contact->aor.len, impucontact->contact->aor.s);
ul.lock_contact_slot_i(impucontact->contact->sl);
impucontact->contact->state = CONTACT_DELETE_PENDING;
if (r->shead) {
//send NOTIFY to all subscribers of this IMPU.
notify_subscribers(r, 0, 0);
}
impucontact->contact->state = CONTACT_DELETED;
ul.unlock_contact_slot_i(impucontact->contact->sl);
impucontact = impucontact->next;
}
ul.unlock_udomain(udomain, &public_id);
}
}
cxdx_add_vendor_specific_appid(rta_msg,IMS_vendor_id_3GPP,IMS_Cx,0 /*IMS_Cx*/);
cxdx_add_auth_session_state(rta_msg,1);
/* send an RTA back to the HSS */
cxdx_add_result_code(rta_msg,DIAMETER_SUCCESS);
return rta_msg;
}