Skip to content

Commit

Permalink
Add another check for hangups
Browse files Browse the repository at this point in the history
  • Loading branch information
bklang committed Jul 10, 2010
1 parent 3210324 commit 9688317
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/adhearsion/voip/asterisk/commands.rb
Expand Up @@ -50,8 +50,10 @@ def write(message)
# Utility method to read from pbx. Hangup if nil.
def read
returning from_pbx.gets do |message|
# AGI has many conditions that might indicate a hangup
raise Hangup if message.nil?
raise Hangup if message.match(/^HANGUP\n?$/i)
raise Hangup if message.match(/^HANGUP\s?\d{3}/i)
raise Hangup if message.match(/^511 Command Not Permitted on a dead channel/i)
ahn_log.agi.debug "<<< #{message}"
end
Expand Down

0 comments on commit 9688317

Please sign in to comment.