def send_mob_response(self, request_code, params, echo_params):
            app_id = ""
            response = "640 <This feature is not supported>##" \
                        + echo_params + "##"
            bypass = False;
	    if request_code == 800:
                app_id, response = self.create_802_response(params, echo_params)
                response +=  echo_params
	        self.send_device_resp(app_id, response);
            else :
                parsed_echo_params = Parser.parse_echo_params(echo_params)
                request_code = str(request_code)
		print parsed_echo_params;
                #router = parsed_echo_params['ROUTER'].lower()
		router = 'opx'
                if ( general_responses.has_key( router) ):
			if (general_responses[router].has_key(request_code)):
				response = re.findall("\d\d\d.*<.*>", general_responses[router][request_code] )[0]
				response = response + echo_params;
		            	self.send_device_resp(app_id, response);
			else:
				bypass = True;
	        else:
	   		bypass = True
		if bypass:
			req = request_code + " <" + params + ">##" + echo_params + "##"
			ubac_req = {"mobile_request" : req }
			r = "http://poolws2-us-beta.marketsimplified.com/raw/2?"+ urllib.urlencode(ubac_req) 
    			(a,b) = httplib2.Http().request(r)
			response = b;
	            	self.send_device_resp(app_id, response);
			return;
        def create_response(self, response, request_echo_params):
            parser = RequestUtils.validate(response)
            #merging the echo_params
            response = parser[0] + " <" + parser[1] + ">"
            response += "##" + request_echo_params + "##";
	    response = response.replace("<<","<").replace(">>",">");
            if len(parser) == 3 and parser[2] != '':
                response += "," + parser[2]
                parsed_echo_params = Parser.parse_echo_params(parser[2])
                if parsed_echo_params.has_key('TEST_TIMEOUT'):
                    time_out = int(parsed_echo_params['TEST_TIMEOUT'])
                    time.sleep(time_out)

            response += "##"

            return response
        def create_802_response(self, params, echo_params):
            params = Parser.parse_800_params(params)
            if len(params) == 0: return ["", "640 <Invalid Request>"]

            echo_params = Parser.parse_echo_params(echo_params)
            if not echo_params.has_key('ROUTER'):
                return ["", "640 <No Router>"]
        
            app_id = ""    
            if params.has_key('APP_ID'):

                app_id = params['APP_ID']
                if app_id == '?' or not devices.has_key(app_id):
                    app_id = RequestUtils.generateAppId()
                    self.addDeviceData(app_id, params, echo_params)

                response = "802 <APP_ID=" + app_id + ">"
            else :
                response = "640 <No app_id in the request>"

	    response = response.replace("####", "##");
            return [app_id, response]