diff --git a/vumi_twilio_api/tests/test_twilio_api.py b/vumi_twilio_api/tests/test_twilio_api.py index 6c3aded..5c5c5d1 100644 --- a/vumi_twilio_api/tests/test_twilio_api.py +++ b/vumi_twilio_api/tests/test_twilio_api.py @@ -408,7 +408,8 @@ def test_make_call_parsing_play_verb(self): [msg] = yield self.app_helper.wait_for_dispatched_outbound(1) yield self.app_helper.dispatch_event(self.app_helper.make_ack(msg)) [_, reply] = yield self.app_helper.wait_for_dispatched_outbound(1) - self.assertEqual(reply['helper_metadata']['voice']['url'], 'test_url') + self.assertEqual( + reply['helper_metadata']['voice']['speech_url'], 'test_url') self.assertEqual(reply['from_addr'], '+12345') self.assertEqual(reply['to_addr'], '+54321') @@ -472,7 +473,8 @@ def test_receive_call_parsing_play_verb(self): yield self.app_helper.dispatch_inbound(msg) [reply] = yield self.app_helper.wait_for_dispatched_outbound(1) - self.assertEqual(reply['helper_metadata']['voice']['url'], 'test_url') + self.assertEqual( + reply['helper_metadata']['voice']['speech_url'], 'test_url') self.assertEqual(reply['in_reply_to'], msg['message_id']) @inlineCallbacks diff --git a/vumi_twilio_api/twilio_api.py b/vumi_twilio_api/twilio_api.py index ff55441..d84a49b 100644 --- a/vumi_twilio_api/twilio_api.py +++ b/vumi_twilio_api/twilio_api.py @@ -162,7 +162,7 @@ def _handle_connected_call( def _send_message(self, url, session, session_event=None): helper_metadata = {} if url: - helper_metadata['voice'] = {'url': url} + helper_metadata['voice'] = {'speech_url': url} return self.send_to( session['To'], '', @@ -220,7 +220,7 @@ def new_session(self, message): elif verb.name == "Play": yield self.reply_to(message, '', helper_metadata={ 'voice': { - 'url': verb.nouns[0], + 'speech_url': verb.nouns[0], } }) elif verb.name == "Hangup":