Skip to content

Commit

Permalink
Merge branch 'feature/issue-6-support-play-verb' into feature/issue-7…
Browse files Browse the repository at this point in the history
…-support-hangup-verb

Conflicts:
	vumi_twilio_api/twilio_api.py
  • Loading branch information
Rudi Giesler committed Apr 13, 2015
2 parents 40fcf1c + 90229b0 commit c266693
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions vumi_twilio_api/tests/test_twilio_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions vumi_twilio_api/twilio_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'], '',
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit c266693

Please sign in to comment.