Example #1
0
 def __init__(
     self,
     socket,
     address,
     log,
     default_answer_url=None,
     default_hangup_url=None,
     auth_id="",
     auth_token="",
     request_id=0,
     filter=None,
 ):
     self._request_id = request_id
     self._log = log
     self.log = RequestLogger(logger=self._log, request_id=self._request_id)
     self.xml_response = ""
     self.parsed_grammar = []
     self.lexed_xml_response = []
     self.target_url = ""
     self.hangup_url = ""
     self.direction = ""
     self.session_params = {}
     self._action_queue = gevent.queue.Queue()
     self.default_answer_url = default_answer_url
     self.default_hangup_url = default_hangup_url
     self.answered = False
     self._hangup_cause = ""
     self.no_answer_grammar = ["Wait", "Reject", "Preanswer", "Dial"]
     self.auth_id = auth_id
     self.auth_token = auth_token
     OutboundEventSocket.__init__(self, socket, address, filter)
Example #2
0
    def __init__(self, socket, address, log, conn, conn_portab, filter=None):
        self.log = log
        self.conn = conn
        self.conn_portab = conn_portab

        self._action_queue = gevent.queue.Queue()

        OutboundEventSocket.__init__(self, socket, address, filter)
Example #3
0
    def __init__(self, socket, address, log, conn, conn_portab, filter=None):
        self.log = log
        self.conn = conn
        self.conn_portab = conn_portab

        self._action_queue = gevent.queue.Queue()

        OutboundEventSocket.__init__(self, socket, address, filter)
 def __init__(self,
              socket,
              address,
              log,
              cache,
              default_answer_url=None,
              default_hangup_url=None,
              default_http_method='POST',
              extra_fs_vars=None,
              auth_id='',
              auth_token='',
              request_id=0,
              trace=False,
              proxy_url=None):
     # the request id
     self._request_id = request_id
     # set logger
     self._log = log
     self.log = RequestLogger(logger=self._log, request_id=self._request_id)
     # set auth id/token
     self.key = auth_id
     self.secret = auth_token
     # set all settings empty
     self.xml_response = ''
     self.parsed_element = []
     self.lexed_xml_response = []
     self.target_url = ''
     self.hangup_url = ''
     self.session_params = {}
     self._hangup_cause = ''
     # flag to track current element
     self.current_element = None
     # create queue for waiting actions
     self._action_queue = gevent.queue.Queue(10)
     # set default answer url
     self.default_answer_url = default_answer_url
     # set default hangup_url
     self.default_hangup_url = default_hangup_url
     # set proxy url
     self.proxy_url = proxy_url
     # set default http method POST or GET
     self.default_http_method = default_http_method
     # identify the extra FS variables to be passed along
     self.extra_fs_vars = extra_fs_vars
     # set answered flag
     self.answered = False
     self.cache = cache
     # inherits from outboundsocket
     OutboundEventSocket.__init__(self,
                                  socket,
                                  address,
                                  filter=None,
                                  eventjson=True,
                                  pool_size=200,
                                  trace=trace)
 def __init__(
     self,
     socket,
     address,
     log,
     cache,
     default_answer_url=None,
     default_hangup_url=None,
     default_http_method="POST",
     extra_fs_vars=None,
     auth_id="",
     auth_token="",
     request_id=0,
     trace=False,
     proxy_url=None,
 ):
     # the request id
     self._request_id = request_id
     # set logger
     self._log = log
     self.log = RequestLogger(logger=self._log, request_id=self._request_id)
     # set auth id/token
     self.key = auth_id
     self.secret = auth_token
     # set all settings empty
     self.xml_response = ""
     self.parsed_element = []
     self.lexed_xml_response = []
     self.target_url = ""
     self.hangup_url = ""
     self.session_params = {}
     self._hangup_cause = ""
     # flag to track current element
     self.current_element = None
     # create queue for waiting actions
     self._action_queue = gevent.queue.Queue(10)
     # set default answer url
     self.default_answer_url = default_answer_url
     # set default hangup_url
     self.default_hangup_url = default_hangup_url
     # set proxy url
     self.proxy_url = proxy_url
     # set default http method POST or GET
     self.default_http_method = default_http_method
     # identify the extra FS variables to be passed along
     self.extra_fs_vars = extra_fs_vars
     # set answered flag
     self.answered = False
     self.cache = cache
     # inherits from outboundsocket
     OutboundEventSocket.__init__(self, socket, address, filter=None, eventjson=True, pool_size=200, trace=trace)
