Hi Alex,

yes, locally generated BYEs
I was trying to avoid the unique constraint approach as it is not very elegant.
I tried, AVPs, they are not accessible on the event_route[tm:local-request]

however, your idea on $dlg_vars was spot on, why didn't i think of that. Thanks a bunch!

Kelvin Chua


On Fri, Mar 28, 2014 at 12:58 AM, Alex Balashov <abalashov@evaristesys.com> wrote:
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



--
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users