Hi,
I have two Asterisk and have sip trunk between them.
I want to Transfer a call from Asterisk A to Asterisk B.
I know that I can do it with Dial cmd but it keep channel in server A,
I want to transfer (not dial) the call to server B and release the channel in server A.
Dial will release the speech path, as long as you allow direct media and don’t do anything that requires Asterisk to see the media (e.g. look for DTMF signals).
Transfer, which takes an address in SIP URI format, with sip: replaced by SIP/ will release both the signalling and media paths. Note that this code is little used and is likely to be flakey, particularly for failed calls. Also rather different mechanisms are used depending on whether or not the call has been answered, and the source system may not support both.
ITSPs will only rarely support direct media, and you will need public addresses for both systems. Most ITSPs will not support Transfer, and if they do, will charge it as though there were a new outgoing call through them, whilst the incoming call continues to be charged.
I’m assuming that AsteriskB is the actual domain, not just a sip.conf section name, as Transfer will not use the latter.
I’d say that was a problem with the phone configuration. Maybe it doesn’t understand how to redirect to a full URI, or maybe you have configured it to use a proxy.