cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Walkthrough Wednesdays
991
Views
0
Helpful
11
Replies
Slavik Bialik
Rising star

TCL - how to connect legs to a connection

Hi all,

I'm trying to achieve using a TCL-IVR application script something that should be simple but for some reason I'm not able to understand how to do it properly. Hope anyone knows how to do that.

I have an IVR that the call should get into, this IVR makes some VXML calls and HTTP requests behind the scenes, and after that it redirects the call to a hunt pilot on CUCM.

What I want to do with an incoming call is to make the voice gateway using TCL send "proceeding" (which works fine) in order for the caller to hear a ringback tone, and on the other hand make a "leg setup" to the IVR number so it'll create a new outgoing leg towards the IVR but I DO NOT WANT to connect between those 2 legs YET. Only after a phone in an hunt pilot answers the call, after redirected from the IVR, I want to detect the relevant event (which should be 'ev_media_update_ind') and connect between those legs.

 

I tried lots of things, but I cannot make it work. Tried to use the handoff method as I saw in lots of similar (but not much) examples, but I do not know if in my case I need it.

 

When I'm trying to do the "connection create" command I'm always getting:

Jan 29 09:40:17.313: TCL script failure
        Result:
                         failed
Jan 29 09:40:17.313:    TCL script failure errorInfo:
                        failed
    while executing
"connection create $incoming_leg $outgoing_leg"
    (procedure "act_setup_done" line 33)
    invoked from within
"act_setup_done"

Here are some parts from the code:

proc act_setup { } {
	global env
	
	# if leg contains did
	if { [infotag get leg_isdid] } {
		set env(dest) [infotag get leg_dnis];                     
		if { $env(icm_dn) != "" } { set env(dest) $env(icm_dn) }
		
		set callInfo(originationNum) [infotag get leg_ani]
		
		leg proceeding leg_incoming
		leg connect [infotag get leg_incoming]
		
		leg setup $env(dest) callInfo
	} else {
	#
	}
}

proc act_setup_done {} {
	global env
	
	set status [infotag get evt_status];	# get the event of the call during the setup_done
	
	# if the event status is 'ls_000' means the call setup has passed ok
	if { $status == "ls_000"} {
		
		set incoming_leg [infotag get leg_incoming]
                set outgoing_leg [infotag get leg_outgoing]		
		
		connection create $incoming_leg $outgoing_leg
	} else {
		# 
	}
}

set fsm(CALL_INIT,ev_setup_indication)       "act_setup          CALL_SETUP"
set fsm(CALL_SETUP,ev_setup_done)            "act_setup_done     CALL_ACTIVE"

fsm define fsm CALL_INIT

The above snippet is a simple try of mine just to connect both legs of the call, one of them is the caller and the second one is the IVR. When I will accomplish that, I'll try to make it work that only when a phone from the hunt pilot answered the call so only then it'll connect between legs. 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Slavik,

The following procedures work for me:

proc act_setup { } {

global env

if { [infotag get leg_isdid] } {
set env(dest) [infotag get leg_dnis]

leg proceeding leg_incoming
leg setup $env(dest) callInfo
} else {
#
}
}

proc act_setup_done {} {

global env

if { $status == "ls_000"} {
set param(consumeDigit) true
set param(enableReporting) true

leg connect leg_incoming

connection create leg_incoming leg_outgoing

} else {
#
}
}

View solution in original post

11 REPLIES 11
Slavik Bialik
Rising star

Hi, anyone? :)

A C
Beginner
Beginner

Just to make sure, can you test changing:

leg setup $env(dest) callInfo

into

leg setup 1234 callInfo

where 1234 is a real extension.

See if it works.

 

Besides, is the destination IVR local to the CM?

Is it handled by another CM?

 

If this test fails too, I'll help you dig further into the problem.

Hi, 

Thanks for replying! :)

I tried both ways, as you suggested, without a variable but with a single number and the same result.

And yes, the destination is a CUCM. An hunt pilot on CUCM.

