~singpolyma/sgx-jmp

ref: f571b5e726750cf8c4523c22d77e110194c3e16a sgx-jmp/lib/call_attempt.rb -rw-r--r-- 3.4 KiB
Merge branch 'max-call-length'

* max-call-length:
  Calculate the maximum allowable call length
Calculate the maximum allowable call length

Asterisk could use this to actually limit the call, for example.
Merge branch 'trustlevel-repo'

* trustlevel-repo:
  TrustLevel{,Repo}
TrustLevel{,Repo}

To determine how much permission a customer account should have to take risky
actions.  Seperate from their plan, this is not how much they could do in
theory, but how much the system will allow in practise due to perceived risk.

Starts out with a simple model based on amount of settled payments, and being
used to decide what is an "expensive" route for outbound calls.
Make sure from and to are in correct direction

Doesn't affect any current code paths, but should be correct in case we ever
start using it in the inbound case.

Also from does not have to be a formatted phone number, can be a string like
Anonymous, etc.
JSON route for outbound calls

For use from Asterisk
Try auto top up / low balance notify when not enough balance for a call

There is an edge case where a customer might not have auto-topped up yet but
they don't have enough balance for this call, so try to charge their card first
before telling them the call is a no go.
Also supports limits on inbound calls
Outbound call logic for overages

If cannot find an acceptable rate for the number, cannot call.
If balance is too low, cannot call.
If too close to limit, warn.
Else, call.