Skip to content

Instantly share code, notes, and snippets.

@libryder
Created November 8, 2011 18:44
Show Gist options
  • Save libryder/1348693 to your computer and use it in GitHub Desktop.
Save libryder/1348693 to your computer and use it in GitHub Desktop.
Crash asterisk with adhearsion
#as soon as caller hangs up, asterisk goes down
cellphone_ivr {
key = input 1, :timeout => 5.seconds, :speak => {:text => "You appear to be calling from the #{@calling_area} area; Press 1 if correct. Press 2 to enter zipcode.", :interruptible => true}
if key == "1"
speak "One moment please."
+route_to_store
elsif key == "2"
+play_enter_zip_ivr
else
+cellphone_ivr
end
}
#add recursive limit
cellphone_ivr {
@tries = @tries + 1
key = input 1, :timeout => 5.seconds, :speak => {:text => "You appear to be calling from the #{@calling_area} area; Press 1 if correct. Press 2 to enter zipcode.", :interruptible => true}
if key == "1"
speak "One moment please."
+route_to_store
elsif key == "2"
+play_enter_zip_ivr
elsif @tries <= 3
+cellphone_ivr
else
speak "Thanks for trying."
hangup
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment