def post(self):
     self.render_json(db_helper.agent_login(self.request.params))
     call = db_helper.get_call_from_queue()
     if call:
         params = dict(aleg_url="https://go-for-plivo.appspot.com/route", aleg_method="POST")
         response = plivo.RestAPI("MAMWQ3MJCWMJI0ZME5MD","ZDNhYmZhY2U4NWRlNGY2MGI4MzMwZjQxZGZjZWJh").Call.transfer(call.Id, **params)
         log.info(response)
    def end(self):
        try:
            db_helper.call_completed(self.request.params.get("CallUUID"))
        except NoResultFound:
            log.error("Thats no good. Where did "+self.request.params.get("CallUUID")+" go?")


        call = db_helper.get_call_from_queue()
        if call:
            params = dict(aleg_url="https://go-for-plivo.appspot.com/route", aleg_method="POST")
            response = plivo.RestAPI("MAMWQ3MJCWMJI0ZME5MD","ZDNhYmZhY2U4NWRlNGY2MGI4MzMwZjQxZGZjZWJh").Call.transfer(call.Id, **params)
            log.info(response)