def initiate_conference_call(self, conference, user): path = reverse('conference_response', args=(conference.id, )) url = "{}{}".format(settings.BASE_URL, path) sid = self._make_call(user.userprofile.phone_number, self.calling_number, url) call = Call(conference=conference, user=user, twilio_sid=sid) call.save() call_event = CallEvent(call=call, event_type=CallEvent.CALL) call_event.save()
def initiate_conference_call(self, conference, user): path = reverse('conference_response', args=(conference.id,)) url = "{}{}".format( settings.BASE_URL, path) sid = self._make_call(user.userprofile.phone_number, self.calling_number, url) call = Call(conference=conference, user=user, twilio_sid=sid) call.save() call_event = CallEvent(call=call, event_type=CallEvent.CALL) call_event.save()
def test_incoming_call(self): self.conference.user_set.add(self.user) call = Call(conference=self.conference, user=self.user, twilio_sid='888') call.save() self.assertEquals(call.call_state, call.INCOMING) url = reverse('conference_response', args=(self.conference.id,)) resp = self.client.post(url, {'CallSid':call.twilio_sid}) #self.assertContains(resp.content, self.conference.name) call_result = Call.objects.get(id=call.id) self.assertEquals(call_result.call_state, Call.IN_CALL) self.assertTrue(CallEvent.objects.filter(call=call, event_type=CallEvent.JOIN).exists())
def test_incoming_call(self): self.conference.user_set.add(self.user) call = Call(conference=self.conference, user=self.user, twilio_sid='888') call.save() self.assertEquals(call.call_state, call.INCOMING) url = reverse('conference_response', args=(self.conference.id, )) resp = self.client.post(url, {'CallSid': call.twilio_sid}) #self.assertContains(resp.content, self.conference.name) call_result = Call.objects.get(id=call.id) self.assertEquals(call_result.call_state, Call.IN_CALL) self.assertTrue( CallEvent.objects.filter(call=call, event_type=CallEvent.JOIN).exists())