[OpenSIPS-Users] Minimum length of call

Jeff Pyle jpyle at fidelityvoice.com
Mon Jan 18 22:00:29 CET 2010


Are you trying to avoid short-call charges from your carrier?  It's not easy.

Even if this were possible, it wouldn't help if the far-end were to hang up first.  Even if they don't hang up first, they're likely going to hang up during this 12-second window you're looking to create in Opensips.  At best you'd buy yourself a second or so beyond actual disconnect time.

This isn't a good idea at the SIP level either.  If you were to delay a BYE, you're going to get retransmissions from your UAC because it's looking for a 200 OK.

The only way I could think of doing it would be in a custom B2B scenario, but even then, it probably wouldn't work well.  And in my opinion it's very complicated.

- Jeff

On Jan 18, 2010, at 3:55 PM, Ron McCarthy wrote:

Hi List,

When a user hangs up a call (call comes into proxy, connects to PSTN) and if the user that made the call hangups before a certain amount of time I want to delay sending the BYE to the upstream carrier, but ACK the BYE to the person they called and then have acc show the correct call timestamps of when the user really hanged up. Basically if a call is less then say 12 seconds id like to sleep() a few seconds until it's past 12 seconds then hang the call up.

Inside the loose_route() and is_method("BYE") I put this:

          $avp(s:calllength)=$avp(s:calltime) - $Ts;

          if($avp(s:calllength) < "6"){
            $avp(s:sleeptime)= "6" - $avp(s:calllength);
            xlog("L_NOTICE","Now TS: $Ts Call was $avp(s:calllength) seconds long, sleeping for $avp(s:sleeptime)");
          } else {
            xlog("L_NOTICE","Now TS: $Ts Call was $avp(s:calllength) seconds long, not sleeping");

Inside the onreply_route I put this:

  if(t_check_status("200") && is_method("INVITE")){
    xlog("L_NOTICE","Call connected at $avp(s:calltime)");

To me I would think I would then have the timestamp at when the call started (that parts works), then in the loose_route() I could take the current timestamp and subtract the two, then if less the X seconds, sleep before it sends the BYE.

I know their is more to it then that, but as a starting point the $avp(s:calltime) var is NULL when the call hits loose_route() is, I have verified this by the log.

Any help / insight on this would be great, I would think the variables would be accessible anyway I try to check for values, but it appears that is not the case.
Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>

Jeff Pyle
Director, Voice Engineering
Fidelity Voice & Data | 23250 Chagrin Blvd, Suite 250 | Beachwood, Ohio 44122
P: 216-245-4106
F: 216-595-0706
E: jpyle at fidelityvoice.com<mailto:jpyle at fidelityvoice.com>

Visit us at http://www.fidelityvoice.com

2008 & 2009 Inductee to the prestigious Weatherhead 100


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100118/26361e07/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.jpg
Type: image/jpeg
Size: 6468 bytes
Desc: image.jpg
Url : http://lists.opensips.org/pipermail/users/attachments/20100118/26361e07/attachment-0001.jpg 

More information about the Users mailing list