Oh, you were talking about the BYEs that are internally generated by 'dialog'. In that case, ignore my advice; it's not applicable, because locally generated BYEs will not have the RR header and this won't work.
In those situations, in my personal opinion, your best bet is to use a database-side UNIQUE constraint or trigger to ensure that only one BYE is logged for any given Call-ID. Otherwise, you're going to have to do some sort of internal statekeeping with 'htable' or what have you.
You might be able to set $dlg_vars[1] indicating who is the callee and who is the caller, as well. However, I am not sure if you will have access to them inside the local event_route. That's a good question.
[1] http://www.kamailio.org/wiki/cookbooks/4.1.x/pseudovariables#dlg_var_key
On 03/28/2014 03:56 AM, Alex Balashov wrote:
On 03/28/2014 03:53 AM, Kelvin Chua wrote:
I have a situation here,
when a dialog expires, it sends a BYE to both call legs and this does not generate an entry on acc table.
however, when i use acc_db_request() on event_route[tm:local-request], i get 2 entries on acc, 1 for the downstream, and 1 for the upstream.
is there a way of handling this so i can only get 1 BYE on acc?
You could take advantage of the rr module's is_direction() function:
http://kamailio.org/docs/modules/4.1.x/modules/rr.html#idp1797400
You will need to set the append_fromtag modparam to make it work:
http://kamailio.org/docs/modules/4.1.x/modules/rr.html#append-fromtag-id
-- Alex