cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4344
Views
2
Helpful
8
Replies

Announcement to called number

ivana vidakovic
Level 1
Level 1

Hi,

This is my first encounter with TCL scripting.

I have a cisco router as a voice gateway (H323). It has a E1-ISDN connected to PSTN and a G0/0 to it's LAN. Whenever there is a call from one of the IP Phones to an external number (PSTN), can the voice-gateway play a message to the CALLED party before they start talking? The message should be "This call may be recorded."

Best regards,

Ivana

1 Accepted Solution

Accepted Solutions

No, below one is fine you need to add one more for ev_setup_done event.

set fsm(CALL_INIT,ev_setup_indication)  "act_Setup PLACECALL"

Please go through the sample scripts and programming guide which are present in above link.

Thanks,
Raghavendra

View solution in original post

8 Replies 8

Raghavendra G V
Cisco Employee
Cisco Employee

Hi Ivana,

Yes, you can destroy connection once you got ev_setup_done event, play message to outgoing leg and then create connection.
media play leg_outgoing greating.au

Thanks,
Raghavendra

Hi Raghavendra,

Thank you for your reply.

I think I understand how it would work, however, being new to TCL scripting I am having trouble creating the script. I was hoping you could take a look at it:

# initialize the parameters that configured from IOS CLI

proc init_configs { }  {

    global announcement

    set announcement flash:announcement.au

}

#destroy connection

proc act_Setup { } {

  global dest

  set dest [infotag get leg_outgoing]

  leg setup $dest callInfo leg_incoming

  connection destroy con_all

}

#play prompt to called number

proc act_Media { } {

  global announcement

   media play leg_outgoing $announcement

}

#create connection

proc act_Setup { } {

  global incoming

  global outgoing

  set incoming [infotag get leg-incoming]

  set outgoing [infotag get leg-outgoing]

  connection create $incoming $outgoing

}

proc act_CallSetupDone { } {

    puts ">>> Tcl: act_CallSetupDone <<<"

    set status [infotag get evt_status]

 

    handoff appl leg_all default

    call close

}

proc act_Cleanup { } { 

    call close

}

init_configs

set fsm(any_state,ev_disconnected)  "act_Cleanup  same_state"

set fsm(CALL_INIT,ev_setup_indication)  "act_Setup PLACECALL"

set fsm(PLACECALL,ev_destroy_done) "act_Media PLAYPROMPT"

set fsm(PLACECALL,ev_media_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

Aslo, if I understand correctly, I would configure this script on the inbound VoIP dial-peer, not on the outbound pots dial-peer?

Best regards,

Ivana

Hi Ivana,

You should destroy connection once you got ev_setup_done. You can refer our sample scripts in below location.

Cisco VGAPI

Thanks,

Raghavendra

Doesn't ev_setup_done indicate that the leg setup command has finished?

This is why I thought I should destroy the connection after eg setup $dest callInfo leg_incoming.

If this is not the case, can you tell me when/where I should destroy the connection?

Also, could you confirm that I configure the application on the inbound VoIP dial-peer?

leg setup command has to be finished then only you can get outgoing leg using  [infotag get leg_outgoing] .

Yes you can configure script under incoming voip dial peer.

Thanks,

Raghavendra

I just noticed I made a mistake.

I should have set fsm(CALL_INIT,ev_setup_done)   "act_Setup PLACECALL" instead of

set fsm(CALL_INIT,ev_setup_indication)  "act_Setup PLACECALL"

Is it OK now?

No, below one is fine you need to add one more for ev_setup_done event.

set fsm(CALL_INIT,ev_setup_indication)  "act_Setup PLACECALL"

Please go through the sample scripts and programming guide which are present in above link.

Thanks,
Raghavendra

Hi Ivana,

I was wondering if you were ever able to get this to work?

Thanks,

Jeff