[SR-Users] Catching internally generated BYE event & other

Alex Balashov abalashov at evaristesys.com
Mon Apr 19 08:00:19 CEST 2010


Hello,

I am using the dialog module to time out excessively long calls:

    modparam("dialog", "default_timeout", 21600) # 6 hours
    modparam("dialog", "dlg_flag", 2)
    ...
    route {
       ...
       ...
       setflag(2);
       $dlg_ctx(timeout_bye) = 2;
       ...
       ...
       if(!t_relay())
          sl_reply_error();
    }

I have two unrelated questions:

1) Why does $dlg_ctx(timeout_bye) work here?  My understanding is that 
$dlg_ctx(...) is a PV namespace container that exposes some aspect of 
the allocated dialog tracking structure.  The dialog structure is 
created via a TM->dialog callback triggered by t_relay();  why is it 
possible to access it prior to that point?

2) The spoofed BYEs that are generated by the proxy with this setting 
do not show up as sequential requests, nor are catchable in script at 
all.  As a result, BYE events are not written to CDRs with 'acc' and I 
have no way of knowing when the call actually closed.

What is the most efficient and canonical solution to this problem?

I can think of two:

(a) Define a $dlg_ctx(timeout_route) and have it write a BYE event 
artificially using acc_db_request().

(b) Loop the BYE request back to the proxy with some sort of 
differentiating URI parameter or similar that causes it to be dropped 
instead of forwarded.  But this is really nasty.

What is your suggestion?

Thanks,

-- 
Alex Balashov - Principal
Evariste Systems LLC
1170 Peachtree Street
12th Floor, Suite 1200
Atlanta, GA 30309
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/




More information about the sr-users mailing list