Need to limit number calls in a Trunk

Dear All,

I have one E1 line (ZAP trunk) and one SIP (SIP TRUNK).Which has priority 1 and 2 respectively in an outbount route.I want to ocnfigure in such a way that first 10000 calls (not simultaneous) should go through ZAP.if total calls made reaches 10000 then calls should automatically go through the SIP trunk.
Is this possible to create a limit of maximum nuber of call that can be made using a trunk.

Take a look at this thread:

http://www.freepbx.org/forum/freepbx/tips-and-tricks/least-busy-trunk-hunting

there is one module floating around somewhere that can track minute usage to do a similar thing.

I would look for that module and if minutes don’t work for you, then it may not bee too hard to modify it to do calls (and maybe you can get the author to add that in if it’s not already there.)

Maybe it’s possible, but it’s not a built-in function of FreePBX. If you are going to try and write it yourself, this might give you some food for thought:
http://www.freepbx.org/support/documentation/howtos/how-to-execute-a-custom-dial-plan-fragment-before-sending-a-call-to-a-t
It’s not what you want, but it might give you some ideas how to go about accomplishing what you want.

You real problem would likely be keeping an accurate call count. It wouldn’t be that hard to count call attempts (although you’d have to make sure whatever method you use can survive a system reboot, reload of Asterisk, etc.) but if you want to count only completed calls, that would be a lot harder.