Getting channel variable in agi

Dear All
I want to get ‘RQMSTATUS’ value in my agi script.
I have use $agi->get_variable it give value at asterisk cli but i cannot store it in a variable.
How can i do it so that can store value of RQMSTATUS in a saperate variable and can perform further vale of RQMSTATUS