Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #controller app
- numbers_to_call.each{|phone|
- AHN = Drb...
- AHN.async_originate_call(num, sip_peer)
- }
- # Adhearsion events.rb
- events.asterisk.manager_interface.each do |event|
- if event.name == 'OriginateResponse'
- # Grab the mdr_id if this originate response matches the unique ID (action id ) of one we have previously stored
- ahn_log event.headers['ActionID']
- ahn_log OriginateResponses[event.headers['ActionID']]
- ahn_log event.pretty_inspect
- mdr_id = OriginateResponses[event.headers['ActionID']]
- update_call_status(mdr_id)
- end
- end
- # dialplan
- context {
- mdr_id = variable("mdr_id")
- amdstatus = variable("AMDSTATUS")
- ahn_log "going to deliver message based on mdr #{mdr_id} with an AMD status of #{amdstatus}"
- mdr = MessageDeliveryResult.find_by_id(mdr_id)
- do adhearsion call stuff
- mdr.attr = somthing
- mdr.save
- }
Add Comment
Please, Sign In to add comment