[SR-Users] Setting dialog variable when BYE is received before accounting

Mickael Marrache mickaelmarrache at gmail.com
Thu Jan 29 12:20:27 CET 2015


Hi,

 

Is there a way to set a dialog variable when a BYE is received so that it
can be written in a CDR?

 

I tried as follows but it didn't work:

 

if (loose_route()) {

          ..

          if(is_method("BYE")) {

                    if(is_direction("downstream")) {

                             #Call disconnected by caller

                             $dlg_var(dr) = 700;

                    } else {

                                #Call disconnected by callee

                                $dlg_var(dr) = 701;

                    }

                    xlog("Setting disconnect reason to $dlg_var(dr)\n");

          }

          ..

          exit;

}

 

The xlog statement prints:

 

ERROR: <script>: Setting disconnect reason to <null>

 

The doc states:

 

This pseudo-variable will be available only for subsequential requests after
doing loose_route().

 

Thanks,

Mickael

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150129/0096c012/attachment.html>


More information about the sr-users mailing list