cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2986
Views
0
Helpful
6
Replies

TCL prompt not playing in outgoing dialpeer

adam1177671
Level 1
Level 1

Hi Guys,

I would appreciate your help on this. I used play_message_2_calling_then_connect.tcl script to play a prompt and connected the called party in the incoming POTS dial peer and it worked perfectly fine but unfortunately due to ISDN overlap receiving the digits I have to move this to the outgoing voip dialpeer and the prompt is not playing any more under outgoing voip dialpeer. I understand this script is done for incoming dialpeer so I modified the script to adopt to the outgoing dialpeer but still I cant get it working. Can someone let me know where I am missing the point here. Please see the script below.

Thanks in advance

===================

# initialize the parameters that configured from IOS CLI
proc init_configs { }  {

    global prompt1
  

    if [infotag get cfg_avpair_exists prompt-1] {
       set prompt1 [string trim [infotag get cfg_avpair prompt-1]]
    }

}

#procedure to play audio file on incoming dial peer
proc act_Media { } {
    global prompt1
    global dest

    set dest [infotag get leg_dnis]


    #leg setupack leg_outgoing
    #leg proceeding leg_outgoing
    #leg connect leg_outgoing

media play leg_outgoing $prompt1

leg setup leg_outgoing

}

# setup the call, connect caller to called party
proc act_Setup { } {
    global dest

    puts ">>> Tcl: proc act_Setup <<<"
    puts ">>> TCL:Final Dest: $dest <<<"
   
    # handoff appl leg_incoming default "DESTNATION=$dest"
     handoff appl leg_outgoing default "DESTINATION=$dest"
    #leg setup $dest callInfo leg_incoming
     act_Cleanup

}

proc act_CallSetupDone { } {


    puts ">>> Tcl: act_CallSetupDone <<<"
    set status [infotag get evt_status]
   
    handoff appl leg_all default
    call close

}

# disconnect the call
proc act_Cleanup { } {
    puts ">>> Tcl: act_Cleanup <<<"
    call close
}

init_configs

set fsm(any_state,ev_disconnected)  "act_Cleanup  same_state"
set fsm(CALL_INIT,ev_handoff)  "act_Media PLAYPROMPT"
set fsm(PLAYPROMPT,ev_media_done) "act_Setup PLACECALL"
set fsm(PLACECALL,ev_setup_done)   "act_CallSetupDone  CALLACTIVE"
set fsm(CALLACTIVE,ev_disconnected)      "act_Cleanup CALLDISCONNECT"
set fsm(CALLDISCONNECT,ev_disconnected)   "act_Cleanup         same_state"
set fsm(CALLDISCONNECT,ev_media_done)     "act_Cleanup         same_state"
set fsm(CALLDISCONNECT,ev_disconnect_done) "act_Cleanup         same_state"


fsm define fsm CALL_INIT

=================================================

1 Accepted Solution

Accepted Solutions

To configure script under outgoing dial peer you need to configure as below.

dial-peer voice 560 voip

translation-profile outgoing PLAYPROMPT

service welcome_out out-bound

Handoff command with leg_incoming

handoff appl leg_incoming default "DESTNATION=$dest"

You can enable below debugs to check logs.

debug voip app

Thanks,

Raghavendra

View solution in original post

6 Replies 6

Raghavendra G V
Cisco Employee
Cisco Employee

Hi Niyaz,

You are applying script under outgoing dial peer, do you want to play prompt to calling party(incoming) or to the called party?.

Thanks,

Raghavendra

Raghavendra G V
Cisco Employee
Cisco Employee

If you are playing prompt for incoming leg for script under outgoing dial peer, just issue leg connect and media play command as below.

    set dest [infotag get evt_handoff dnis]

    #leg setupack leg_incoming

    #leg proceeding leg_incoming

    leg connect leg_incoming   

    media play leg_incoming $prompt1

make sure you are applying script under correct outgoing dial peer, you may go in loop with script .

