[asterisk-users] asterisk calls per second

Atis Lezdins atis at iq-labs.net
Fri Jun 13 08:28:19 CDT 2008


Hi,

I already gave a hint into right direction, but seems that it got
missed, so basically it would look like this:

>> exten=>_3XX,1,Set(GROUP()=${EPOCH})
>> exten=>_3XX,2,Set(GROUPCOUNT=${GROUP_COUNT(${EPOCH})})
>> exten=>_3XX,3,GotoIf($[${GROUPCOUNT} > ${MAX_CALLS}]?120)
>> exten=>_3XX,4,Dial(SIP/${EXTEN})
>> exten=>_3XX,5,Playback(unavailable)
>> exten=>_3XX.,6,Hangup
>> exten=>_3XX,120,Playback(try-later)
>> exten=>_3XX,121,Hangup

Epoch is UNIX timestamp, which changes every second. Probably you
don't even need to use GROUP, but can keep counter for current second
in some database, however that would need database cleanups and locks.
Asterisk builtin DB wouldn't be useful, as it can't increment within
same operation, so some sort of SQL magic should be used. For example
multiple primary keys, one of which is autoincrement, or just
transactions.

However advantage of using GROUP would be that if call disconnects,
it's not counted within GROUP_COUNT anymore, so you can accept one
more call for that second(probably most useful for minute).

Regards,
Atis

On Fri, Jun 13, 2008 at 3:57 PM, Mark Quitoriano
<markquitoriano at gmail.com> wrote:
> Hi Edgar,
>
> Thanks for the reply. This setting is good for 10 simultaneous calls.
> What i really need is 10 calls being done per second but no limit on
> simultaneous calls.
>
>
> On Fri, Jun 13, 2008 at 2:43 AM, Edgar Guadamuz <eguadamuz at gmail.com> wrote:
>> Well, as I said, you can tell Asterisk to accept until 10 SIP calls,
>> for example, at ANY TIME (I don' t understand why per second, I mean,
>> if the 10 calls are established in the same second, they are acepted,
>> and so they are if they are established in the same milisecond, while
>> the max concurrent calls is belowthe limit of 10).
>>
>> You can do something like this in your dialplan (assuming extensions like _3XX)
>>
>> exten=>_3XX,1,Set(GROUP()=sip-calls)
>> exten=>_3XX,2,Set(GROUPCOUNT=${GROUP_COUNT(sip-calls)})
>> exten=>_3XX,3,GotoIf($[${GROUPCOUNT} > ${MAX_CALLS}]?120)
>> exten=>_3XX,4,Dial(SIP/${EXTEN})
>> exten=>_3XX,5,Playback(unavailable)
>> exten=>_3XX.,6,Hangup
>> exten=>_3XX,120,Playback(try-later)
>> exten=>_3XX,121,Hangup
>>
>> where ${MAX_CALLS} is a variable defined by you that is the limit of
>> calls to be accepted
>>
>> On Thu, Jun 12, 2008 at 12:16 PM, Mark Quitoriano
>> <markquitoriano at gmail.com> wrote:
>>> yeah something like that. is it possible to set asterisk to make 10
>>> calls per second?
>>>
>>> On Thu, Jun 12, 2008 at 8:23 AM, Edgar Guadamuz <eguadamuz at gmail.com> wrote:
>>>> I know you can limit the total calls in any given time, for example,
>>>> you say I would like to have 10 SIP calls established as maximum.
>>>>
>>>> On 6/11/08, Mark Quitoriano <markquitoriano at gmail.com> wrote:
>>>>> Is there a way to limit or set the calls per second on SIP?
>>>>>
>>>>>
>>>>> --
>>>>> Regards,
>>>>> Mark Quitoriano
>>>>> Blog | http://mark.quitoriano.org
>>>>> VicidialNOW! | http://www.vicidialnow.com
>>>>> APUG! | http://asterisk.org.ph
>>>>>
>>>>> _______________________________________________
>>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>>>
>>>>> asterisk-users mailing list
>>>>> To UNSUBSCRIBE or update options visit:
>>>>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>>>>
>>>>
>>>> _______________________________________________
>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>>
>>>> asterisk-users mailing list
>>>> To UNSUBSCRIBE or update options visit:
>>>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Mark Quitoriano
>>> Blog | http://mark.quitoriano.org
>>> VicidialNOW! | http://www.vicidialnow.com
>>> APUG! | http://asterisk.org.ph
>>>
>>> _______________________________________________
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>>
>>
>> _______________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>
>
> --
> Regards,
> Mark Quitoriano
> Blog | http://mark.quitoriano.org
> VicidialNOW! | http://www.vicidialnow.com
> APUG! | http://asterisk.org.ph
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>



-- 
Atis Lezdins,
VoIP Project Manager / Developer,
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835



More information about the asterisk-users mailing list