Exemplo n.º 1
0
    def _dispatch(req):
        """Dispatch the request to the appropriate controller.

        Called by self._router after matching the incoming request to a route
        and putting the information into req.environ.  Either returns 404
        or the routed WSGI app's response.

        """
        match = req.environ['wsgiorg.routing_args'][1]
        if not match:
            msg = _('The resource could not be found.')
            return render_exception(exception.NotFound(msg),
                                    request=req,
                                    user_locale=best_match_language(req))
        app = match['controller']
        return app
Exemplo n.º 2
0
 def _get_sip(self, session, sip_account_id):
     """Private method to get a sip model object (NOT a dictionary)."""
     ref = session.query(AzureSIPModel).get(sip_account_id)
     if not ref:
         raise exception.NotFound(target=sip_account_id)
     return ref
Exemplo n.º 3
0
 def get_sip(self, sip_account_id):
     session = sql.get_session()
     ref = session.query(AzureSIPModel).get(sip_account_id)
     if not ref:
         raise exception.NotFound(target=sip_account_id)
     return ref.to_dict()
Exemplo n.º 4
0
 def get_extension_info(self, context, extension_alias):
     try:
         return {'extension': self.extensions[extension_alias]}
     except KeyError:
         raise exception.NotFound(target=extension_alias)
Exemplo n.º 5
0
 def _get_sid(self, session, sid_id):
     """Private method to get a sid model object (NOT a dictionary)."""
     ref = session.query(SIDModel).get(sid_id)
     if not ref:
         raise exception.NotFound(target=sid_id)
     return ref
Exemplo n.º 6
0
 def get_sid(self, sid_id):
     session = sql.get_session()
     ref = session.query(SIDModel).get(sid_id)
     if not ref:
         raise exception.NotFound(target=sid_id)
     return ref.to_dict()