This file contains hidden or 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
# Helpers by Mark S. - [email protected] | |
def say_swift(text) | |
text = %{"#{text}"} | |
execute 'swift', text.to_s | |
end | |
This file contains hidden or 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
# File adhearsion/lib/adhearsion/initializer/configuration.rb, line 143 | |
def default_listening_port | |
4573 | |
end |
This file contains hidden or 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 |
This file contains hidden or 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}) | |
ahn_log.debug "Agent (Asterisk ID: #{@agent.asteriskID}) logged off" | |
end | |
end | |
This file contains hidden or 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
>> require 'adhearsion' | |
=> [] | |
>> AdhearsionDRB.send_action(:queuestatus) | |
=> #<DRb::DRbUnknown:0xb7434448 @buf="\004\b[\ao:?Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent\a:\r@headersC:\036HashWithIndifferentAccess{\017\"\016Completed\"\0060\"\025ServicelevelPerf\"\b0.0\"\016Abandoned\"\0060\"\nCalls\"\0060\"\021ServiceLevel\"\0060\"\bMax\"\0060\"\rHoldtime\"\0060\"\vWeight\"\0060\"\rActionID\")1goQwOQa-Fwtu-L0xu-CwHN-uxlbfUEyWadl\"\nQueue\"\ais:\n@name\"\020QueueParamso;\000\a;\006C;\a{\017\"\vStatus\"\0061\"\017CallsTaken\"\0060\"\017Membership\"\fdynamic\"\tName\"\031Local/8267004@agents\"\rLastCall\"\0060\"\fPenalty\"\0060\"\vPaused\"\0060\"\rLocation\"\031Local/8267004@agents\"\rActionID\")1goQwOQa-Fwtu-L0xu-CwHN-uxlbfUEyWadl\"\nQueue\"\ais;\b\"\020QueueMember", @name="Adhearsion::VoIP::Asterisk::Manager::"> |
This file contains hidden or 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
Loading development environment (Rails 2.2.2) | |
>> response = AdhearsionDRB.send_action "QueueStatus" | |
=> #<DRb::DRbUnknown:0xb7760e3c @buf="\004\b[\ao:?Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent\a:\r@headersC:\036HashWithIndifferentAccess{\017\"\016Completed\"\0060\"\025ServicelevelPerf\"\b0.0\"\016Abandoned\"\0060\"\nCalls\"\0060\"\021ServiceLevel\"\0060\"\bMax\"\0060\"\rHoldtime\"\0060\"\vWeight\"\0060\"\rActionID\")De9QZUP4-qk4t-q4lq-hRej-NMQXVwQJV2f7\"\nQueue\"\ais:\n@name\"\020QueueParamso;\000\a;\006C;\a{\017\"\vStatus\"\0061\"\017CallsTaken\"\0060\"\017Membership\"\fdynamic\"\tName\"\031Local/8267004@agents\"\rLastCall\"\0060\"\fPenalty\"\0060\"\vPaused\"\0060\"\rLocation\"\031Local/8267004@agents\"\rActionID\")De9QZUP4-qk4t-q4lq-hRej-NMQXVwQJV2f7\"\nQueue\"\ais;\b\"\020QueueMember", @name="Adhearsion::"> | |
>> response[0].headers | |
NoMethodError: undefined method `[]' for #<DRb::DRbUnknown:0xb7760e3c> | |
from (irb):2 |
This file contains hidden or 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
>> pp AdhearsionDRB.send_action(:queuestatus) | |
[#<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0xb73aab08 | |
@headers= | |
{"Completed"=>"2", | |
"Abandoned"=>"4", | |
"ServicelevelPerf"=>"0.0", | |
"Calls"=>"0", | |
"Max"=>"0", | |
"ServiceLevel"=>"0", | |
"Holdtime"=>"9", |
This file contains hidden or 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
events.asterisk.hungup_call do |event| | |
#code here | |
end |
This file contains hidden or 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
events.asterisk.hungup_call do |event| | |
#code here | |
end |
This file contains hidden or 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
##events.rb | |
events.asterisk.manager_interface.each do |event| | |
if event.name.downcase == "newchannel" | |
launch_new_call_method(event) | |
end | |
end | |
##component.rb | |
OlderNewer