![]() |
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I need to create a full duplex route from two outbound calls
call flow is approximate task[1] TopazDisableAutoRoute(); TrunkUse(residx1); MediaUse(medidx1); TrunkListen("Media",residx1); MediaListen("Trunk",medidx1); TrunkMakeCall(number1); .. MediaPlayFile(filename); TopazRoute("Trunk", residx1, "Trunk", residx2); spawn[2] task[2] TrunkUse(residx2); TrunkMakeCall(number2); Both calls connect but cannot hear each other |
|
#2
|
||||
|
||||
|
You have your order of operations wrong. What you are doing is making the 1st call, then routing it's resource to the other trunk resource, but then you call TrunkUse on the second trunk resource, thereby breaking your manual route. you should establish both calls first, then disable auto-route, and then manually route the trunks together. Like so:
task[1] TrunkUse(residx1); MediaUse(medidx1); TrunkListen("Media",residx1); MediaListen("Trunk",medidx1); TrunkMakeCall(number1); .. MediaPlayFile(filename); spawn[2] task[2] TrunkUse(residx2); TrunkMakeCall(number2); TopazDisableAutoRoute(); TopazRoute("Trunk", residx1, "Trunk", residx2); |
|
#3
|
|||
|
|||
|
I was hoping that the caller on task[1] could hear the call progress on task[2]
My existing application using R4 can do this (i have wrapped the GC_ functions to provide support for GC_listen and scb_listen functions) Is it not possible to replicate this using non R4 print("Getting Timeslots","B","L"); SlotDTI = NC_getslot(board, channel, SCB_DTI); if (SlotDTI >=0) print("DTI Timeslots=" & SlotDTI,"F","L"); else print("Error getting DTI Timeslots ("& SlotDTI & ")","F","L"); endif SlotVoice = NC_getvoiceslot(line, SCB_VOICE); if (SlotVoice >=0) print("VOICE Timeslots=" & SlotVoice,"F","L"); else print("Error getting VOICE Timeslots ("& SlotVoice & ")","F","L"); endif if (CAS streq "YES") print("Attaching voice resource to GlobalCall device","B","L"); Attach = NC_attach(board,channel,line); # Attach a voice resource to the GlobalCall line device if (Attach >=0) print("Attached board=" & board & ", channel=" & channel & " to line=" & line, "F","L"); else print("Error attaching board=" & board & ", channel=" & channel & " to line=" & line, "F","L"); endif endif print("Listening channels","B","L"); ret = NC_listen(board, channel, SCB_DTI, SlotVoice); if (ret >=0) print("Listened DTI to VOICE Timeslots","F","L"); else print("Error Listening DTI to VOICE Timeslots (" & ret & ")","F","L"); endif ret = NC_voicelisten(line, SCB_VOICE, SlotDTI); if (ret >=0) print("Listened VOICE to DTI Timeslots","F","L"); else print("Error Listening VOICE to DTI Timeslots (" & ret & ")","F","L"); endif retry = 3; do print("Starting call","B","L"); called = MakeCall(board, channel, telno); switch(called) case 1: # Answered print("Call answered","B","L"); # Now hold this call #hold = GC_holdcall(Board, SlotDTI) # Request a hold on call #voslog("hole=" & hold # expect back a EV_HOLDACK print("Playing voice file : " & VOXPATH & PLAYMSG_VOX,"B","L"); ret = NC_play(line, VOXPATH & PLAYMSG_VOX); if (ret > 0) print("Played voice file","B","L"); else print("Error playing voice file","B","L"); endif print("Waiting for digit to be entered","B","L"); confirm = Confirmation(line); if (length(confirm) > 0) if (confirm eq 1) print("Correct digit entered : " & confirm,"B","L"); else print("Wrong digit entered : " & confirm,"B","L"); endif else print("No digit entered","B","L"); endif retry = 0; # Should route the calls together here SlotDTI2 = NC_getslot(board2, channel2, SCB_DTI); if (SlotDTI2 >=0) print("DTI Timeslots=" & SlotDTI2,"F","L"); else print("Error getting DTI Timeslots ("& SlotDTI2 & ")","F","L"); endif print("Routing channels","B","L"); ret = NC_route(board, channel, SCB_DTI, board2, channel2, SCB_DTI,0); if (ret >=0) print("Routed DTI to DTI2 Timeslots","F","L"); routed = 1; else print("Error Routing DTI to DTI2 Timeslots (" & ret & ")","F","L"); endif # now spawn the second leg SubPID = spawn("TESTSUB",getpid(),board2,channel2,line2,tel no2,test,logfile); |
|
#4
|
||||
|
||||
|
What do you mean "task[1] could hear the call progress on task[2]"..? You want task[1] to hear the destination line ringing no-answer, busy or whatever..? ok, then you can keep your original code, but after task[2] picks up - call "TopazRoute("Trunk", residx1, "Trunk", residx2);" again to re-connect the two trunks. TrunkUse() performs automatic routing - it will break your manual routing, so you have to re-establish it. In my applications I occasionally find myself in a situation where, for example, I need to play a voice file to one or both sides of the call. I have to break the trunk-to-trunk routing, rout each trunk to their individual media resource, play file, then re-establish trunk-to-trunk routing. What you have here is basically the same thing. task[2] grabs it's trunk and ties it to it's media resource. you have to take it back and plug it into trunk[1] again.
|
|
#5
|
||||
|
||||
|
by the way... Just out of curiosity - what version of CT ADE are you running? The code sample you sent seems to be manipulating resources on hardware level. Looks like way too much complexity for a simple trunk route app.
And the comment about non-R4Gc-based functions... What board are you running? Using R4Gc what I said applies. But if you are running in a different environment it may not be applicable. It's kind of difficult to make suggestions when I'm not sure of the big picture. I am only familiar with R4Gc, in any case.
Last edited by aaksyonenko; 02-20-2010 at 07:04 PM. |
|
#6
|
|||
|
|||
|
Thanks for your responses, it's good to get some input on this as I have been strugling.
The big picture is i'm testing migration from the legacy CTADE which supported the dialogic functions directly e.g. DIT_ scb_ and GC_ functions. You could/can set:- [R4] Enable=1 Enabling you to use these legacy dialogic calls. So as you can tell I'm trying to maintain the existing logic, of pre-joining the trunks (timeslots previously) and making the call as normal. My observations appear to be:- 1) I need a media resource to detect call progress (not required previously) 2) I need a separate media resource on the second leg of the call to detect call progress (not required previously) 3) I dont appear to detect busy as i did before. |
|
#7
|
||||
|
||||
|
Ok, I think I understand. You must be converting from a really old, pre-Topaz version of CT ADE. in the newer versions the code is a lot shorter and easier. You do not need a media resource to use TrunkGetState(); but that gives you a limited range of trunk states - you can find them in the help file, I am also including them below. if you want more detailed results, you will have to call TrunkEnableCallAnalysis( ); to enable PCPA, and for that you will need a media resource.
Code:
######################################### # DIALOGIC TRUNK CONSTANTS # ######################################### const TRUNK_OPENING = 2; const TRUNK_IDLE = 3; const TRUNK_ABORTING = 4; const TRUNK_RESETTING = 5; const TRUNK_NETWORKDOWN = 7; const TRUNK_CLOSING = 8; const TRUNK_CLOSED = 9; const TRUNK_BLOCKED = 100; const TRUNK_BLOCKING = 101; const TRUNK_UNBLOCKING = 102; const TRUNK_CALLING = 103; const TRUNK_INBOUNDRINGING = 104; const TRUNK_ACCEPTING = 105; const TRUNK_REJECTING = 106; const TRUNK_CONNECTED = 107; const TRUNK_REMOTEDISCONNECTED = 109; const TRUNK_DISCONNECTING = 110; const TRUNK_NOCONNECT = 112; |
|
#8
|
||||
|
||||
|
Also, see the "Getting Detailed Event Results from R4GcTrunk" section in the ADL Help file. If your TrunkGetState(); returned a NOCONNECT state, you can determine the cause of the failure to connect by calling TrunkGetInt( 539 ); The old code for BUSY that this RegID returned used to be 529, but it appears that now it's changed to 1289, according to the help file. I would suggest testing for both. Better yet - I would suggest creating a test scenario when you are guaranteed that the number will be busy and logging the result. This does not require a media resource, either - this is all trunk.
|
|
#9
|
|||
|
|||
|
Information - This hardware key contains a development and runtime license for ADL Studio with debugging and ADX. It is authorized for use on Windows NT/2000/XP, and Windows 9x.
__________________
JOHN MARSH |
![]() |
| Tags |
| routing |
| Thread Tools | |
| Display Modes | |
|
|