Created
May 20, 2010 18:40
-
-
Save sprite2005/407912 to your computer and use it in GitHub Desktop.
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
| def verify_number_request(phonenumber_id) | |
| phonenumber = PhoneNumber.find_by_id phonenumber_id | |
| #Create a new hash with the guid as the key to track this call session | |
| session = CallSession.new | |
| session.session_type = 'verification' | |
| session.phonenumber_id = phonenumber.id | |
| session.client_id = phonenumber.user_id | |
| session.client_channel = 'UNASSIGNED' | |
| session.vendor_channel = 'UNASSIGNED' | |
| session.save | |
| response = originate({ :channel => format_number(phonenumber.number, phonenumber.phone_type.phonetype), | |
| :context => 'verify_number', | |
| :exten => 's', | |
| :priority => '1', | |
| :variable => "session_id=#{session.id}", | |
| :timeout => ::APP_CONFIG['adhearsion']["time_to_answer_timeout"]*1000, | |
| :async => 'true' }) | |
| session.actionid = response.headers["ActionID"] | |
| session.save | |
| return session.id | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment