Asterisk Server, limit max call time for a user

Bonjour à tous, je voudrais savoir si il y a la possibilité de mettre un call time max : faire en sorte qu’en tout l’utilisateur ne puisse appeler que au max 1h en tout par exemple ( tous les appels cumulés ).

Hello everyone, i would like to know if it’s possible to limit call time, area so that in all the user can call only max 1h in all for example, (all cumulative calls).

Thanks !
Merci !

I don’t believe there is anyway of imposing an exact limit when parallel calls are possible, other than real time monitoring. Limits generally have to be set at the start of a call.

limit call time = 20 mins but i would like to know if i can limit call time with all cumulative calls :

        10 mins + 5 mins + 2 mins + 25 mins + 41 mins; and block when is more then 1 hour, or like that

Assuming you want to limit the call time per day, you will need to query the CDR before dial and based on the results use TIMEOUT() function to set the absolute maximum amount of time permitted for that call, you could also use L( x:y:z ) - Limit the call to x milliseconds. Play a warning when y milliseconds are left. Repeat the warning every z milliseconds until time expires.
on the dial command

I think people are missing the point. What he wants is to limit the total time used by the account. If you use L for a call based on the budget less the sum of completed call times, the user can make n parallel calls and thus exceed the limit by up to (n-1) times that remaining time.

If you set the limit smaller such that is it is impossible to exceed the limit, you may cut off calls, or refuse them, even though the limit is not going to be broken in reality.

This is a situation that arises if people pre-pay for calls and which Asterisk doesn’t support well.

Hey, yes this is the " call time per day " like 1h / day or 5h / week, i don’t know how can i do that with the L( x: y: z: ) can you help me ? I will send the extensions config, can you add the code please ? Thanks you verymuch :heart:

exten => _[0-9].,1,NoOp(#### [default] ####)
exten => _[0-9].,n,NoOp(we shouldn't ever be here, drop the call)
exten => _[0-9].,n,Hangup()

exten => i,1,Hangup()
exten => h,1,Hangup()
exten => t,1,Hangup()

; internal calls between extensions
exten => 201,1,Dial(SIP/201)
exten => 201,n,Hangup()

exten => 202,1,Dial(SIP/202)
exten => 202,n,Hangup()

; send all other numbers to outbound trunk
exten => _[0-9].,1,NoOp(#### [from-internal] ####)
exten => _[0-9].,n,Set(CALLERID(num)=33612345678)
exten => _[0-9].,n,Dial(SIP/+${EXTEN}@trunk)
exten => _[0-9].,n,Hangup()

; send all incoming calls from trunk DDI numbers to extension 201
exten => _[0-9].,1,NoOp(#### [from-trunk] ####)
exten => _[0-9].,n,Dial(SIP/201)
exten => _[0-9].,n,Hangup()

This is a support forum, you won’t find nobody willing to write customized dial plans for free,In case you find someone willing to do such thing, please give me his email address I also need some codes free codes.
Anyway just to help I pasted an example of how to use the L option



Limit call the to 60 seconds, play a beep every 10 seconds, and at the end play the asterisk-demo thanks message to caller and callee.

you need to feed the L option with the results of the equation used to set the call time out

1 Like

Thanks, nothing to see with that but, can i see what calls i did ( like a call history on asterisk ) ? Thanks you

i saw that but idk how to use it