05-03-2017 08:31 AM
I'm doing a SIP REFER transfer in TCL using the following:
set callInfo(originationNum) 1112223333
set callInfo(mode) "REDIRECT"
leg setup $dnisValue callInfo $incoming
Assuming dnisValue is 2223334444 for illustration purposes.
This works, in that the gateway sends a REFER message, with the REFER-to field being the dnis in the $dnisValue variable.
024410: May 3 11:25:09.360 EDT: //0/000000000000/SIP/Msg/ccsipDisplayMsg:
Sent:
REFER sip:2223334444@x.x.x.x:5060 SIP/2.0
<snip>
Refer-To: sip:2223334444@x.x.x.x
The problem is that the "x.x.x.x" (host portion of the refer-to) is the egress interface of the same gateway, instead of the carrier IP. The carrier is receiving the REFER, accepting it, then sending the call back to the gateway (since the x.x.x.x IP is the gateway.)
Is there a way to specify the host portion of the refer-to when doing the transfer via TCL? I would think it would be in callInfo if it is able to be set..
Thanks!
05-07-2017 09:38 PM
Hi,
You can get refer-to dest as below, modify and set the new destination.
set XferTo [infotag get evt_transfer_info transferDest]
leg setup $XferTo callInfo $OutgoingLeg
Thanks,
Raghavendra
05-16-2017 07:05 AM
With the suggested code, I'm getting:
051424: May 16 09:42:52.763 EDT: //2802//TCL :/tcl_InfotagGetObjCmd: infotag get evt_transfer_info transferDest
051425: May 16 09:42:52.763 EDT: //2802//AFW_:/vtr_ev_transfer_info: argc 3 argindex 2
051426: May 16 09:42:52.763 EDT: //2802//AFW_:/vtr_ev_transfer_info: no transfer request info in event scope
051427: May 16 09:42:52.763 EDT: %VOICE_IEC-3-GW: TCL_IVR: Internal Error (Get infotag failed): IEC=1.1.180.2.31.0 on callID 2802 GUID=5FDFEC6F397411E79DCB9C709CC2C26B
on the line:
set XferTo [infotag get evt_transfer_info transferDest]
Looking at the documentation, it is because the scope for the above command is ev_transfer_request, but, I need this information prior to starting the transfer (so I can modify the destination host of the refer-to.)
05-16-2017 07:41 AM
I was thinking perhaps of specifying a sip uri with the host on the leg setup, something like:
set TakebackDnis [format {sip:%s@%s} $TakebackDnis $hostHere]
set callInfo(originationNum) 1112223333 |
set callInfo(mode) "REDIRECT"
leg setup $TakebackDnis callInfo $incoming
However, if I do that, I see:
071324: May 16 10:37:07.041 EDT: //2851/F387BD7D9E59/SIP/Error/sipSPISaveReferParams:
No dialpeer passed from application for xfer
(it should use the existing ingress dial-peer for a REFER instead of using the gateway's dialplan. It does this correctly when it is not a sip uri.)
05-16-2017 09:09 AM
When you do the call setup just need number, not the the entire sip url
05-16-2017 09:45 AM
yawchen: If I use just the number, I get the issue mentioned in the first post. It works, but, the refer-to field has the IP of the gateway itself for the domain/host (instead of the carrier IP), so the carrier routes the call back to the gateway. Basically, I need a way to change the domain/host for the REFER, per the first message above.
05-16-2017 10:11 AM
I haven't worked on script for a while but don't we setup this in session target in the dialpeer ?
05-17-2017 06:41 AM
It's a redirect on an existing call, so, I'd expect it would use the dial-peer that the call ingressed through. If I don't use the sip URI, it sends it out to the carrier as expected.
Either way though, there are matching dial-peers on the gateway (pointing to the applicable IP.)
05-17-2017 07:33 AM
I think the key is to find out "The problem is that the "x.x.x.x" (host portion of the refer-to) is the egress interface of the same gateway, instead of the carrier IP" like you indicated. Who instructs putting refer-to target ip ? Tcl script ? IOS config ? Other device ?
Can you use separate dialpeer fot the transfer call ?
05-17-2017 07:42 AM
It appears to be automatically populated. The TCL script is what initiates the refer using the code in my original post. If you specify a destination that is just a phone number, the REFER is sent/accepted, but, egress IP is populated as the refer-to host (which seems to be improper.)
If you specify a sip URI (sip:1112223333@x.x.x.x) as a destination (tried as a workaround), the REFER never gets sent out.
05-17-2017 07:48 AM
who initiates transfer ? How is the call flow from end to end ?
05-17-2017 07:56 AM
TCL script initiates the transfer after receiving DTMF from the caller.
The following code initiates the REFER transfer (the "redirect" part is what causes the transfer vs. just setting up another leg) :
set callInfo(originationNum) 1112223333
set callInfo(mode) "REDIRECT"
leg setup $dnisValue callInfo $incoming
After doing that, we see the following in the refer:
024410: May 3 11:25:09.360 EDT: //0/000000000000/SIP/Msg/ccsipDisplayMsg:
Sent:
REFER sip:2223334444@x.x.x.x:5060 SIP/2.0
<snip>
Refer-To: sip:2223334444@x.x.x.x
The problem is that the "x.x.x.x" (host portion of the refer-to) is the egress interface of the same gateway, instead of the carrier IP. The carrier is receiving the REFER, accepting it, then sending the call back to the gateway (since the x.x.x.x IP is the gateway.)
Since the TCL script is the one initiating the transfer, I need a way to specify the host/domain IP in the Refer-To when I setup the new leg above.
05-17-2017 08:18 AM
Can you manually hard code in the following format to test it out ?
set TakebackDnis “sip:1234567@abc.com”
05-17-2017 08:22 AM
I tried that, but, the REFER isn't sent out and in the logs I see:
071324: May 16 10:37:07.041 EDT: //2851/F387BD7D9E59/SIP/Error/sipSPISaveReferParams:
No dialpeer passed from application for xfer
I created a uri list matching that pattern and applied it to a dial-peer as well... but... I believe it should be using the same dial-peer as without specifying the host since it is just REFER'ing it.
05-17-2017 08:45 AM
A simple question we we have destination 1234567@abcd.com then we are expecting the call to go to abcd.con right ?
And the number 1234567 should be in abcd.com
you said:
"The problem is that the "x.x.x.x" (host portion of the refer-to) is the egress interface of the same gateway, instead of the carrier IP. The carrier is receiving the REFER, accepting it, then sending the call back to the gateway (since the x.x.x.x IP is the gateway.)"
Which number is right but domain in the your VG that doesn't make sense to me. In my opinion we should have a dialpeer only handle the egress number/
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide