Skip to content

Commit

Permalink
acc:evi: if the request failed send a missed event
Browse files Browse the repository at this point in the history
In case the acc_evi_request() function was used on a failed request
(code < 300), send a missed event rather than the normal one.

Reported by Trevor Francis from 46Labs

(cherry picked from commit 18f5da0)
  • Loading branch information
razvancrainea committed Nov 19, 2015
1 parent 8fe69f1 commit 7f570e7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/acc/acc_logic.c
Expand Up @@ -272,6 +272,17 @@ int w_acc_evi_request(struct sip_msg *rq, pv_elem_t* comment, char *foo)
env_set_to( rq->to );
env_set_comment( &accp );

if (is_cdr_acc_on(rq) && is_evi_acc_on(rq)) {
env_set_event(acc_cdr_event);
} else if (is_evi_acc_on(rq) && acc_env.code < 300) {
env_set_event(acc_event);
} else if (is_evi_mc_on(rq)) {
env_set_event(acc_missed_event);
} else {
LM_WARN("evi request flags not set\n");
return 1;
}

return acc_evi_request( rq, NULL, 0);
}

Expand Down

0 comments on commit 7f570e7

Please sign in to comment.