0

I want to create some limit access for A2Billing on Elastix. Here is some of the limit I need to apply [don't know how to display the table directly :) ]

<table>
  <tbody>
    <tr>
      <th>Group</th>
      <th>Days of Week</th>
      <th>Balance</th>
      <th>Talktime Limit</th>
      <th>Active Hours</th>
      <th>Destination Limit</th>
    </tr>
    <tr>
      <td>Management</td>
      <td>Monday - Saturday</td>
      <td>300,000</td>
      <td>Unlimited</td>
      <td>08.00-20.00</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Management</td>
      <td>Monday - Saturday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-20.00</td>
      <td>Local,Mobile</td>
    </tr>
    <tr>
      <td>Management</td>
      <td>Monday - Saturday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-20.00</td>
      <td>Local,Mobile,SLJJ</td>
    </tr>
    <tr>
      <td>Production</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local</td>
    </tr>
    <tr>
      <td>Production</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Custumer Relation</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Custumer Relation</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,Mobile</td>
    </tr>
    <tr>
      <td>Advisor</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,Mobile</td>
    </tr>
    <tr>
      <td>Claim</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-20.00</td>
      <td>Local,Mobile</td>
    </tr>
    <tr>
      <td>Provider</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Case Management</td>
      <td>Monday - Friday</td>
      <td>500,000</td>
      <td>10 minutes</td>
      <td>24 H</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Call Center</td>
      <td>Monday - Sunday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>24 H</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Marketing</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,Mobile</td>
    </tr>
    <tr>
      <td>Marketing</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
  </tbody>
</table>

Is it possible with Elastix or A2Billing to create that kind of limit per account that already created before? Any help would be appreciated.

Daniel
  • 3
  • 3

1 Answers1

0

First of all your question have bad example(same destinations, same time, different limit), so it not doable without data re-think/rewrite on any system.

Elastix have no any rating engine at all

A2Billing have free minutes packages, you can allow create via freepbx custom context module context which allow call "free minutes" trunk to a2billing, something like this:

trunk type custom with dialstring Local/$OUTNUM$@managment_a2b/n

in extensions_custom.conf

[managment_a2b]
exten => _X.,1,GotoIFtime(8-20,Mon-Sat,*,*?choice1)
exten => _X.,n,GotoIFtime(20-23,Mon-Sat,*,*?choice2)
; other choices here
exten => _X,n(choice1),Set(CDR(accountcode)=123456789);account for managment call out at choice1 time.
exten => _X.,n,Goto(a2billing,${exten},1);context a2billing have be context which allow call with account
exten => _X,n(choice2),Set(CDR(accountcode)=123456780);account for managment call out at choice2 time.
exten => _X.,n,Goto(a2billing,${exten},1);context a2billing have be context which allow call with account

Sure you have setup in a2billing callplan for that account acordinly(with free minutes limit).

Setup require understanding of a2billing and asterisk internals and quite complex.

But such dialplan will be very complex if you expect setup limit per person. So will be simpler just ask some expert create custom billing for this case(or build complex dialplan tree with all choices you have)

Different account for different calling destination can be done by using prefixes.

For example this one

exten => _590X.,1,Set(CDR(accountcode)=1)
exten => _800X.,1,Set(CDR(accountcode)=2)

will do different account for different prefixes(please note, it have same prio, will be choosed best fit)

For more info read any book about asterisk(ORelly "The future of telephony" recommended) and a2billing manuals/source code.

arheops
  • 15,544
  • 1
  • 21
  • 27
  • Thank you before for the answer. I want to apply those different kind of rules on different department. Is there any way that A2Billing can get for direct calling/originate a call (maybe something like Dial($(exten)@a2billing))? – Daniel Dec 29 '15 at 16:58
  • Please read carefully from start. You should create different trunk and custom context for each one. Also answer have way how to dial via a2billing. – arheops Dec 29 '15 at 21:00
  • What if I made some kind of array of time and week, for example : exten => _X.,n,Set(ARRAY(TIME_USER,WEEK_USER,DURATION_USER,DEST_USER)=${CC_ACCESSCHECK(${username}) }) and try to compare with exten => _X.,n,Set(TimeNow=${STRFTIME(${EPOCH},,%H:%M)})? Will it be solved the access permission within the hour? Is it any way or IF statement for comparing those (e.g. IF 18:00 BETWEEN 08:00-20:00 THEN choose1) – Daniel Dec 30 '15 at 14:12
  • Asteirsk dialplan is full grammatic. That mean you can program anything using it. Just metter of time. Anyway, if you have more then few rules simplest is use database access function for check. Sorry, i am not gooing put here more example then i already did. It can take forever. If you have any single issue - you can ask question. But guiding you via development process is not something i want do,really. – arheops Dec 30 '15 at 16:37
  • Asterisk have only one compare time app in format above(and execiftime same format). If you want simple compare date, you can convert it to integer like dayofweek*7*24*60+hour*60+minute and compare like integer values. – arheops Dec 30 '15 at 16:39