diff --git a/aiosip/dialog.py b/aiosip/dialog.py index f64c2e4..081e7c5 100644 --- a/aiosip/dialog.py +++ b/aiosip/dialog.py @@ -171,17 +171,6 @@ async def start_unreliable_transaction(self, msg, method=None): self.transactions[method or msg.method][msg.cseq] = transaction return await transaction.start() - async def start_proxy_transaction(self, msg, timeout=5): - if msg.cseq not in self.transactions[msg.method]: - transaction = ProxyTransaction(dialog=self, original_msg=msg, loop=self.app.loop, timeout=timeout) - self.transactions[msg.method][msg.cseq] = transaction - async for response in transaction.start(): - yield response - else: - LOG.debug('Message already transmitted: %s %s, %s', msg.cseq, msg.method, msg.headers['Call-ID']) - self.transactions[msg.method][msg.cseq].retransmit() - return - def end_transaction(self, transaction): to_delete = list() for method, values in self.transactions.items(): diff --git a/aiosip/peers.py b/aiosip/peers.py index 1a215fd..2b13d6e 100644 --- a/aiosip/peers.py +++ b/aiosip/peers.py @@ -127,46 +127,6 @@ async def invite(self, dialog_factory=InviteDialog, **kwargs): await dialog.start() return dialog - async def proxy_request(self, dialog, msg, timeout=5): - if msg.method == 'ACK': - self.send_message(msg) - return - - proxy_dialog = self._app._dialogs.get(dialog.call_id) - if not proxy_dialog: - proxy_dialog = self._create_dialog( - method=msg.method, - from_details=dialog.from_details, - to_details=dialog.to_details, - call_id=dialog.call_id - ) - elif msg.cseq in proxy_dialog.transactions[msg.method]: - proxy_dialog.transactions[msg.method][msg.cseq].retransmit() - return - - if isinstance(msg.headers['Via'], str): - msg.headers['Via'] = [msg.headers['Via']] - - host, port = self.local_addr - if self._app.defaults['override_contact_host']: - host = self._app.defaults['override_contact_host'] - - msg.headers['Via'].insert(0, 'SIP/2.0/%(protocol)s {host}:{port};branch={branch}'.format( - host=host, - port=port, - branch=utils.gen_branch(10) - ) - ) - - async for response in proxy_dialog.start_proxy_transaction(msg, timeout=timeout): - yield response - - proxy_dialog._maybe_close(msg) - - def proxy_response(self, msg): - msg.headers['Via'].pop(0) - return self.send_message(msg) - @property def protocol(self): return type(self._protocol) diff --git a/tests/test_sip_proxy.py b/tests/test_sip_proxy.py index 3bf58a4..dce8938 100644 --- a/tests/test_sip_proxy.py +++ b/tests/test_sip_proxy.py @@ -10,7 +10,6 @@ class ServerDialplan(aiosip.BaseDialplan): async def resolve(self, *args, **kwargs): await super().resolve(*args, **kwargs) - return self.subscribe async def subscribe(self, request, message):