Skip to content

Commit

Permalink
Merge pull request #336 from andrei-datcu/usrloc_events
Browse files Browse the repository at this point in the history
[usrloc] Added AOR parameter for E_UL_CONTACT_* events
  • Loading branch information
bogdan-iancu committed Sep 16, 2014
2 parents 2ff79d9 + e4a10ed commit 1043900
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/usrloc/ucontact.c
Expand Up @@ -301,7 +301,7 @@ int mem_update_ucontact(ucontact_t* _c, ucontact_info_t* _ci)
_c->next_hop.name.len, _c->next_hop.name.s);

ul_raise_contact_event(ei_c_update_id, &_c->c, &_c->callid,
&_c->received, _c->cseq);
&_c->received, _c->aor, _c->cseq);

return 0;
}
Expand Down
14 changes: 13 additions & 1 deletion modules/usrloc/udomain.c
Expand Up @@ -140,6 +140,7 @@ static evi_params_p ul_event_params;
static evi_param_p ul_aor_param;
static evi_params_p ul_contact_event_params;
static evi_param_p ul_c_addr_param, ul_c_callid_param;
static evi_param_p ul_c_aor_param;
static evi_param_p ul_c_recv_param;
static evi_param_p ul_c_cseq_param;

Expand Down Expand Up @@ -203,6 +204,12 @@ int ul_event_init(void)
return -1;
}

ul_c_aor_param = evi_param_create(ul_contact_event_params, &ei_aor_name);
if (!ul_c_aor_param) {
LM_ERR("cannot create contact aor parameter\n");
return -1;
}

ul_c_callid_param = evi_param_create(ul_contact_event_params, &ei_callid_name);
if (!ul_c_callid_param) {
LM_ERR("cannot create callid parameter\n");
Expand Down Expand Up @@ -242,7 +249,7 @@ static void ul_raise_event(event_id_t _e, struct urecord* _r)
}

void ul_raise_contact_event(event_id_t _e, str *addr, str *callid, str *recv,
int cseq)
str *aor, int cseq)
{
if (_e == EVI_ERROR) {
LM_ERR("event not yet registered %d\n", _e);
Expand All @@ -253,6 +260,11 @@ void ul_raise_contact_event(event_id_t _e, str *addr, str *callid, str *recv,
return;
}

if (evi_param_set_str(ul_c_aor_param, aor) < 0) {
LM_ERR("cannot set contact aor parameter\n");
return;
}

if (evi_param_set_str(ul_c_callid_param, callid) < 0) {
LM_ERR("cannot set callid parameter\n");
return;
Expand Down
2 changes: 1 addition & 1 deletion modules/usrloc/udomain.h
Expand Up @@ -182,6 +182,6 @@ int delete_urecord(udomain_t* _d, str* _aor, struct urecord* _r,


void ul_raise_contact_event(event_id_t _e, str *addr, str *callid, str *recv,
int cseq);
str *aor, int cseq);

#endif /* UDOMAIN_H */
4 changes: 2 additions & 2 deletions modules/usrloc/urecord.c
Expand Up @@ -177,7 +177,7 @@ ucontact_t* mem_insert_ucontact(urecord_t* _r, str* _c, ucontact_info_t* _ci)
}

ul_raise_contact_event(ei_c_ins_id, &c->c, &c->callid, &c->received,
c->cseq);
c->aor, c->cseq);
return c;
}

Expand All @@ -199,7 +199,7 @@ void mem_remove_ucontact(urecord_t* _r, ucontact_t* _c)
}
}
ul_raise_contact_event(ei_c_del_id, &_c->c, &_c->callid, &_c->received,
_c->cseq);
_c->aor, _c->cseq);
}


Expand Down

0 comments on commit 1043900

Please sign in to comment.