Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

presence: allow use of $subs in notify process #944

Merged
merged 1 commit into from Jan 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/modules/presence/notify.c
Expand Up @@ -55,6 +55,7 @@ int goto_on_notify_reply=-1;

extern int pres_local_log_level;
extern int pres_local_log_facility;
extern subs_t* _pres_subs_last_sub;

c_back_param* shm_dup_cbparam(subs_t*);
void free_cbparam(c_back_param* cb_param);
Expand Down Expand Up @@ -1498,6 +1499,7 @@ int send_notify_request(subs_t* subs, subs_t * watcher_subs,
str* final_body= NULL;
uac_req_t uac_r;
str* aux_body = NULL;
subs_t* backup_subs = NULL;

LM_DBG("dialog info:\n");
printf_subs(subs);
Expand Down Expand Up @@ -1618,9 +1620,13 @@ int send_notify_request(subs_t* subs, subs_t * watcher_subs,
LM_DBG("expires %d status %d\n", subs->expires, subs->status);
cb_param = mem_copy_subs(subs, SHM_MEM_TYPE);

backup_subs = _pres_subs_last_sub;
_pres_subs_last_sub = subs;

set_uac_req(&uac_r, &met, &str_hdr, notify_body, td, TMCB_LOCAL_COMPLETED,
p_tm_callback, (void*)cb_param);
result = tmb.t_request_within(&uac_r);
_pres_subs_last_sub = backup_subs;
if(result< 0)
{
LM_ERR("in function tmb.t_request_within\n");
Expand Down