media record

Version 1
    This document was generated from CDN thread

    Created by: Rok Tisler on 25-03-2010 02:11:23 PM
    Hi,
     
    I would like to record inbound calls from TCL IVR script. I have problem, that only inbound call-leg gets recorded. Dont know what am I doing wrong. Can someone point me to the right direction. Here is my script:

     
    proc init { } {
    global prompt
    if {[infotag get cfg_avpair_exists prompt]} {
    set prompt [infotag get cfg_avpair prompt]
    } else {
    set prompt "flash:prompt.au"
    }
    }
    proc Setup { } {
    set callInfo(mode) "redirect_rotary"
    leg setup [infotag get leg_dnis] callInfo leg_incoming
    }
    proc CallSetupDone { } {
    set status [infotag get evt_status]
    puts "**** evt_status = $status ****"
    if { $status != "ls_000"} {
    puts "**** error ***"
    call close
    }
    set datum [clock format [clock seconds] -format %d_%m_%Y_%H_%M_%S]
    set recordInfo(codec) g711alaw
    set recordInfo(finalSilence) 0
    set recordInfo(dtmfTerm) disable
    set recordInfo(maxDuration) 900000
    set recordInfo(maxMemory) 7200000
    set recordInfo(fileFormat) au
    set recordInfo(beep) nobeep
    set url [format %s%s%s "tftp://192.168.1.100/" $datum "_inbound.au"]
    set url2 [format %s%s%s "tftp://192.168.1.100/" $datum "_outbound.au"]
    puts "*** Recording Start ***"
    media record leg_incoming -p recordInfo $url
    puts [infotag get leg_all]
    # media record leg_outgoing -p recordInfo $url2
     
    }
    proc MediaPlay { } {
    global prompt
    leg setupack leg_incoming
    leg proceeding leg_incoming
    leg connect leg_incoming
    media play leg_incoming $prompt
    }
    proc Cleanup { } {
    call close
    }
    init
     
    #----------------------------------
    # State Machine
    #----------------------------------
     
    set FSM(CALL_INIT,ev_setup_indication) "MediaPlay,PROMPT"
    set FSM(PROMPT,ev_media_done) "Setup,PLACECALL"
    set FSM(PLACECALL,ev_setup_done) "CallSetupDone,CALLACTIVE"
    set FSM(CALLACTIVE,ev_disconnected) "Cleanup,CALLDISCONNECTED"
    set FSM(CALLDISCONNECTED,ev_disconnect_done) "Cleanup,CALLDISCONNECTED"
    set FSM(any_state,ev_any_event) "Cleanup,same_state"
    fsm define FSM CALL_INIT
     

    Subject: RE: media record
    Replied by: Vijay Prasad Neelamegam on 25-03-2010 03:44:53 PM
     
     
    Hi Rok,
     
    In the Script,you have mentioned only incoming leg has to be recorded.AFAIK in TCL,we cannot record both the legs in a single media record command.
     
    The media record command records the audio received on the specified call leg and saves it to the location specified by the URL.

     
    Please go through our programming guide more info

    http://www.cisco.com/en/US/docs/ios/voice/tcl/developer/guide/tclivrv2_ch3.html#wp1078100
     
    Thanks
    Vijay

    Subject: RE: media record
    Replied by: Rok Tisler on 26-03-2010 10:06:57 AM
    Hi,
     
    Many thanks for your quick reply. You can see second commented media record comand, witch if uncommented records the outgoing call-leg, but the issue here is, that there is one way audio...
    Should i use 2 scripts to capture 2 call legs?
     
    Thanks,
    Rok

    Subject: RE: media record
    Replied by: Vijay Prasad Neelamegam on 26-03-2010 11:06:44 AM
    Hi Rok,
     
    You can use the following command to record incoming and outgoing leg.But you cannot record when the call is bridged.Still this facility is not implemented.
     
     media record leg_incoming -p recInfo flash:call_in.au
     media record leg_outgoing -p recInfo flash:call_out.au
     
    Thanks
    Vijay