Call duration limit & least cost routing

asteriskelastixphonetelephonyvoip

We have Elastix version 2.4 setup and we have some little questions which if you could please answer to solve via web based panel of Elastix, as agents are making calls via Elastix there are little issues we are having, like:

  1. Agents make very long duration calls, so we want to setup a rule or whatever possible in Elastix to terminate all calls(for every agent) after 20 minutes of duration, and for agents who comes in evening shift after 6:00 to terminate their calls after every 30 minutes.

  2. Can we except any particular agent from above rule? like we know someone who makes all legitimate calls without any issue so if we need to exempt him can we do this?

  3. How can we switch/block the country based code according to service provider, like we have one service provider which is costing too much for Nigeria (code 00234), so any call going to this code should automatically be routed to other service provider which we have in trunk which costs cheaper than first one. Someone told me this is done via outbound routes in the Elastix application? if that is the case can someone please tell me the steps from exactly where can I do this? and any simple example rule?

Please note that we have access to Elastix via web based panel and if you could kindly let me know for these to perform it from there?

Regards,
Fari

Best Answer

1) can be done by changing "Asterisk Dial Options" in "Advanced features" tab. You need add S(1200)

S(x): Hang up the call seconds after the called party has answered the call.

2) no, you can't in default elastic install. However you can request expert do module for such task( need add into sip_additional.conf variables and use that variables instead of S). Or use custom context module(also require advanced asterisk knowledge).

3) It can be done like this:

First you need create trunk which always answer call and say something like "blocked". That can be done by using announcment,fake inbound did (for example 1111) and custom trunk with dialstring Local/1111@from-pstn.

After that you have put in outbound routes all codes you not want pass to that trunk. As result such codes will go your fake trunk->fake did->anounce.

Other posible option is use custom dialplan with fake trunk like above.