Yealink T42G attended transfer fix

I recently started using a Yealink T42G - An older (but still very functional) SIP Desk Phone. Weeks passed without any issues, until I attempted an attended transfer. I'd receive a call, chat to them, hit transfer, dial the next number, hit send, and my desk phone would start ringing again displaying "ReCall" on the screen. If you answer the call, the leg to the phone you wish to transfer to will drop.

Fortunately I was eventually able to find a fix. I presume the same fix will work on the other T4X series phones, including the T40, T41 T46 and T48 

The first step was looking at a SIP trace (Packet Capture) for clues. It revealed the SIP server was rejecting the call with a 403 Forbidden, so I looked at the (Redacted) REFER for clues:

REFER sip: SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK2982342611
Route: <sip:;lr;ftag=1c673289805;did=183.3252;nat=yes>
From: <>;tag=2811361735
To: +447777777777 <>;tag=1c673289805
Call-ID: 8aa398d5-3f45-49e9-911a-c28f04236812-2-1@example
Contact: <sip:441111111111@>
Max-Forwards: 70
User-Agent: Yealink SIP-T42G
Refer-To: <sip:>
Event: refer
Referred-By: <>
Content-Length: 0

Nothing stands out immediately, so I compared it with an example  from another phone that worked:

REFER sip: SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK1368237426 Route: <sip:;lr;ftag=1c151890343;did=0da.35f;nat=yes> From: <>;tag=2011551301 To: 443333333333 <>;tag=1c151890343 Call-ID: 38b8501e-72a3-452f-924b-aac4cd154be2-2-1@example Contact: <sip:441111111111@> Max-Forwards: 70 User-Agent: Yealink SIP-T58 Refer-To: <> Event: refer Referred-By: <> Content-Length: 0

Which reveals the difference in the "Refer-To" header:

Refer-To: <sip:>

Refer-To: <>

The header from the failed transfer doesn't contain the number in the URI. 

Let's consult my favourite bed time reading, RFC5589 to see if there's any clues there.

   The Contact URI of the Transfer Target SHOULD be used by the
   Transferor as the Refer-To URI, unless the URI is suspected or known
   to not be routable outside the dialog.  Otherwise, the Address of
   Record (AOR) of the Transfer Target SHOULD be used.  That is, the
   same URI that the Transferor used to establish the session with the
   Transfer Target should be used.

Ahah, so it looks like the phone should potentially be using the AOR of the transfer target rather than the contact. So it's possible the issue is being caused by a bug or config problem with the phone.

I checked every visible setting within the phones web configuration page and couldn't find any obvious missed setting, so I wondered if anyone else was having the issue. I checked the logs on the SIP server and found several examples of Yealinks making attended transfers with the AOR in the Refer-To header working fine... so it does work. I then went on a wild goose chase of downgrading to various versions of firmware wondering if it was a bug, but I had no luck there.

I remembered I could download the phones config in a text format, which can occasionally revel settings that aren't exposed in the web interface by navigating to Settings > Configuration > Export CFG Configuration File (All).

I opened it up in a text editor and had a look around, and one of the parameters stood out:

account.11.transfer_refer_to_contact_header.enable = 1

That sounds suspiciously like the issue I'm having.... so I did a find and replace, swapping the 1 with a 0 on all 12 lines, and then imported the edited config file, and voila, I can now successfully perform an attended transfer without the call being rejected, with a proper Refer-To Header:

Refer-To: <>

I honestly have no idea how this issue came about, whether it is a default setting, something I enabled accidentally in the web UI and overlooked, or something introduced in a certain firmware version. I'm just glad it's fixed!

No comments:

Post a Comment