Martyn Inglis
72ecca4dab
Added a 60 second timeout to the MMG and fire text clients.
...
- This is a CONNECT and a READ timeout.
- Gets wrapped in the standard client exception, with a status code of 504, message Gateway timeout.
- Is quiet noisy in logs to allow us to see it
- Ensures we flick across the provider.
To test change the timeout to 0 and it will timeout.
2017-04-05 15:31:37 +01:00
Martyn Inglis
57bd6494e1
WIP - adding request timeout
2017-04-04 16:05:25 +01:00
Martyn Inglis
2d946736e0
Log notification ID on deliver tasks and in clients.
...
- help tie things together in Kibana.
2016-12-20 13:24:08 +00:00
Martyn Inglis
6f7dd149e2
Tidied up pull request comments
2016-09-23 15:59:23 +01:00
Martyn Inglis
124487f204
Fix from number on Load testing client
2016-09-23 10:31:18 +01:00
Martyn Inglis
54c28a4bea
Updated logging as logger was parsing some JSON and erroring.
...
- Don't write whole JSON response. Safer not to anyway. No need.
2016-09-23 10:24:12 +01:00
Martyn Inglis
376f8355cb
Updated clients to have a more robust error handling
...
- fire text and omg much more similar. Ready to be combined.
- Error handling now for JSON valid responses
2016-09-22 17:18:05 +01:00
Rebecca Law
3d41fa9634
Update mmg status code 2 to be a permanent failure.
2016-09-01 10:23:37 +01:00
Leo Hemsted
26d7675baa
pep8 fixes
...
no idea why the build/local pep8s weren't picking them up before.
also excluded import order pep8
2016-08-23 12:05:47 +01:00
Martyn Inglis
fe54fa9f73
Final pass through existing statsd endpoints to ensure they match new naming strategy.
...
Updates accordingly.
2016-08-08 11:23:58 +01:00
Rebecca Law
c8ad5362eb
Moved mmg_url to configs.
...
Fix up the tests
2016-07-20 10:40:50 +01:00
Rebecca Law
aca23472e3
Use the new mmg api
2016-07-19 15:27:52 +01:00
Adam Shimali
c29dd23702
Add sms sender to service to be used in sms templates
...
in place of default numeric short code.
If not present default short code is used.
2016-07-01 15:27:54 +01:00
NIcholas Staples
964fd5ac35
Merge pull request #377 from alphagov/single_from_number
...
Replaced mmg from number and firetext from number with single from nu…
2016-06-09 10:41:39 +01:00
Nicholas Staples
903c479d7a
Update log messages so they don't produce an error on the utils logger.
2016-06-07 11:59:13 +01:00
Nicholas Staples
fe7d894420
Replaced mmg from number and firetext from number with single from number.
...
Fix merge mistake.
Fix tests from merge.
Update config to include correct staging and live names.
2016-06-06 16:41:33 +01:00
Leo Hemsted
0a8cb679d7
make mmg and firetext client params consistent
2016-06-01 15:58:48 +01:00
Rebecca Law
97088a4af1
Added a comment to explain how the delivery receipt will affect the notification status.
2016-05-27 12:28:58 +01:00
Rebecca Law
25a1b7f31c
Firetext does not have a status code for temporary-failure.
...
In order to set a message as temporary-failure, we check if it is in pending status first.
Otherwise a delivery receipt for failure is set to permanent failure.
2016-05-26 16:46:00 +01:00
Rebecca Law
fa152c4431
Mark a declined message from Firetext as permanent-failure rather than failed.
2016-05-24 15:32:48 +01:00
Adam Shimali
955005d7fe
Added additional outcome status codes to mmg responses.
2016-05-19 11:27:22 +01:00
Martyn Inglis
3f7559b286
Added statsd integration into the API
...
- new client for statsd, follows conventions used elsewhere for configuration
- client wraps underlying library so we can use a config property to send/not send statsd
Added statsd metrics for:
- count of API successful calls SMS/Email
- count of successful task execution for SMS/Email
- count of errors from Client libraries
- timing of API calls to third party clients
- timing of how long messages live on the SQS queue
2016-05-13 17:15:39 +01:00
Martyn Inglis
06bfe81329
Load testing client added
2016-05-12 10:46:35 +01:00
Nicholas Staples
3b1423a2ea
Provider Statistics added.
...
Rates command added with a test.
Updated to include added migration.
2016-04-21 13:47:04 +01:00
Rebecca Law
9a25062943
Update mmg responses so that 3 is success.
...
Status codes from mmg are:
2: UNDELIVERABLE Message is undeliverable.
3: DELIVERED Message is delivered.
4: EXPIRED Message is expired.
5: REJECTED Message is rejected.
2016-04-20 14:29:31 +01:00
Rebecca Law
f283379646
Defend against status code 00 or 0 from mmg
2016-04-20 11:07:21 +01:00
Rebecca Law
41ce691704
Update to processing the the response from MMG
...
MMG changed the datatype and the status codes they send us for the delivery receipts.
This PR accounts for that change.
2016-04-20 09:45:13 +01:00
Nicholas Staples
15c4fb47f7
Added multi parameter for sending messages.
2016-04-18 09:55:56 +01:00
Nicholas Staples
90f0505a3d
Update limit to message_limit.
...
Further db changes and updates.
Remove traceback print out.
Fix bug in passing template id to a task.
2016-04-11 16:53:40 +01:00
Rebecca Law
fb04b36cba
Fix **kwargs
2016-04-07 10:53:59 +01:00
Rebecca Law
c132bbf46e
Rename NOTIFY_FROM_NUMBER to MMG_FROM_NUMBER, there should be a separate short code per provider.
2016-04-07 10:18:46 +01:00
Rebecca Law
340f8ceaf6
Update mmg send_sms to include cid and request headers
...
Use mmg to send_sms
2016-04-06 17:35:14 +01:00
Rebecca Law
323b2ff537
Use MMG client for send-sms
2016-04-06 15:56:34 +01:00
Rebecca Law
4806123d5c
Add process_mmg_responses
...
Refactor process_firetext_responses
Removed the abstract ClientResponses for firetext and mmg. There is a map for each response to handle the status codes sent by each client.
Since MMG has about 20 different status code, none of which seem to be a pending state (unlike firetext that has 3 status one for pending - network delay).
For MMG status codes, look for 00 as successful, everything else is assumed to be a failure.
2016-04-06 14:31:33 +01:00
Rebecca Law
f2ee8f3eb7
WIP
2016-04-05 14:39:59 +01:00
Rebecca Law
2ba12da77d
WIP: adding delivery receipt endpoint for mmg
2016-04-04 15:02:21 +01:00
Rebecca Law
69697388d7
Initial set up for mmg client integration
2016-04-01 16:42:31 +01:00
Martyn Inglis
e0316d1881
Adds notification stats update into the callback process
...
- when a provider callback occurs and we update the status of the notification, also update the statistics table
Adds:
- Mapping object to the clients to handle mapping to various states from the response codes, this replaces the map.
- query lookup in the DAO to get the query based on response type / template type
Tests around rest class and dao to check correct updating of stats
Missing:
- multiple client callbacks will keep incrementing the counts of success/failure. This edge case needs to be handle in a future story.
2016-03-21 13:24:37 +00:00
Martyn Inglis
e2cfbce8c4
Added base object for response statuses, and tests around it's behaviour
2016-03-21 09:20:38 +00:00
Martyn Inglis
69654f4209
Parking some code that updates stats when notification delivery happens
2016-03-15 14:40:42 +00:00
Martyn Inglis
2922712f0b
Make sms code task use a reference too
...
- makes the fire text callback behave in consistent way
2016-03-10 15:51:11 +00:00
Martyn Inglis
1f22f2b7cc
Updates to fire text integration:
...
- client updated to raise errors with fire text error codes/messages
New endpoint
- /notifications/sms/firetext
For delivery notifications to be sent to.
2016-03-10 15:40:41 +00:00
Martyn Inglis
c580b9c084
Pass notification ID to fire text as our reference
...
- also handle fire text errors, non-zero response code means error.
2016-03-10 13:22:45 +00:00
Martyn Inglis
35b7b884f8
Add logging around 3rd party delivery calls
...
- time SES, Twilio, fire text calls
- use monotonic for accuracy
2016-03-02 09:33:20 +00:00
Martyn Inglis
44632c36d3
Add sender name to the notification
...
- also ensure that the created time is handled properly
2016-02-25 11:23:04 +00:00
Rebecca Law
9073814d9f
I have an issue with the test, not sure why?
2016-02-17 17:48:23 +00:00
Martyn Inglis
837c9b7cdb
Removed logging, and make fire text only client.
2016-02-17 13:59:01 +00:00
Martyn Inglis
226459132a
Basic (Very basic) implementation of the fire text API.
...
[https://www.firetext.co.uk/docs#sendingsms ](https://www.firetext.co.uk/docs#sendingsms )
Not to be merged. This API has a limit on it at the moment that will need to be removed before it is used in anger.
2016-02-17 12:57:51 +00:00
Martyn Inglis
1311af5920
Twilio client takes a 'to' number not a notification
2016-02-17 09:12:13 +00:00
Martyn Inglis
655beddba6
Fixed up the get_notitication endpoint
...
- returns a notification
2016-02-16 11:22:44 +00:00