|
@@ -561,22 +561,22 @@ class OutboundClient:
|
|
|
registry.CALL_INCOMING_REQUESTS.labels(f"{_bucket_call_type}").inc()
|
|
|
self.server.dataHandleServer.create_record(call_id, caller_number, _bucket_call_type, service_category=service_category, destination=destination)
|
|
|
|
|
|
- # try:
|
|
|
- # con.disconnect()
|
|
|
- # self.server.logger.info("connection disconnected !!!")
|
|
|
- # except:
|
|
|
- # traceback.print_exc()
|
|
|
+ try:
|
|
|
+ con.disconnect()
|
|
|
+ self.server.logger.info("connection disconnected !!!")
|
|
|
+ except:
|
|
|
+ traceback.print_exc()
|
|
|
else:
|
|
|
self.server.logger.info("Failed to connect to FreeSWITCH")
|
|
|
except:
|
|
|
traceback.print_exc()
|
|
|
- # finally:
|
|
|
- # try:
|
|
|
- # if self.request.fileno() != -1:
|
|
|
- # self.request.close()
|
|
|
- # except OSError:
|
|
|
- # # Ignore the error if socket is already closed
|
|
|
- # pass
|
|
|
+ finally:
|
|
|
+ try:
|
|
|
+ if self.request.fileno() != -1:
|
|
|
+ self.request.close()
|
|
|
+ except OSError:
|
|
|
+ # Ignore the error if socket is already closed
|
|
|
+ pass
|
|
|
|
|
|
def build_call_info(self, call_type, call_id, device_id, new_device_id, destination, bucket_type, **kwargs):
|
|
|
caller = kwargs.get('Channel-Caller-ID-Number')
|