Timing a second call after call_into_context

6 views
Skip to first unread message

Quinn McLaughlin

unread,
Mar 24, 2008, 3:23:56 PM3/24/08
to Adhearsion
Pardon if this is sophomoric to some of you - I've been digging for a
sample of this for a couple hours and was hoping you might be able to
help me.

I'm trying to figure out how to time a second call placed within the
dialplan. Ideally I'd like to get the uniqueid for the second call
and the bill time right from asterisk's CDR records.

I'm placing a call with a Ruby script, using

Adhearsion = DRbObject.new_with_uri 'druby://voip.tronics.com:9050'
Adhearsion.proxy.call_into_context "SIP/
#{ARGV[0]}@outgoing","quinn", :caller_id => "8005551212"

(again, thanks Philippe!)
in my dialplan.rb I have the context "quinn" referenced:

quinn {
play %w(pbx-transfer)
puts Time.now
puts "test callerID #{callerid} uniqueid #{uniqueid}"
dial "SIP/18314219344@outgoing", :for => 10.seconds
play %w(beep)
puts "after call "
puts Time.now
}

So I am able to get the callerid and uniqueid for the first call - how
can I get the time of call -either using Adhearsion's time() method or
better yet, just getting to the CDR records directly for the billtime
and uniqueid?

Thanks for your help - I appreciate the assistance very much!

Quinn McLaughlin
Reply all
Reply to author
Forward
0 new messages