Example #6
0
 def __init__(self, socket, address, log,
              default_answer_url=None,
              default_hangup_url=None,
              default_http_method='POST',
              auth_id='',
              auth_token='',
              request_id=0):
     # the request id
     self._request_id = request_id
     # set logger
     self._log = log
     self.log = RequestLogger(logger=self._log, request_id=self._request_id)
     # set auth id/token
     self.auth_id = auth_id
     self.auth_token = auth_token
     # set all settings empty
     self.xml_response = ''
     self.parsed_element = []
     self.lexed_xml_response = []
     self.target_url = ''
     self.hangup_url = ''
     self.session_params = {}
     self._hangup_cause = ''
     # create queue for waiting actions
     self._action_queue = gevent.queue.Queue()
     # set default answer url
     self.default_answer_url = default_answer_url
     # set default hangup_url
     if default_hangup_url:
         self.default_hangup_url = default_hangup_url
     else:
         self.default_hangup_url = self.default_answer_url
     # set default http method POST or GET
     self.default_http_method = default_http_method
     # set answered flag
     self.answered = False
     # inherits from outboundsocket
     OutboundEventSocket.__init__(self, socket, address, filter=EVENT_FILTER, 
                                  eventjson=True, pool_size=0)
 def __init__(self, socket, address, log, filter=None):
     self.log = log
     self._action_queue = gevent.queue.Queue()
     OutboundEventSocket.__init__(self, socket, address, filter)
 def __init__(self, socket, address, log, filter=None):
     self.log = log
     self._action_queue = gevent.queue.Queue()
     OutboundEventSocket.__init__(self, socket, address, filter)
    def __init__(self, socket, address,
                 log, cache,
                 default_answer_url=None,
                 default_hangup_url=None,
                 default_http_method='POST',
                 extra_fs_vars=None,
                 auth_id='',
                 auth_token='',
                 request_id=0,
                 trace=False,
                 proxy_url=None,
                 tts_shoutcaster=None,
                 available_tts_voices=None,
                 default_tts_voices=None
		):
        # the request id
        self._request_id = request_id
        # set logger
        self._log = log
        self.log = RequestLogger(logger=self._log, request_id=self._request_id)
        # set auth id/token
        self.key = auth_id
        self.secret = auth_token
        # set all settings empty
        self.xml_response = ''
        self.parsed_element = []
        self.lexed_xml_response = []
        self.target_url = ''
        self.flags = 0
        self.session_params = {}
        self._hangup_cause = ''
        # flag to track current element
        self.current_element = None
        # create queue for waiting actions
        self._action_queue = gevent.queue.Queue(10)
        # set default answer url
        self.default_answer_url = default_answer_url
        # set default hangup_url
        self.default_hangup_url = default_hangup_url
        # set proxy url
        self.proxy_url =  proxy_url
        # set default http method POST or GET
        self.default_http_method = default_http_method
        # identify the extra FS variables to be passed along
        self.extra_fs_vars = extra_fs_vars
        # set answered flag
        self.answered = False

        self.xml_vars = {}

        self.xml_doc = None

        self.goto_count = 0

        self.initial_section = None

        self.domain_flags = 0

        self.scanner = re.Scanner([
           ('{{[^{}]+}}', lambda s, token: self.xml_vars[token[2:-2]] if self.xml_vars.has_key(token[2:-2]) else (self.session_params[token[2:-2]] if self.session_params.has_key(token[2:-2]) else token)),
           ('.', lambda s, token: token)
        ])

        self.dtmf_started = False
        self.cache = cache

        self.tts_shoutcaster = tts_shoutcaster
        #self.log.debug("tts_shoutcaster received as %s" % str(tts_shoutcaster))

        self.available_tts_voices = available_tts_voices

        self.default_tts_voices = default_tts_voices

        # inherits from outboundsocket
        OutboundEventSocket.__init__(self, socket, address, filter=None,
                                     eventjson=True, pool_size=200, trace=trace)