TCL script and early open voice channel (before connect)

Version 1
    This document was generated from CDN thread

    Created by: Alexey Ovchinnikov on 04-11-2013 02:07:04 PM
    I need to play media before connect. I use SIP for incoming call - media must play to incoming sip call.But when I use such script construction - no any rtp information in 183 progress message, but rtp is playng.So if no any information in 183 - calling parity didn't hear anything and only silence     
        leg setupack leg_incoming
        leg proceeding leg_incoming
        leg progress leg_incoming   
                 if {[infotag get cfg_avpair_exists PlayMedia]} {
        
                                                                           set PlayMedia [infotag get cfg_avpair PlayMedia]                                                                       
                                                                               puts "\n == PlayMedia found! $PlayMedia =="
                  } else {                                                
                                                                               set PlayMedia "flash:/Prompts/greeting_rec.au"
     
                                                                              puts "\n == No PlayMedia found! Try to use default! $PlayMedia ==" 
                 }                                               
          media play leg_incoming $PlayMedia


       dial-peer voice 1103 voip
    translation-profile incoming call_in
    incoming called-number 495xxxxxxx$
    voice-class sip rel1xx supported "100rel"
    voice-class sip early-offer forced
    voice-class sip send 180 sdp
    dtmf-relay rtp-nte h245-alphanumeric
    codec g711ulaw
    fax protocol pass-through g711ulaw
    ip qos dscp cs5 media
    no vad  


    Nov  3 15:45:41.809: //59465/D42C3EE59EAE/SIP/Msg/ccsipDisplayMsg:
    Sent:
    SIP/2.0 183 Session Progress
    Via: SIP/2.0/UDP 10.10.10.2:5060;branch=z9hG4bKa7bb28b5bb7a65ad42f4bbb6d
    From: <sip:10.10.10.2;user=phone>;tag=fdef7176
    To: <sip:495xxxxxxx@10.220.17.12;user=phone>;tag=2B3149F8-1ACE
    Date: Sun, 03 Nov 2013 15:45:41 GMT
    Call-ID: SBCcb069742cdd861e51fdc44384cccf0af@10.10.01.5
    CSeq: 1 INVITE
    Require: 100rel
    RSeq: 2821
    Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER
    Allow-Events: telephone-event
    Contact: <sip:495xxxxxxx@10.10.10.5:5060>
    Server: Cisco-SIPGateway/IOS-15.2.4.M5
    Content-Length: 0

    Subject: RE: TCL script and early open voice channel (before connect)
    Replied by: Geevarghese Cheria on 04-11-2013 11:26:55 PM
    Hi Alexey,
       
      As you would like to play a message to caller before connecting to called party  try adding 
       leg connect leg_incoming  also on procedure to play audio file on incoming dial peer.

    Thanks and Regards,
    Geevarghese


    Subject: RE: TCL script and early open voice channel (before connect)
    Replied by: Alexey Ovchinnikov on 05-11-2013 03:15:58 AM
    If I send leg connect leg_incoming - SIP stack will send 200 OK message and conversation will start.
    In my situation - some one call to toll free number (8-800-xxxxxxxxxx).That number must be redirected to client number. When no any employee at office - last redirection comming to mobile number - that redirection made by client PBX.
    If there no any voice message and mobile number not available at that moment - toll free service provider redirect call to autoanswering machine - cause conversation not start.
    If I start to play massage with connect (leg connect leg_incoming) and mobile number would not available at that moment - nothing happens (no any redirecting to  to autoanswering machine),  cause conversation start.
    I need to open voice channal before SIP stack will send 200 OK.

    Subject: RE: TCL script and early open voice channel (before connect)
    Replied by: Geevarghese Cheria on 05-11-2013 04:52:19 AM
    Hi Alexey,
        What you need is  if called party is unreachable the tcl application should take the call back . can you try handoff to return the call back to TCL.
     like handoff appl leg_incoming default . Also can you please share your call flow.
    Thanks and Regards,
    Geevarghese

    Subject: RE: TCL script and early open voice channel (before connect)
    Replied by: Alexey Ovchinnikov on 23-11-2013 12:39:37 PM
    It cann't help in my situation. If all endpoints unreachable - operator record voice message.
    There is my call flow:
    Someone call to toll free number (8-800-xxxxx) and operator try to redirect (by SIP) to my gateway. If all endpoints unreachable (that redirect point to group call) - operator play some message and after that record voice message, that would be send via email. My group call - try to call 10 internal phones and "last call" to external mobile number.
    In that case if I start to play voice message after connect and all 10 internal phones and mobile number would be unreachable - i can stop call only with cause code "normal call clearing". So operator redirect only "bad" calls to recording (voice-to-emal) service. If I'll hang up I must record voice message by myself....
    If I can play voice message before connect and all endpoints would be unrechable - call will stop with cause code "403 unrechable" and operator redirect that call to  recording (voice-to-emal) service.