Thanks,

Raghavendra

Hi Raghavendra,

Many thanks for the reply and just to answer the initial question. Yes the prompt should be played to the calling party (external caller) and the user phone should ring once the prompt finished playing to the other side. It worked fine when I used the script under the incoming POTS dialpeer but since I moved this under outgoing voip dialpeer it stopped working.

I modified the script as per your suggestion and still it doesn't play but the phone rings. Please see my configs below

Application Registration

====================

service welcome_out bootflash:play_msg_out.tcl

  param prompt-1 bootflash:calls_recorded.wav

Dial peer incoming

==============

dial-peer voice 19 pots

translation-profile incoming TRANS-IN

incoming called-number 1237560

direct-inward-dial

Dial peer outgoing

==============

dial-peer voice 560 voip

translation-profile outgoing PLAYPROMPT

service welcome_out

destination-pattern 9001237560  <---- (this is getting translated/pre-fixed under pots TRANS-IN above)

session protocol sipv2

session target ipv4:x.x.x.x

voice-class sip bind control source-interface Loopback0

voice-class sip bind media source-interface Loopback0

dtmf-relay cisco-rtp

codec g711ulaw

no vad

Script

========================


# initialize the parameters that configured from IOS CLI
proc init_configs { }  {

    global prompt1
  

    if [infotag get cfg_avpair_exists prompt-1] {
       set prompt1 [string trim [infotag get cfg_avpair prompt-1]]
    }

}

#procedure to play audio file on incoming dial peer
proc act_Media { } {
    global prompt1
    global dest


set dest [infotag get evt_handoff dnis]
    leg connect leg_incoming   
    media play leg_incoming $prompt1

}

# setup the call, connect caller to called party
proc act_Setup { } {
    global dest

    puts ">>> Tcl: proc act_Setup <<<"
    puts ">>> TCL:Final Dest: $dest <<<"
   
    # handoff appl leg_incoming default "DESTNATION=$dest"
     handoff appl leg_outgoing default "DESTINATION=$dest"
    #leg setup $dest callInfo leg_incoming
     act_Cleanup

}

proc act_CallSetupDone { } {


    puts ">>> Tcl: act_CallSetupDone <<<"
    set status [infotag get evt_status]
   
    handoff appl leg_all default
    call close

}

# disconnect the call
proc act_Cleanup { } {
    puts ">>> Tcl: act_Cleanup <<<"
    call close
}

init_configs

set fsm(any_state,ev_disconnected)  "act_Cleanup  same_state"
set fsm(CALL_INIT,ev_handoff)  "act_Media PLAYPROMPT"
set fsm(PLAYPROMPT,ev_media_done) "act_Setup PLACECALL"
set fsm(PLACECALL,ev_setup_done)   "act_CallSetupDone  CALLACTIVE"
set fsm(CALLACTIVE,ev_disconnected)      "act_Cleanup CALLDISCONNECT"
set fsm(CALLDISCONNECT,ev_disconnected)   "act_Cleanup         same_state"
set fsm(CALLDISCONNECT,ev_media_done)     "act_Cleanup         same_state"
set fsm(CALLDISCONNECT,ev_disconnect_done) "act_Cleanup         same_state"


fsm define fsm CALL_INIT

===========================

Please see what else I am doing wrong here and let me know your thoughts.

Thanks

Regards

To configure script under outgoing dial peer you need to configure as below.

dial-peer voice 560 voip

translation-profile outgoing PLAYPROMPT

service welcome_out out-bound

Handoff command with leg_incoming

handoff appl leg_incoming default "DESTNATION=$dest"

You can enable below debugs to check logs.

debug voip app

Thanks,

Raghavendra

Superb!

That works as expected. Thanks Raghavendra for your time and I really appreciate it

Regards

stoyan.stamatov
Level 1
Level 1

Used the same script applied on outbound dial-peer, message is played, but the outgoing leg is not created. Any guess what might be the reason?