IAX2 channel "unable to transfer"

We have three Asterisk servers, one in a co-location and one at each of two offices. IAX2 trunks are set up between the three boxes.

Incoming calls are answered at the colo box, then passed to whichever office box is required using a Dial command in the dialplan, eg:

My understanding is that the colo Asterisk box should be able to transfer the call to the office box, so that the call path changes from:

IAX Provider -> Colo -> Office
IAX Provider -> Office

However, we can’t seem to get this to work. I’ve tried setting “transfer=yes” and “transfer=mediaonly” in iax.conf on the colo and office boxes, and I’ve also tried setting “trunk=yes” and “trunk=no”, though I’m not sure if that’s relevant.

The following appears in the asterisk console when the call is sent to the office Asterisk:

    -- IAX2/iax13-3324 requested special control 20, passing it to IAX2/stafford-18496
    -- IAX2/iax13-3324 requested special control 20, passing it to IAX2/stafford-18496
    -- IAX2/stafford-18496 answered IAX2/iax13-3324
    -- Channel 'IAX2/iax13-3324' unable to transfer
    -- Channel 'IAX2/iax13-3324' unable to transfer
    -- Channel 'IAX2/stafford-18496' unable to transfer

Can anyone tell me what’s likely to be wrong, or suggest where else to look? We do have firewalls in place at both the colocation and the offices. Port 4569 is open on all three Asterisk servers, and as far as I can see, that’s the only port that IAX uses. Does it use another port when doing a transfer?

Edited to add: Asterisk version is Asterisk 1.8.4


I may have worked out the answer to my own question, but I’d be grateful if someone could confirm whether or not I’m right.

All voicemail etc is handled by the server in the colo. Consequently, the dialplan on the colo server has a Dial command to call the phone via the office Asterisk server, followed by other commands to deal with voicemail etc. So we have a section of the dialplan something like this:

exten => s,n,Dial(IAX2/stafford/100,30)
exten => s,n,Voicemail(100@default,u)

It occurred to me that Asterisk might not be able to transfer the call after running the Dial command because the colo server has to be able to take back control of the call in order to run the Voicemail command.

Can anyone confirm if this is correct? If it is, it would explain why transfers aren’t working.