I eventually managed to get mod_xml_curl working for me. Now I trying to be a bit cleverer setting up a multi-tenancy using mod_xml_curl based on the wiki instrucions 
<a href="http://wiki.freeswitch.org/wiki/Multiple_Companies">http://wiki.freeswitch.org/wiki/Multiple_Companies</a>. But I get an error when a phone tries to register.<br> <br>2010-03-18 21:19:04.869688 [WARNING] sofia_reg.c:1853 Can&#39;t find user [<a href="mailto:203@192.168.101.102">203@192.168.101.102</a>]<br>
You must define a domain called &#39;192.168.101.102&#39; in your directory and add a user with the id=&quot;203&quot; attribute<br>and you must configure your device to use the proper domain in it&#39;s authentication credentials.<br>
2010-03-18 21:19:04.885327 [WARNING] sofia_reg.c:1018 SIP auth failure (REGISTER) on sofia profile &#39;internal&#39; for [<a href="mailto:203@192.168.101.102">203@192.168.101.102</a>] from ip 192.168.91.28<br><br>I think I am nearly there,but I suspect there is something wrong with the resulting &#39;user directory&#39; xml.<br>
---------------------------------------------------------------<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;<br>&lt;document type=&quot;freeswitch/xml&quot;&gt;<br>&lt;section name=&quot;directory&quot; description=&quot;User Directory&quot;&gt;<br>
&lt;domain name=&quot;default&quot;&gt;<br>&lt;groups&gt;<br>  &lt;group name=&quot;default&quot;&gt;<br>  &lt;users&gt;<br>  &lt;user id=&quot;203&quot;&gt;<br>    &lt;params&gt;<br>      &lt;param name=&quot;password&quot; value=&quot;$${default_password}&quot;/&gt;<br>
      &lt;param name=&quot;dial-string&quot; value=&quot;{presence_id=${dialed_user}@${dialed_domain}\}${sofia_contact(${dialed_user}@${dialed_domain})}&quot;/&gt;<br>      &lt;param name=&quot;vm-password&quot; value=&quot;1234&quot;/&gt;<br>
      &lt;param name=&quot;vm-disk-quota&quot; value=&quot;30&quot;/&gt;<br>    &lt;/params&gt;<br>    &lt;variables&gt;<br>      &lt;variable name=&quot;user_context&quot; value=&quot;default&quot;/&gt;<br>      &lt;variable name=&quot;accountcode&quot; value=&quot;203&quot;/&gt;<br>
      &lt;variable name=&quot;day_bar&quot; value=&quot;3&quot;/&gt;<br>      &lt;variable name=&quot;night_bar&quot; value=&quot;3&quot;/&gt;<br>      &lt;variable name=&quot;effective_caller_id_name&quot; value=&quot;Extension 203&quot;/&gt;<br>
      &lt;variable name=&quot;effective_caller_id_number&quot; value=&quot;203&quot;/&gt;<br>      &lt;variable name=&quot;outbound_caller_id_name&quot; value=&quot;$${outbound_caller_name}&quot;/&gt;<br>      &lt;variable name=&quot;outbound_caller_id_number&quot; value=&quot;$${outbound_caller_number}&quot;/&gt;<br>
    &lt;/variables&gt;<br>  &lt;/user&gt;<br>  &lt;/users&gt;<br> &lt;/group&gt;<br>&lt;/groups&gt;<br>&lt;/domain&gt;<br>&lt;/section&gt;<br>&lt;/document&gt;<br>--------------------------------------------------------------------<br>
<br>I think the Company Directory XML is OK<br>--------------------------------------------------------------------<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;<br>&lt;document type=&quot;freeswitch/xml&quot;&gt;<br>
&lt;section name=&quot;directory&quot; description=&quot;Company Directory&quot;&gt;<br>&lt;domain name=&quot;default&quot;&gt;<br>  &lt;params&gt;<br>    &lt;param name=&quot;dial-string&quot; value=&quot;{presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}&quot;/&gt;<br>
  &lt;/params&gt;<br>  &lt;variables&gt;<br>    &lt;variable name=&quot;record_stereo&quot; value=&quot;true&quot;/&gt;<br>    &lt;variable name=&quot;default_gateway&quot; value=&quot;$${default_provider}&quot;/&gt;<br>    &lt;variable name=&quot;default_areacode&quot; value=&quot;$${default_areacode}&quot;/&gt;<br>
    &lt;variable name=&quot;transfer_fallback_extension&quot; value=&quot;operator&quot;/&gt;<br>    &lt;variable name=&quot;user_context&quot; value=&quot;default&quot;/&gt;<br>  &lt;/variables&gt;<br>&lt;/domain&gt;<br>
&lt;domain name=&quot;phisystems.dom&quot;&gt;<br>  &lt;params&gt;<br>    &lt;param name=&quot;dial-string&quot; value=&quot;{presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}&quot;/&gt;<br>
  &lt;/params&gt;<br>  &lt;variables&gt;<br>    &lt;variable name=&quot;record_stereo&quot; value=&quot;true&quot;/&gt;<br>    &lt;variable name=&quot;default_gateway&quot; value=&quot;$${default_provider}&quot;/&gt;<br>    &lt;variable name=&quot;default_areacode&quot; value=&quot;$${default_areacode}&quot;/&gt;<br>
    &lt;variable name=&quot;transfer_fallback_extension&quot; value=&quot;operator&quot;/&gt;<br>    &lt;variable name=&quot;user_context&quot; value=&quot;phisystems.dom&quot;/&gt;<br>  &lt;/variables&gt;<br>&lt;/domain&gt;<br>
&lt;/section&gt;<br>&lt;/document&gt;<br>--------------------------------------------------------------<br><br>I get the following result when I &#39;sofia status&#39;<br>                     Name          Type                               Data     State<br>
=================================================================================================<br>                 internal       profile   <a href="http://sip:mod_sofia@192.168.101.102:5060">sip:mod_sofia@192.168.101.102:5060</a>   RUNNING (0)<br>
           phisystems.dom         alias                           internal     ALIASED<br>            internal-ipv6       profile           sip:mod_sofia@[::1]:5060     RUNNING (0)<br>                  default         alias                           internal     ALIASED<br>
                 external       profile   <a href="http://sip:mod_sofia@192.168.101.102:5080">sip:mod_sofia@192.168.101.102:5080</a>   RUNNING (0)<br>=================================================================================================<br>
<br>Thanks in advance<br><div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup {  position:absolute;  z-index:9999;  padding: 0px 0px;  margin-left: 0px;  margin-top: 0px;  width: 240px;  overflow: hidden;  word-wrap: break-word;  color: black;  font-size: 10px;  text-align: left;  line-height: 13px;}</style>