status = pjsip_tls_transport_start(self._obj, &tls_setting, &local_addr, NULL, 1, &self._tls_transport)
if status in (PJSIP_TLS_EUNKNOWN, PJSIP_TLS_EINVMETHOD, PJSIP_TLS_ECACERT, PJSIP_TLS_ECERTFILE, PJSIP_TLS_EKEYFILE, PJSIP_TLS_ECIPHER, PJSIP_TLS_ECTX):
raise PJSIPTLSError("Could not create TLS transport", status)
elif status != 0:
raise PJSIPError("Could not create TLS transport", status)
return 0
cdef int _stop_tls_transport(self) except -1:
self._tls_transport.destroy(self._tls_transport)
self._tls_transport = NULL
return 0
cdef int _set_dns_nameservers(self, list servers) except -1:
cdef int num_servers = len(servers)
cdef pj_str_t *pj_servers
cdef int status
cdef pj_dns_resolver *resolver
if num_servers == 0:
return 0
resolver = pjsip_endpt_get_resolver(self._obj)
- if status != 0:
- raise PJSIPError("Could not get DNS resolver on endpoint", status)
-
if resolver == NULL:
- return 0
+ raise SIPCoreError("Could not get DNS resolver on endpoint")