title: Handle trusted and untrusted domains in Freeswitch
body: <p>I have configured a Freeswitch system with a FusionPBX GUI. One of the requiremenmts i need to fulfill is to tell trusted domains apart from untrusted domains.</p>
  
  <p>What I want to do is to make sure the P-Asserted-Identity field on the SIP Header is only sent to trusted domains and the From:field in a call would appear as anonymous@anonymous.invalid in case the call is made to a untrusted domain.</p>
  
  <p>Here's the XML code I've made, but is not workingn (i have no idea why):</p>
  
  <pre><code>&lt;extension name="call_privacy" &gt;
     &lt;condition field="destination_number" expression="^(210301\d\d\d)$" /&gt;
     &lt;condition field="caller_id_number" expression="^(21030010\d)$" &gt;
         &lt;action application="set" data="sip_h_Privacy=id" /&gt;
         &lt;action application="privacy" data="full" /&gt;
         &lt;action application="set" data="privacy=yes" /&gt;
         &lt;action application="transfer" data="$1 XML ${context}" /&gt;
         &lt;action application="${sip_from_uri}" data="anonymous" /&gt;
     &lt;/condition&gt;
  &lt;/extension&gt;
  </code></pre>
  
  <p>Can anyone please help me with this?
  Thanks in advance</p>