From mickaelmarrache@gmail.com Thu Jan 29 12:20:39 2015 From: Mickael Marrache To: sr-users@lists.kamailio.org Subject: [SR-Users] Setting dialog variable when BYE is received before accounting Date: Thu, 29 Jan 2015 13:20:27 +0200 Message-ID: <06b601d03bb5$9675db50$c36191f0$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1322339489==" --===============1322339489== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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: