Anyone know how return codes work and how I can use them in my dialplan? I am trying to get my system to monitor how many agents are logged into a queue. When the queue is empty the system will forward the call to an outside number. I tried setting a globalvar to the total number of agents logged in and route the call based on the value of the variable. The problem I am having is the globalvar gets reset to 0 after about 5 hours for some unknown reason. What I want to do is put a gotoif in my extensions.conf and route the call based on the value of the return code. Help!! exten => 91,1,AddQueueMember(ultramar1) exten => 91,2,SetGlobalVar(AGENTS_AVAIL=$[${AGENTS_AVAIL} + 1]) exten => 91,3,Playback(agent-loginok) exten => 91,4,Hangup exten => 91,103,Congestion exten => 91,104,Hangup ; exten => 92,1,RemoveQueueMember(ultramar1) exten => 92,2,SetGlobalVar(AGENTS_AVAIL=$[${AGENTS_AVAIL} - 1]) exten => 92,3,Playback(agent-loggedoff) exten => 92,4,Hangup exten => 92,102,Congestion exten => 92,103,Hangup John Bittner Simlab.net