~singpolyma/sgx-jmp

ref: dc2c1410831e4d610453a712347e1b4dd5a1ebc7 sgx-jmp/.rubocop.yml -rw-r--r-- 2.0 KiB
Change multiline chain style
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.
CustomerRepo::QueryKey and CustomerRepo#find_by_format

Introduce objects representing the different kind of query keys that can be used
to look up a customer.  These keys know how to use themselves to get
the (customer_id, jid) pair that is needed for an actual repo lookup.  All
find_by_* methods are now just trivial wrappers over these objects that pass on
to find_inner.

This enables the easy creation of a new helper: QueryKey.for, used as
find_by_format which allows passing an xmpp: URI, or a properly formatted tel,
or a customer id, and will find by the correct one.  This could cause a problem
if a customer id were to be a valid xmpp: URI or a formatted tel, so this method
does assume not using these formats for any customer id (which would be
ill-advised in any case).
put_monthly_overage_limit
Merge branch 'whitelist'

* whitelist:
  Allow whitelisting domains
  Use FormTemplate for activation form
Use FormTemplate for activation form
Merge branch 'rubocop'

* rubocop:
  Additional fixes for rubocop 1.10.1
  Switch to rubocop 0.89.1
Switch to rubocop 0.89.1

This is the rubocop in new Debian stable
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
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.
Merge branch 'number-search'

* number-search:
  Do not direct back to website to pick new number
  Run rubocop after tests
  Add reference to option to show where the tel is
  Format tel for human reader
  Allow user to search for numbers over XMPP
  s/WebRegisterManager/TelSelections
Allow user to search for numbers over XMPP
The sugar version prevents the promise from being returned
Customer Info

This should allow us, the admins, to query information about a customer
without having to dive in and run a couple redis queries and some
database queries before getting the full picture of who we're talking
to.

It also allows the users to request some data about themselves. Balance and
phone number are already visible in other places, but their expiry is currently
not, and people have been asking about it.
Merge branch 'command-object'

* command-object:
  ErrorToSend => FinalStanza
  Since Command#finish causes an error, a then off the end won't work
  Refactor commands to have Command and Command::Execution objects
Refactor commands to have Command and Command::Execution objects

Brings the common elements of all commands together, and threads the most useful
state (such as ability to reply) through automatically using the new EMPromise
fiber trampoline.
Merge branch 'count-outbound-messages'

* count-outbound-messages:
  Store customer outbound messages/day for 1 year in redis
Store customer outbound messages/day for 1 year in redis

Storage is a sorted set, with dates as the values and message counts as the
scores.  Use zincrby to increment the message count by 1 on each new message.
Use zremrangebylex to remove all items older than 1 year so the set does not
grow unboundedly.

Dates with known message counts can be found using zrangebylex. Scores can be
had one at a time with zscore.  In redis 6.2+ zrange bylex withscores or zmscore
may also be used, but that is only in Debian experimental at time of writing.
Merge branch 'pass-messages'

* pass-messages:
  Pass messages to and from the SGX
Pass messages to and from the SGX

Rewriting the from/to as appropriate.
Next