I'm reaching setup_done event fine, but only when I'm trying to make a connection between both legs I'm getting the error I described. Without getting make a connection, the call that triggered by "leg setup" to an hunt pilot is being answered and phone is kind of in call state, but on the caller side i'm still hearing the ringback tone because of the "proceeding" I'm sending to the incoming leg.

 

I also tried out to take major parts from your TCL script (the one I sent you PM about) and still the same issue.

 

BTW, more about the environment if it matters...

PSTN --(sip)--> CUBE --(sip)--> CUCM -> Hunt

CUBE is based on IOS-XE 16.12 firmware. And handling SIP to SIP calls.

 

Thanks!

I wanted you to test if the script works using a real extension, not another tcl.

Can you please try if you get the call connected to a real phone?

Hi,

When you say to test it out with a real extension you mean by doing what you suggested above, right?

Like that:

leg setup 1234 callInfo

If so, yes, I already tested it out with a destination of a phone like in the example above. But still the same problem.

And what do you mean by "not another tcl"? The above is triggered only by TCL IVR script.

 

Thanks! :)

I wanted to make sure the problem appears with a real device.

 

Ok, can you post a full debug with "debug voice application error" (if you can, you can also add voice application session)

 

 

OK, I'll let you know tomorrow, I'm not at the office and can't fully simulate it right now.
Thanks for the help, I'll post what you asked tomorrow ;)

Hi,

Those are the only errors I got from both debugs:

Feb  3 08:18:55.294: //115794//XCCS:/C_PackageXCCSession_AcceptCallCheck: No AcceptCall; XCC application is unregistered
Feb  3 08:18:55.300: //-1//AFW_:/AFW_Util_CopyMLPPDataToCallInfoContainer: Voice MLPP not configured
Feb  3 08:18:55.301: //-1//AFW_:/AFW_Util_CopyMLPPDataToCallInfoContainer: Voice MLPP not configured
Feb  3 08:18:55.301: //-1//AFW_:/AFW_Util_CopyMLPPDataToCallInfoContainer: Voice MLPP not configured
Feb  3 08:18:55.301: //115794//Dest:/DestLocalConsultHandoff: no local handoff, intwrk leg 0, consult id 7FC39FC85F20
Feb  3 08:18:55.301: //-1//AFW_:/AFW_Util_RemovePreemptInfoFromContainer: Failed to remove mlppSetupInfo from TD container
Feb  3 08:18:55.301: //-1//AFW_:/AFW_Leg_GetTypeDetail:  ***ERROR*** pLeg is NULL
Feb  3 08:19:01.624: //-1//AFW_:/AFW_Connection_New: Conference Create Failed
Feb  3 08:19:01.624: //115794//AFW_:/AFW_FSM_Drive: Tcl_Eval to drive FSM inside Tcl modulespace. code=1 code=ERROR
Feb  3 08:19:01.625: TCL script failure
        Result:
                         failed
Feb  3 08:19:01.625:    TCL script failure errorInfo:
                        failed
    while executing
"connection create $incoming_leg $outgoing_leg"
    (procedure "act_setup_done" line 52)
    invoked from within
"act_setup_done"
Feb  3 08:19:01.625: //115794//MEDI:/C_MediaFork_Close: Media Fork Not avtive on Leg [115794]
Feb  3 08:19:01.625: //115794//MEDI:/C_MediaFork_Close: Media Fork Not avtive on Leg [115795]

Thank you!

@A C 

Hi :)

Any ideas? 

 

Thanks!

Hi Slavik,

The following procedures work for me:

proc act_setup { } {

global env

if { [infotag get leg_isdid] } {
set env(dest) [infotag get leg_dnis]

leg proceeding leg_incoming
leg setup $env(dest) callInfo
} else {
#
}
}

proc act_setup_done {} {

global env

if { $status == "ls_000"} {
set param(consumeDigit) true
set param(enableReporting) true

leg connect leg_incoming

connection create leg_incoming leg_outgoing

} else {
#
}
}

View solution in original post

WOW, it is WORKING! Thank you!

Content for Community-Ad

Spotlight Awards 2021