[asterisk-users] Limit total length of calls to a specifig SIP peer

Danny Nicholas danny at debsinc.com
Tue Jun 8 08:21:11 CDT 2010


My .02 - I would set up a context for dialing with this provider that counts
minutes and stops the dial with a message once you get to 1321 minutes (22
hours).

Exten => _8X.,1,noop(call using Cheap sip)
Exten => _8X.,2,macro(call_out,${EXTEN:1})
Exten => _8X.,3,hangup

[macro-call_out]
Exten => s,1,Gotoif($[${GLOBAL(SECUSED)} < 79200]?4)
Exten => s,n,playback(out-of-minutes)
Exten => s,n,hangup
Exten => s,n,dial(SIP/${ARG1}...)
Exten => s,n,Set(GLOBAL(SECUSED)=${GLOBAL(SECUSED)} + ${DIALEDTIME})
Exten => s,n,hangup
Exten => h,1,Set(GLOBAL(SECUSED)=${GLOBAL(SECUSED)} + ${DIALEDTIME})

By using DIALEDTIME instead of ANSWEREDTIME, you reduce the possibility of
going over on your minutes, but you could squeeze in an extra 2-20 seconds
per call using AT vs DT.

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Laurent CARON
Sent: Tuesday, June 08, 2010 7:53 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] Limit total length of calls to a specifig SIP peer

Hi,

I'm currently using a cheap SIP provider for outbound calls.

I do have 6 channels to them.

In their terms of service there is the following limit:

The total duration of calls during one single day should not exceed 24 
hours or we do have the right to terminate the contract...blah blah

What is the best way to use this provider as long as we are below let's 
say 22h in a single day ?

Thanks

Laurent

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list