[OpenSIPS-Users] Limit call duration - Timeout in Dialog module?

John Quick John.Quick at smartvox.co.uk
Fri May 1 18:24:17 CEST 2009


Brett/Bogdan-Andrei

I completed the upgrade to version 1.5.1 on my servers. However, even when I
set the "bye_on_timeout_flag" it was still not ending my call. So I turned
up the debug, checked the log and noticed it was complaining about an
invalid avp value. By coincidence, I had just read Brett's comment about
needing to cast some avp's as integer values - so tried his method to cast
the value as an integer and now it works. Thanks Brett.

In case anyone else is trying to replicate this timeout feature, here are
some code snippets (it also allows the CLI of the call to be modified - both
CLI and time limit come from an external program "getdat"):

loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "signaling.so"
loadmodule "dialog.so"
loadmodule "uac.so"
loadmodule "exec.so"

modparam("dialog", "dlg_flag", 4)
modparam("dialog", "timeout_avp", "$avp(i:10)")
modparam("dialog", "bye_on_timeout_flag", 5)

if (exec_avp("/usr/src/gd/getdat", "$avp(i:14),$avp(i:10)")) {
  # write results out to log file for debugging and testing
  xlog("L_WARN", "-New CLI=$avp(i:14); Max time=$avp(i:10)\n");
  # Cast the timeout value as an Integer
  $avp(i:10) = $(avp(i:10){s.int});
  # Modify the From header to use the specified CLI
  uac_replace_from("$avp(i:14)","sip:$avp(i:14)@mydomain.com");
  # set flag 4 to create a dialog record
  setflag(4);
  # ...and flag 5 tells Dialog module to issue BYE on timeout
  setflag(5);
} else {
  ...
}

John
 
________________________________________
From: Brett Nemeroff [mailto:brett at nemeroff.com] 
Sent: 01 May 2009 14:45
To: Bogdan-Andrei Iancu
Cc: John.Quick at smartvox.co.uk; users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] Limit call duration - Timeout in Dialog
module?

On Fri, May 1, 2009 at 7:00 AM, Bogdan-Andrei Iancu <bogdan at voice-system.ro>
wrote:
John Quick wrote:
> So whichever solution I use requires upgrading to version 1.5.x. I thought
> maybe 1.4.x was more stable so have not yet upgraded to 1.5. Perhaps now
is
> the time!

I know no one's asking, but the upgrades I've done from 1.4 to 1.5 have been
well worth it. There were some DB issues I had for 1.5.0, but have since
been resolved in 1.5.1. Performance is great, and I can't tell you how much
I love the new memcache stuff in 1.5. It's a whole new ballgame now. :)

-Brett
 




More information about the Users mailing list