Skip to content

Instantly share code, notes, and snippets.

@marks
Created January 15, 2009 04:49
Show Gist options
  • Save marks/47261 to your computer and use it in GitHub Desktop.
Save marks/47261 to your computer and use it in GitHub Desktop.
methods_for :global do
def agent_logoff(id)
@agent = Agent.find_by_id(id)
#DIALPLAN.execute 'RemoveQueueMember','is',"#{@agent.channel}"
if VoIP::Asterisk.manager_interface.send(:send_action, :QueueRemove, {"Queue" => "is", "Interface" => @agent.channel})
@agent.update_attributes(:channel => nil)
ahn_log.debug "Agent (Asterisk ID: #{@agent.asteriskID}) logged off"
else
ahn_log.debug "FAILURE FAILURE :: Agent (Asterisk ID: #{@agent.asteriskID}) logged off"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment