Hello,

 

I've been looking for this on voip-info and this list threads, and I am
guessing I am not looking right.

What I need is the way to capture (and write to DB) the information on who
'picked' or 'received' the incoming call.

 

Here is the example of .rb file that is called from extensions.conf:

 

 

                private  

                def lokal

                                call_log_id = nil

                                begin

                                                call_log_id = call_log()

                                

                                                $agi.answer

                                                $agi.exec('WAIT', '2')

                                

                                                local_channels =
get_locals()

                                                dial_params =
local_channels.join('&')

                                                dial_params <<
"||m(moh-0900...@moh_id})" if moh_available?()

 

                                                1.times do

                                                                r =
$agi.exec('DIAL', dial_params)

                                                                r =
$agi.get_variable('DIALSTATUS')

                                                                retry if
r.message.include?('BUSY')

                                                end

                                                

                                ensure

                                                call_log(call_log_id) unless
call_log_id.nil?

                                end

                end

                 

                private

                def get_locals

                                local_channels = @locals.map { |x|
'Sip/operator1&Zap/' + x.strip }

                                # FIX - ovaj raise treba da prijavi
nedefinisane lokale za servis a ne za telefon

                                raise "Nisu definisani lokalni kanali u
settings za telephone_id = #...@settings_row['telephone_id']}" if
local_channels.empty?

                                local_channels

                end

 

 

 

As you see the call can be picked either by the Zap channels in locals of
SIP/operator user. Now i Need to know here:

 

 

                                                $my.select_db('tvr2')

                                                $my.query("UPDATE call_log
SET endtime = NOW(), local=#SOMETHINGHERE# WHERE id = #{call_log_id}")

                                                raise 'Cant write from log:
call_log_id = #{call_log_id}' if $my.affected_rows() != 1

 

 

 if place of #SOMETHINGHERE# - where the call was transferred (from the part
above).

 

Anyone?>

 

 

 

 

 

 

 

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to