OLD Polycom Phones, Endpoint Manager, legacy_sip.cfg and Paging/Intercom

Lots of other threads on this, but I think I have finally (for me at least) figured out how to make this work and not have updates screw it up - without changing anything in the way FreePBX is set up (Including changing the database like here: [FREEPBX-6049] Intercom for Polycom phones no longer works - wrong Alert-Info - Sangoma Issue Tracker)

The root problem is that the OLD Polycoms (301, 430, 501 601 and 4000 - we have LOTS of them in the field - they just don’t die!) use legacy_sip.cfg to set Alert Info settings - here is the proper line as of 2016-06-15 and what FreePBX 13 is sending:

<alertInfo voIpProt.SIP.alertInfo.1.value="Alert-Info: Auto Answer" voIpProt.SIP.alertInfo.1.class=“4”/>

This is the format that current code in /etc/asterisk/extensions_additional.conf sends to the Polycom phones for Intercom and for paging.

The problem came from someone adding this to the XML for these phones in Endpoint Manager - it’s under the Basefile Edit - Ext.cfg for any of the above models:

<SIP
>
  <voIpProt.SIP.alertInfo
    SIP.voIpProt.SIP.alertInfo.1.class="ringAutoAnswer"
    SIP.voIpProt.SIP.alertInfo.1.value="Auto Answer"
  >
  </voIpProt.SIP.alertInfo>
</SIP>

This is what was killing all the other changes I was trying following the other posts - I finally had to resort to Wireshark to see what was (properly) being sent and then looking at the above syntax, and comparing it to legacy_sip.cfg to see that these lines are not properly formatted for the older Polycoms - it was overriding legacy_sip.cfg and therefore Paging/Intercom never worked on these phones - remove that whole section from the Basefile for these models, set legacy_sip.cfg to the above settings and you are (finally) in business.