~singpolyma/sgx-jmp

sgx-jmp/views d---------
Merge branch 'block-calls-when-expired'

* block-calls-when-expired:
  Block voice calls when account is expired
  Refactor CallAttempt factory to use registration pattern
Block voice calls when account is expired

Allow for "transitional" (no plan) users for now, because we still have a bunch
of those.
Use Transfer because Forward doesn't work once answered
Pass customer_id through to leg2

The to in leg2 is not the phone number, but the fwd, which is not useful for
looking up customer.
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.
Use disposition=VOICEMAIL for calls that went to voicemail
Limit voicemail recording to 600 seconds
Switch to the new Ring verb with answerCall=false

Should actually cause incoming calls to ring properly, and the bug that required
pseudo_call_id seems gone.
Record Voicemail Greeting command
Merge branch 'sip-outbound'

* sip-outbound:
  Support transcription disablement option
  Port in inbound calls + voicemail
  Allow fetching fwd timeout as well
  Get OGM for a customer
  Helper to fetch customer's vcard-temp
  Make Disposition more real
  Allow constructing CDR for an inbound or outbound event
  Outbound calls from v2 SIP endpoint work and save a CDR
Support transcription disablement option
Port in inbound calls + voicemail

The craziest part of this is the workaround for a serious bug in Bandwidth's
HTTP voice API (which they may yet fix, still negotiating with them about that).

When a call comes in, every 10 seconds that it is not "answered" the inbound
call gets cancelled by their upstream peer and then get retried.  The caller
sees only one oubound call for this, so it doesn't look odd to them, but to us
it looks like they keep hanging up and trying again every 10 seconds.  So what
we do for now is we wait 2 seconds after they disconnect before we decide
they're really gone.  If they call back in those 2 seconds we just connect the
eventual bridge or voicemail to this new call and everything works out.

Ew.
Outbound calls from v2 SIP endpoint work and save a CDR