Beispiel #1
0
hop(s) and failover for routing of SIP messages and reservation of network
resources prior the starting of a SIP session.
"""

import re
from itertools import chain
from time import time
from urllib.parse import urlparse

# patch dns.entropy module which is not thread-safe
import dns
import sys
from functools import partial
from random import randint, randrange

dns.entropy = dns.__class__('dns.entropy')
dns.entropy.__file__ = dns.__file__.replace('__init__.py', 'entropy.py')
dns.entropy.__builtins__ = dns.__builtins__
dns.entropy.random_16 = partial(randrange, 2**16)
dns.entropy.between = randint

sys.modules['dns.entropy'] = dns.entropy

del partial, randint, randrange, sys

# replace standard select and socket modules with versions from eventlib
from eventlib import coros, proc
from eventlib.green import select
from eventlib.green import socket
import dns.name
import dns.resolver
Beispiel #2
0
"""

from __future__ import absolute_import

import re
from itertools import chain
from time import time
from urlparse import urlparse

# patch dns.entropy module which is not thread-safe
import dns
import sys
from functools import partial
from random import randint, randrange

dns.entropy = dns.__class__('dns.entropy')
dns.entropy.__file__ = dns.__file__.replace('__init__.py', 'entropy.py')
dns.entropy.__builtins__ = dns.__builtins__
dns.entropy.random_16 = partial(randrange, 2**16)
dns.entropy.between = randint

sys.modules['dns.entropy'] = dns.entropy

del partial, randint, randrange, sys

# replace standard select and socket modules with versions from eventlib
from eventlib import coros, proc
from eventlib.green import select
from eventlib.green import socket
import dns.name
import dns.resolver