Delayed Ringback

Version 1
    This document was generated from CDN thread

    Created by: JAMES DEPHILLIP II on 25-10-2010 02:31:57 PM
    I have a script that plays a prompt to confirm the call but when the person confirms the ringback tone is delayed.  Here is a copy of my script if anyone can assist with why this would happen.
     
    Thanks
     

    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: Delayed Ringback
    Replied by: Yaw-Ming Chen on 25-10-2010 02:57:07 PM
    How long is the delay ?
     
    Try just use "leg collectdigits leg_incoming params" to see if it helps ?
     
    You can turn on "deb voip app tcl"watch the when when digit is pressed and when is received by Tcl.
     
    You can also
    set callInfo(notifyEvents) "ev_alert ev_progress ev_proceeding"
    to observe when ringing is recieved from far end.
     
    Thanks !

    Subject: RE: Delayed Ringback
    Replied by: JAMES DEPHILLIP II on 25-10-2010 03:31:20 PM
    I gave that a try and it didn't change anything.  How do I use leg setup_continue?  Would that help I think I need it so that I can perform functions once the call is setup.

    Subject: RE: Delayed Ringback
    Replied by: Yaw-Ming Chen on 25-10-2010 03:57:23 PM
    No, I don't think it will help. My suggestion is to find out what causes the delay ?
    You set params(maxDigits) 1 so scrript should continue as soon as digit is pressed otherwise it will wait for digit time out.
    If you press "#' after confirm digit is delay still there ?
     
    Thanks !

    Subject: RE: Delayed Ringback
    Replied by: JAMES DEPHILLIP II on 25-10-2010 04:03:33 PM
    No I need setup and continue so that I can learn the IP of the Media Endpoint before I continue the script. Right now I am launching the media play and digit collect and then performing my http commands.  I need to push the http commands first and the script gives a blank if I try to use [infotag get leg_remote_media_ip_address leg_incoming] before the media play and leg collect digits.  As for the delay the other phone is ringing instantly but the ringback is not.

    Subject: RE: Delayed Ringback
    Replied by: Yaw-Ming Chen on 25-10-2010 04:41:01 PM
    For leg stuup_continue we need to know command_handle of leg setup
    We can get it by doing the following
     
     leg setup $dest callInfo
        set commandSetup [infotag get last_command_handle]
     
    Thanks !

    Subject: RE: Delayed Ringback
    Replied by: Yaw-Ming Chen on 25-10-2010 05:48:32 PM
    I think if you use "infotag get leg_remote_signaling_ip_addres" you might get CM's IP but I doubt if you can get end point IP.
    If it is SIP trunk we might be able to parse header. Of cause only header contains end point's IP.
     
    Thanks !