Search code examples
asterisktransfer

Call Transfer to Different Host/IP in Asterisk


Is it possible to transfer call to different host in asterisk? Like I have three asterisk instances in line i.e A, B and C. The scenario is that the call will come from A to B and B will transfer the call to C and after successful transfer, B will not be facilitator and A will directly be communicating with C


Solution

  • Correct setup is have kamailio or opensips proxy infront of asterisk.

    For asterisk ff you have on all instances in trunks settings

      canreinvite=yes
      directmedia=yes
    

    and if you have SIP protocol, you can do Transfer call. If you do that before call setup will be full transfer,if after setup - only last option will work, so signaling will still go via this host, while media go directly. Both options may not work if provider NOT support that.

    pro-sip*CLI> core show application Transfer 
    
      -= Info about application 'Transfer' =- 
    
    [Synopsis]
    Transfer caller to remote extension. 
    
    [Description]
    Requests the remote caller be transferred to a given destination. If TECH
    (SIP, IAX2, LOCAL etc) is used, only an incoming call with the same channel
    technology will be transferred. Note that for SIP, if you transfer before
    call is setup, a 302 redirect SIP message will be returned to the caller.
    The result of the application will be reported in the ${TRANSFERSTATUS}
    channel variable:
    ${TRANSFERSTATUS}: 
        SUCCESS: Transfer succeeded.
        FAILURE: Transfer failed.
        UNSUPPORTED: Transfer unsupported by channel driver.
    
    [Syntax]
    Transfer([Tech/]destination)
    
    [Arguments]