Since the calls are all probably inbounding from the same gateway that has multiple PRI's the way I would thing about doing this would be tagging the call with something unique upon inbound of the call and also when the call is going back out tag it with the same unique ID to route it out.
In this case what I will do is, when I'm routing the call from CVP to ICM, I will tag the call with an additional digit. So lets say the calling number is 949-222-2324, and I have 4 PRI's I will create a translation rule to each voice port / D Channel and assign a prefix to each respective PRI. That way PRI 1 would have 9, PRI 2 would have 8 and PRI 3 would have 7 and PRI 4 would have 6.
The call get to ICM and I decide that the call needs to go out, I will use this to determine how to send the call back out thereby I would create a specific dial-peer for each of the PRI's and then delete that extra digit on its way back out.
We can achieve the same through Label node in UCCE ICM Script, on Label Node we can define the external number on which call need to be re-routed, Label Node will send call back to CVP from CVP using Dialed Number Pattern we can route that call back to Egress GW or Router and from GW we can have POTS Dial-Peer pointing to specific PRI.
Flow would be like --
Inbound Call -- ICM Script -- Label Node -- Back to CVP -- Dialed Number Pattern @ CVP -- Pointing to GW -- GW -- POTS Dial-Peer for PRI.
Please rate helpful posts.
Add a special prefix-code before the destination number.
ICM need to redirect a incoming call to an external number : 6222 0000
Label : CONCATENATE( "9911", "62220000" )
The dail-peer in your Voice Gateway need to map 9911T to a special DID number as origianl calling number.