Skip to content

Instantly share code, notes, and snippets.

@marks
Created January 15, 2009 04:50
Show Gist options
  • Save marks/47262 to your computer and use it in GitHub Desktop.
Save marks/47262 to your computer and use it in GitHub Desktop.
component agent_logoff w/ Adhearsion
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})
ahn_log.debug "Agent (Asterisk ID: #{@agent.asteriskID}) logged off"
end
end
end
## jicksta help:
# hangup if kind_of? Adhearsion::DialPlan::ExecutionEnvironment # (would let me call dialplan commands in same method
# OR
# refactor code into one of each: global, dialplan, rpc methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment