Summary:ASTERISK-05686: Called party transfer does not work if the call arrives via IAX and is transfered out via IAX
Reporter:Jon Lewis (jlewis)Labels:
Date Opened:2005-11-23 08:43:53.000-0600Date Closed:2011-06-07 14:02:47
Versions:Frequency of
Description:I'm seeing the following when trying to allow the
called party to transfer calls:
sip phone --> asteriskC --IAX2--> asteriskA --ZAP--> PSTN --> called party
i.e. a sip user on server asteriskC places a call, which is sent to the PSTN
via IAX2 to asteriskA.  asteriskC includes the t flag in its Dial(IAX2/...).
This case works, though I found that the called party can only transfer
calls to extensions asteriskC makes accessible to asteriskA via context= in
the iax.conf entry...which I suppose makes sense.

However, if the call flow is:
asteriskB --IAX2--> asteriskC --IAX2--> asteriskA --ZAP--> PSTN -> called
i.e. a call comes into asteriskC via IAX2, and is either:
a) answered by a SIP client who transfers the call to an exten that dials
out (with t flag) via IAX2 to asteriskA and the PSTN
b) is Answered in the dialplan and then sent via Goto to an exten that
dials out (with t flag) to the PSTN via IAX2 to asteriskA.

In these cases, the called party cannot do a # transfer.  Under Asterisk CVS-v1-0-10/06/05-14:03:55 on asteriskC, I found the server would only recognize a # transfer request if I forced a mismatch of codecs between the B-C and C-A legs of the call.  If the codecs all match, once the call has been native bridged, asteriskC won't get the #.  Even when asteriskC does get the #, it seems the called party has no context, and so after hitting # and any single digit, I get this on asteriskC:

   -- Operating with different codecs, can't native bridge...
   -- Playing 'pbx-transfer' (language 'en')
   -- Unable to find extension '4' in context ''

4 being the digit pressed in this case.  I've tried Asterisk 1.2 on asteriskC, and saw no difference.  The called-party still has no context when trying to transfer.

This prevents us from offering called-party transfer on servers that use IAX for all PSTN origination and termination.
Comments:By: Kevin P. Fleming (kpfleming) 2005-12-12 20:34:21.000-0600

You can use the TRANSFER_CONTEXT channel variable to make a context available for the called party to use to transfer with. There is no reliable way for Asterisk to determine what context should be used, since you can send an IAX2 call to anywhere you like so it does not have to match up with a peer or user entry.... If you cannot achieve what you want to using this variable, please reopen this bug and provide the details of your failed attempts. Thanks!