Limit concurrent calls with redirect.. SIP

Hi, i want to limit the simultaneous calls on my sip trunk but i really dont know how…

I have an extension (ring group) 600 that has 4 phones, but i want to limit the simultaneous calls to 3 so if the 4th,5th,6th… … customer calls when 3 others are busy then he has to be redirected to extension (ring group) 900… i have tried to make something, but i’m almost 100% sure that it is very wrong… :smile:

exten => 600,1,Set(GROUP()=${ALL})
exten => 600,n,GotoIf($[${GROUP_COUNT(${ALL})}>3]?MAX)
exten => 600,n,Set(GROUP()=${ALL})
exten => 600,n,Set(OUTBOUND_GROUP=${ALL})
exten => 600,n(MAX),Dial(SIP/900)

I’m using Asterisk V. 1.4 newest svn with freepbx 2.7

Have you initialized somewhere the ALL variable?

More exactly - what is the meaning of ${ALL} in your dialplan?

As you do not post at least the Asterisk console log there are not so many useful information in your initial message - thus please do not forget you add them.

Also - I see how to have tried to jump on “max” condition but I do not understand how you dial the normal ring group phones.

Bellow is one suggestion - it simulate a ring group where 101,102,103 and 104 will ring till one will answer:

exten => 600,1,Set(GROUP()=600) exten => 600,n,GotoIf($[${GROUP_COUNT(600)}>3]?MAX) exten => 600,n,Dial(SIP/101&SIP/102/&SIP/103&SIP/104) exten => 600,n,Hangup exten => 600,n(MAX),Dial(SIP/900)

Please do not forget that 600 is FreePBX default ring-group start number thus I recommend to switch to other ring group number or to be very careful when you will define the first ring group with FreePBX.

HTH,
Ioan.

I dont know where to put the code… :frowning: i have read in the asterisk book but cant find any info…