Skip to content

Commit

Permalink
Merge pull request #2296 from alexyosifov/ims_registrar_scscf_event_reg
Browse files Browse the repository at this point in the history
ims_registrar_scscf: pass event type as parameter
  • Loading branch information
miconda committed May 7, 2020
2 parents 465211b + 1c7b760 commit d35e976
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/modules/ims_registrar_scscf/cxdx_callbacks.c
Expand Up @@ -93,7 +93,7 @@ AAAMessage* cxdx_process_rtr(AAAMessage *rtr) {
impucontact->contact->state = CONTACT_DELETE_PENDING;
if (r->shead) {
//send NOTIFY to all subscribers of this IMPU.
notify_subscribers(r, 0, 0);
notify_subscribers(r, 0, 0, IMS_REGISTRAR_CONTACT_UNREGISTERED);
}
impucontact->contact->state = CONTACT_DELETED;
ul.unlock_contact_slot_i(impucontact->contact->sl);
Expand Down Expand Up @@ -122,7 +122,7 @@ AAAMessage* cxdx_process_rtr(AAAMessage *rtr) {
impucontact->contact->state = CONTACT_DELETE_PENDING;
if (r->shead) {
//send NOTIFY to all subscribers of this IMPU.
notify_subscribers(r, 0, 0);
notify_subscribers(r, 0, 0, IMS_REGISTRAR_CONTACT_UNREGISTERED);
}
impucontact->contact->state = CONTACT_DELETED;
ul.unlock_contact_slot_i(impucontact->contact->sl);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/ims_registrar_scscf/reg_rpc.c
Expand Up @@ -66,7 +66,7 @@ static void reg_rpc_dereg_impu(rpc_t* rpc, void* ctx)
impucontact->contact->state = CONTACT_DELETE_PENDING;
if (impu_rec->shead) {
//send NOTIFY to all subscribers of this IMPU.
notify_subscribers(impu_rec, 0, 0);
notify_subscribers(impu_rec, 0, 0, IMS_REGISTRAR_CONTACT_UNREGISTERED);
}
impucontact->contact->state = CONTACT_DELETED;
ul.unlock_contact_slot_i(impucontact->contact->sl);
Expand Down
6 changes: 3 additions & 3 deletions src/modules/ims_registrar_scscf/registrar_notify.c
Expand Up @@ -534,8 +534,8 @@ int event_reg(udomain_t* _d, impurecord_t* r_passed, int event_type, str *presen
}
}

int notify_subscribers(impurecord_t* impurecord, str *explit_dereg_contact, int num_explit_dereg_contact) {
event_reg(0, impurecord, IMS_REGISTRAR_CONTACT_UNREGISTERED, 0, 0, explit_dereg_contact, num_explit_dereg_contact);
int notify_subscribers(impurecord_t* impurecord, str *explit_dereg_contact, int num_explit_dereg_contact, int event_type) {
event_reg(0, impurecord, event_type, 0, 0, explit_dereg_contact, num_explit_dereg_contact);

return 0;
}
Expand Down Expand Up @@ -593,7 +593,7 @@ int process_contact(ims_subscription* subscription, udomain_t * _d, int expires,
ucontact->state = CONTACT_DELETE_PENDING;
if (implicit_impurecord->shead) {
//send NOTIFY to all subscribers of this IMPU.
notify_subscribers(implicit_impurecord, 0, 0);
notify_subscribers(implicit_impurecord, 0, 0, IMS_REGISTRAR_CONTACT_UNREGISTERED);
}
ul.unlock_contact_slot(&contact_uri);
// if (ul.unlink_contact_from_impu(implicit_impurecord, ucontact, 1, 0 /*implicit dereg of contact from IMPU*/) != 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/ims_registrar_scscf/registrar_notify.h
Expand Up @@ -161,6 +161,6 @@ void notify_destroy();
int aor_to_contact(str* aor, str* contact);
int contact_port_ip_match(str *c1, str *c2);

int notify_subscribers(impurecord_t* impurecord, str *explit_dereg_contact, int num_explit_dereg_contact);
int notify_subscribers(impurecord_t* impurecord, str *explit_dereg_contact, int num_explit_dereg_contact, int event_type);

#endif //S_CSCF_REGISTRAR_NOTIFY_H_
6 changes: 3 additions & 3 deletions src/modules/ims_registrar_scscf/save.c
Expand Up @@ -830,7 +830,7 @@ int update_contacts(struct sip_msg* msg, udomain_t* _d,
//now build the contact buffer to be include in the reply message and unlock
build_contact(impu_rec, contact_header);
build_p_associated_uri(*s);
notify_subscribers(impu_rec, 0, 0);
notify_subscribers(impu_rec, 0, 0, IMS_REGISTRAR_CONTACT_REGISTERED);
ul.unlock_udomain(_d, public_identity);
break;
case AVP_IMS_SAR_RE_REGISTRATION:
Expand Down Expand Up @@ -913,7 +913,7 @@ int update_contacts(struct sip_msg* msg, udomain_t* _d,
if (ul.update_impurecord(_d, public_identity, 0, reg_state, -1 /*do not change send sar on delete */, 0 /*this is explicit so barring must be 0*/, 0, s, ccf1, ccf2, ecf1, ecf2, &impu_rec) != 0) {
LM_ERR("Unable to update explicit impurecord for <%.*s>\n", public_identity->len, public_identity->s);
}
notify_subscribers(impu_rec, 0, 0);
notify_subscribers(impu_rec, 0, 0, IMS_REGISTRAR_CONTACT_REGISTERED);
ul.unlock_udomain(_d, public_identity);
break;
case AVP_IMS_SAR_USER_DEREGISTRATION:
Expand Down Expand Up @@ -1011,7 +1011,7 @@ int update_contacts(struct sip_msg* msg, udomain_t* _d,
// s = s->next;
// }
// }
notify_subscribers(tmp_impu_rec, (str*) explicit_dereg_contact, num_explicit_dereg_contact);
notify_subscribers(tmp_impu_rec, (str*) explicit_dereg_contact, num_explicit_dereg_contact, IMS_REGISTRAR_CONTACT_UNREGISTERED);

for (h = msg->contact; h; h = h->next) {
if (h->type == HDR_CONTACT_T && h->parsed) {
Expand Down

0 comments on commit d35e976

Please sign in to comment.