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.
* 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
Stephen Paul Weber
created
a16fd0d
Do not direct back to website to pick new number
Click to expand commit body
Instead, if number is no longer available keep them in flow and use the number
search tool.
Set the same key as web register manager, so that on next register jmp.chat the
tel we were using in this flow will be used. Not needed if they came from web
register, but will still extend expiry in that case and no harm.
Clean up pending tel key on Finish.
Turns out my dummy-sgx doesn't act the same as production.
Rather than getting a successful registration with no phone, in production I
get false, so I need to handle that.
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.
On start up, check for users with low balance and NOTIFY about them. LISTEN for
such notifications and process by either sending a low-balance warning message
or else attempting an auto-top-up as configured.
Using NOTIFY/LISTEN because then we can NOTIFY after any INSERT that leaves the
balance too low (using a trigger). Doing the sync on start-up in case we missed
a NOTIFY during any downtime. Using the Redis lock to prevent spamming a
low-balance user in case of many restarts or if they have many small
transactions happen in one day.
If the user does not proceed with a command after N time, we don't hold on to it
forever and time out. We cannot return anything to the user because they
haven't sent us anything, so just ignore it.
Stephen Paul Weber
created
2f33536
When user cancels the command, respond with canceled
Click to expand commit body
If the cancel has not been fully handled in the body of the command, at least
respond with canceled status and do not go to sentry.