leg_remote_media_ip_address

Version 1
    This document was generated from CDN thread

    Created by: JAMES DEPHILLIP II on 26-10-2010 12:11:19 AM
    At what point can I collect the IP address from the media endpoint? I am using leg_remote_media_ip_address but I would like to be able to collect this information before the media play and leg collectdigits commands in act_Setup.  Is there anything I can do to achieve this?
     
     
     
    proc act_Setup { } {
    leg setupack leg_incoming
    leg proceeding leg_incoming
    leg connect leg_incoming
    global params
    global pattern
    media play leg_incoming flash:en_media_record.au
    set params(maxDigits) 1
    set pattern(1) "1"
    leg collectdigits leg_incoming params pattern
    }  
     
    proc act_Call { } {
    set phoneip [infotag get leg_remote_media_ip_address leg_incoming]
    set queryparam [::httpios::formatQuery "ip" $phoneip "uri" "http://10.30.1.111/class.xml"]
    set confirm [infotag get evt_dcdigits]
    if { $confirm == 1 } {
    set orig [infotag get leg_display_info]
    set callInfo(displayInfo) "(CUS-A) $orig"
    set dnis [infotag get leg_dnis]
    leg setup $dnis callInfo leg_incoming
    ::httpios::geturl "http://10.30.1.111/router.php" -query $queryparam -command getEndCallResponse
    } else {
    call close
    }
    }
     
    proc getEndCallResponse {token} {
     
    global stParam
     
    puts "callback Status=[::httpios::status $token],"
    if {[string compare [::httpios::status $token] ok]} {
    set resp [::httpios::data $token]
    puts "Response:  $resp"
    }
    }
     
    proc act_Cleanup { } {
    call close
    set phoneip [infotag get leg_remote_media_ip_address leg_incoming]
    set queryparam [::httpios::formatQuery "ip" $phoneip "uri" "Init:AppStatus"]
    ::httpios::geturl "http://10.30.1.111/router.php" -query $queryparam -command getEndCallResponse

     
    #---------------------------------- 
    #   State Machine 
    #---------------------------------- 
     set TopFSM(any_state,ev_disconnected) "act_Cleanup same_state"
     set TopFSM(any_state,ev_handoff) "act_Cleanup same_state"
     set TopFSM(CALL_INIT,ev_setup_indication) "act_Setup PROMPT"
     set TopFSM(PROMPT,ev_collectdigits_done)  "act_Call CALLACTIVE" 
     set TopFSM(CALLDISCONNECT,ev_disconnected)"act_Cleanup same_state"
     set TopFSM(CALLDISCONNECT,ev_disconnect_done) "act_Cleanup same_state"
     
     fsm define TopFSM CALL_INIT

    Subject: RE: leg_remote_media_ip_address
    Replied by: Yaw-Ming Chen on 26-10-2010 12:19:51 AM
    If you look at the programming guide
     
    infotag get leg_remote_media_ip_address <leg_id> the scope is "global" means that when "leg_id" is valid and available you can get it from anywhere. But the question is that does the IP information come with the call ?
     
    Thanks !

    Subject: RE: leg_remote_media_ip_address
    Replied by: JAMES DEPHILLIP II on 26-10-2010 10:39:32 AM
    Yes it comes with the call and works fine where is placed at in my script.  However if I put it the act_Setup process before leg collectdigits it will not return the information.

    Subject: RE: leg_remote_media_ip_address
    Replied by: Yaw-Ming Chen on 26-10-2010 03:18:08 PM
    If you cannot get it before media play command is issued maybe you can do a dummy media play.
     
    do  sometjing like "media play <lag_id>  %s500" -- pause for 0.5 second
     
    then get the IP