cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6281
Views
7
Helpful
11
Replies

SIP to SIP TCL transfer

NinjaPirate
Level 1
Level 1

Hi Guys,

I am wondering if somebody can provide me with a sample TCL script to be used in incoming dial-peer for SIP calls redirect on my CUBE gateway. I.e. I need to send SIP 3xx to ITSP, so they will redirect or divert this call accordingly and with that release both call legs on my local CUBE.

Thanks!

11 Replies 11

NinjaPirate
Level 1
Level 1

Actually I have created a simple vxml script myself

<?xml version="1.0" encoding="UTF-8"?>

<vxml xmlns="http://www.w3.org/2001/vxml" xmlns:conf="http://www.w3.org/2002/vxml-conformance" version="2.0">

<form id="xfer">

     <transfer name="mycall" type="refer" dest="tel:+22736"  bridge="false">

     </transfer>

</form>

</vxml> 

And it works on my CUBE router, does the transfer, when I enable service on the inbound dial-peer, but the problem is that it does not actually send REFER message but sends INVITE instead, therefore keeping CUBE in the loop. I need this to be like RTT release trunk transfer, wondering if this is something that can be done on the CUBE.

thanks!

You can set mode as below for redirect, for sample scripts and programming guide please refer https://developer.cisco.com/site/voice-gateway/documentation/

set callInfo(mode) REDIRECT
leg setup $ReferDnis callInfo leg_incoming

please refer below H450 TCL script also

https://software.cisco.com/download/release.html?mdfid=277641082&softwareid=283451126&release=2.0.1.0&rellifecycle=&relind=AVAILABLE&reltype=all

Thanks,
Raghavendra

Thanks very much Raghavendra !

So the method you submitted ends up as SIP REFER / NOTIFY being submitted back to calling party, I am wondering what the method would be to send SIP 3XX message i.e. 302, moved temporarily instead of REFER?

Here is my code that I did for SIP REFER

proc act_Media { } {

    global dest

         set dest 22736

    leg setupack leg_incoming

    leg proceeding leg_incoming

    leg connect leg_incoming

    media play leg_incoming flash:welcome.au

}

# setup the call, connect caller to called party

proc act_Setup { } {

    global dest

    puts ">>> Tcl: proc act_Setup <<<"

    puts ">>> TCL:Final Dest: $dest <<<"  

  

   set callInfo(originationNum) 23402

set callInfo(mode) REDIRECT

#set callInfo(rerouteMode) REDIRECT_ROTARY

leg setup $dest callInfo leg_incoming

}

proc act_CallSetupDone { } {  

    set status [infotag get evt_status]

    puts "\n CALL STATUS = $status"

    if { $status == "ls_000"} {

        puts "\n You have sucessfully placed the call to the destination !"

    } else {       

        puts "\n Sorry your call was not connnected !"

        call close

    }

}

# disconnect the call

proc act_Cleanup { } {

    puts ">>> Tcl: act_Cleanup <<<"

    call close

}

set fsm(any_state,ev_disconnected)  "act_Cleanup  same_state"

set fsm(CALL_INIT,ev_setup_indication)   "act_Media PLAYPROMPT"

set fsm(PLAYPROMPT,ev_media_done) "act_Setup PLACECALL"

set fsm(PLACECALL,ev_disconnected)      "act_Cleanup CALLDISCONNECT"

set fsm(PLACECALL,ev_setup_done)      "act_CallSetupDone CALLDISCONNECT"

set fsm(CALLDISCONNECT,ev_disconnected)   "act_Cleanup         same_state"

set fsm(CALLDISCONNECT,ev_disconnect_done) "act_Cleanup         same_state"

fsm define fsm CALL_INIT

please try with alert as below.

set callInfo(mode) REDIRECT_AT_ALERT

Thanks,

Raghavendra

Thanks,

but it sends INVITE now, I need that thing to send 3xx no refer no invite, something like 302 moved temprorarily

I don't think we can send 302 with TCL script other than sip invite or refer message.

Thanks,

Raghavendra

please try with alert as below.

set callInfo(mode) REDIRECT_AT_ALERT

The mode you mentioned is undocumented. Documented modes are:

  • rotary
  • redirect
  • redirect_rotary


Which other modes exists, and what is their differences from the documented modes ?

There are REDIRECT_AT_ALERT and REDIRECT_AT_CONNECT, commonly used for TBCT.

REDIRECT_AT_ALERT -- if doing TBCT, PSTN switch will disconnect transfer by leg and trying to connect to transfer to leg. (there is a chance that transfer to leg won't get connected but transfer by leg disconnected already)

REDIRECT_AT_CONNECT transfer by leg is disconnected only when the transfer to leg is connect.

So the difference is when to release transfer by leg when doing TBCT.

Hello,

You can disconnect the leg like this in tcl.

leg disconnect leg_incoming -c1

c1 is cause 1 for ISDN cause code "Unallocated or unassigned number"

you can find the list of cause codes here:

Q.931 - Wikipedia, the free encyclopediahttps://en.wikipedia.org/wiki/Q.931

jcuadros
Cisco Employee
Cisco Employee

hello Farhad,

i'm having a need that may be as youre's, i was wondering if you can help me. i have not a gw connected to PSTN (E1 or Sip trunk) and i need that when an specific number is called inbound i do play a prompt asking for the destination number and then i just need to add to the dialed number an static @domain.com to transfer the call internally you think you can show me how to achieve that? can you share you script?

thanks

you can try to set destination as below.

set dest "sip:1234567@abc.com"

leg setup $dest callinfo leg_incoming

Thanks,

Raghavendra