Created
January 15, 2009 04:49
-
-
Save marks/47261 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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