Skip to content

Instantly share code, notes, and snippets.

@benlangfeld
Created March 28, 2011 16:13
Show Gist options
  • Save benlangfeld/890738 to your computer and use it in GitHub Desktop.
Save benlangfeld/890738 to your computer and use it in GitHub Desktop.
from_pstn {
menu 'welcome', 'for-spanish-press-8', 'main-ivr',
:timeout => 8.seconds, :tries => 3 do |link|
link.shipment_status 1
link.ordering 2
link.representative 4
link.spanish 8
link.employee 900..999
link.on_invalid { play 'invalid' }
link.on_premature_timeout do |str|
play 'sorry'
end
link.on_failure do
play 'goodbye'
hangup
end
end
}
shipment_status {
# Fetch a tracking number and pass it to a web service.
}
ordering {
# Enter another menu that lets them enter credit card
# information and place their order over the phone.
}
representative {
# Place the caller into a queue
}
spanish {
# Special options for the spanish menu.
}
employee {
dial "SIP/#{extension}" # Overly simplistic
}
[from_dallas]
exten => _X.,1,AGI(agi://localhost)
exten => _X.,n,Hangup
[from_chicago]
exten => _X.,1,AGI(agi://localhost)
exten => _X.,n,Hangup
from_omaha {
play 'hello', 'omaha', 'and'
+from_nebraska
}
from_nebraska {
play 'hello', 'nebraska'
# do more here
}
from_texas {
play 'hello', 'texas'
# do more here
}
from_illinois {
play 'hello', 'illinois'
# do more here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment