Example #1
0
    def handle_status_ok(self, message):
        if message['State'] != 'LinphoneCallIncomingReceived':
            raise LinphoneException('Not ringing')

        if self._caller_id not in message['From']:
            raise LinphoneException('Do not ringing showing {}'.format(
                self._caller_id))

        return True
Example #2
0
    def handle_status_ok(self, message):
        if message['State'] != 'LinphoneCallStreamsRunning':
            raise LinphoneException('Not in conversation')

        if self._caller_id not in message['From']:
            raise LinphoneException('Do not talking to {}'.format(
                self._caller_id))

        return True
Example #3
0
 def handle_status_error(self, message):
     if message['Reason'] == 'No current call available.':
         raise NoActiveCallException()
     raise LinphoneException(message['Reason'])
Example #4
0
 def handle_status_error(self, message):
     if message['Reason'] == 'No active call.':
         raise NoActiveCallException()
     raise LinphoneException(message['Reason'])
Example #5
0
 def handle_status_error(self, message):
     if message['Reason'] == 'Call creation failed.':
         raise ExtensionNotFoundException()
     raise LinphoneException(message['Reason'])
Example #6
0
 def command(self):
     if self._call_id is None:
         raise LinphoneException('Invalid call ID')
     return 'call-resume {}'.format(self._call_id)
Example #7
0
 def handle_status_error(self, message):
     raise LinphoneException(message['Reason'])