<div>Sorry, I never used rubby, no help from my side here...</div><div><br></div><div>This is my XML response, it&#39;s not so long to put it in pastebin, also I never used pastebin yet:</div><div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;</div><div class="im" style="color: rgb(80, 0, 80); "><div>&lt;document type=&quot;freeswitch/xml&quot;&gt;</div><div>  &lt;section name=&quot;directory&quot;&gt;</div>
</div><div>    &lt;domain name=&quot;$${domain}&quot;&gt;</div><div>      &lt;params&gt;</div><div>        &lt;param name=&quot;dial-string&quot; value=&quot;{presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}&quot;/&gt;</div>
<div>      &lt;/params&gt;</div><div class="im" style="color: rgb(80, 0, 80); "><div>      &lt;groups&gt;</div><div>        &lt;group name=&quot;default&quot;&gt;</div><div>          &lt;users&gt;</div></div><div>            &lt;user id=&quot;1000&quot;&gt;</div>
<div>              &lt;params&gt;</div><div>                &lt;param name=&quot;a1-hash&quot; value=&quot;somehashvalue&quot;/&gt;</div><div>                &lt;param name=&quot;vm-a1-hash&quot; value=&quot;somehashvalue&quot;/&gt;</div>
<div>              &lt;/params&gt;</div><div>              &lt;variables&gt;</div><div>                &lt;variable name=&quot;user_context&quot; value=&quot;default&quot;/&gt;</div><div>                &lt;variable name=&quot;accountcode&quot; value=&quot;1000&quot;/&gt;</div>
<div>              &lt;/variables&gt;</div><div class="im" style="color: rgb(80, 0, 80); "><div>            &lt;/user&gt;</div><div>          &lt;/users&gt;</div><div>        &lt;/group&gt;</div><div>      &lt;/groups&gt;</div>
<div>    &lt;/domain&gt;</div><div>  &lt;/section&gt;</div><div>&lt;/document&gt;</div></div></span></div><div><br></div><div>Regards,</div><div>Vitalie<br><br><div class="gmail_quote">2010/5/24 Erwin Davis <span dir="ltr">&lt;<a href="mailto:davis.erwin@gmail.com">davis.erwin@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi, Vitalli,<br><br>Thanks for your PHP code. Unfortunately, I can&#39;t run that code because my project is in rails. <br>
But I didnot see the difference between you code and mine. What does the xml log file look like when you turn on &quot;xml_curl debug_on&quot;? Could you cut and paste them into  freeswitch pastebin? <br>

<br>My code is cloned from <a href="http://wiki.freeswitch.org/wiki/Mod_xml_curl_Ruby_directory_example" target="_blank">http://wiki.freeswitch.org/wiki/Mod_xml_curl_Ruby_directory_example</a>. I am not sure that the xml output may cause some problem. <br>


<br>When I type &quot;find_use_xml  id 1018 192.168.1.31&quot;, the FS ignored the response from web server. Instead, it retrieve the info from the local directory.<br><br><a href="mailto:freeswitch@proxy1.voiceserver.com" target="_blank">freeswitch@proxy1.voiceserver.com</a>&gt; find_user_xml id 1018  192.168.1.31<br>

2010-05-24 15:12:12.239449 [CONSOLE] mod_xml_curl.c:299 XML response is in /usr/local/freeswitch/<div>scripts803ca405-c463-4deb-8121-982e1251831a.tmp.xml<br>
API CALL [find_user_xml(id 1018  192.168.1.31)] output:<br>&lt;user id=&quot;1018&quot;&gt;<br>      &lt;params&gt;<br>          &lt;param name=&quot;password&quot; value=&quot;1234&quot;&gt;&lt;/param&gt;   &lt;&lt;&lt;&lt;===== the server response with &quot;1018&quot;, &quot;1234&quot; is the local default setting<br>

<br>          &lt;param name=&quot;vm-password&quot; value=&quot;1018&quot;&gt;&lt;/param&gt;<br>
<br>    &lt;/params&gt;<br><br>      &lt;variables&gt;<br>          &lt;variable name=&quot;toll_allow&quot; value=&quot;domestic,international,local&quot;&gt;&lt;/variable&gt;<br><br>          &lt;variable name=&quot;accountcode&quot; value=&quot;1018&quot;&gt;&lt;/variable&gt;<div class="im">
<br>

<br>          &lt;variable name=&quot;user_context&quot; value=&quot;default&quot;&gt;&lt;/variable&gt;<br><br></div>          &lt;variable name=&quot;effective_caller_id_name&quot; value=&quot;Extension 1018&quot;&gt;&lt;/variable&gt;<br>


<br>          &lt;variable name=&quot;effective_caller_id_number&quot; value=&quot;1018&quot;&gt;&lt;/variable&gt;<br><br>          &lt;variable name=&quot;outbound_caller_id_name&quot; value=&quot;MyPBX&quot;&gt;&lt;/variable&gt;<br>


<br>          &lt;variable name=&quot;outbound_caller_id_number&quot; value=&quot;0000000000&quot;&gt;&lt;/variable&gt;<br><br>          &lt;variable name=&quot;callgroup&quot; value=&quot;techsupport&quot;&gt;&lt;/variable&gt;<br>


<br>    &lt;/variables&gt;<br><br>  &lt;/user&gt;<br><br>Below is the rails code to output the xml response.<br></div>==============================================<br>========<br><br>  def directory<br>    <br>    if params[&#39;user&#39;].nil? || params[&#39;user&#39;].empty?<br>

      ##if not looking for a user info, send 404 Not Found<br>
      @out_xml = Output404NotFound()<br>    else<br>      @username = params[&#39;user&#39;].to_s<br>      puts &quot;username = &quot; + @username<br>      @domain = params[&#39;domain&#39;].to_s<br>      puts params<br>


      @dir=Directory.find_by_effective_caller_id_number(@username)<br>      puts @dir<br>      if @dir.nil? <br>        @out_xml = Output404NotFound()<br>      else <br>        @out_xml = OutputXMLResponse()<br>      end<br>


    end<br>    puts &quot;reply for directory query: &quot; + @out_xml + &quot;\n&quot;  <br>  end<br>  <br>private <br>  <br>  def Output404NotFound<br>    xml_text = &quot;&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;result\&quot;&gt;<br>                          &lt;result status=\&quot;not found\&quot; /&gt;<br>                     &lt;/section&gt;<br>


                 &lt;/document&gt; &quot;<br>    return xml_text<br>  end<br>  <br>  def OutputXMLResponse<br>    xml_text = <br><div class="im">        &quot;&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></div>             &lt;section name=\&quot;directory\&quot; description=\&quot;User Directory\&quot;&gt;<div class="im"><br>                 &lt;domain name=\&quot;#{@domain}\&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>                                  <br>                       &lt;groups&gt;<br>                           &lt;group name=\&quot;default\&quot;&gt;<br>                               &lt;users&gt;<br>
</div>

                                  &lt;user id=\&quot;#{@username}\&quot;&gt;<br>                                     &lt;params&gt;<br>                                        &lt;param name=\&quot;password\&quot; value=\&quot;&quot; + @dir.password + &quot;\&quot;/&gt;<br>


                                     &lt;/params&gt;<div class="im"><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; &quot;<br></div>     puts &quot;reply for directory query: &quot; + xml_text + &quot;\n&quot;<br>     return xml_text<br>  end<div>
<div></div><div class="h5"><br>

  <br>  <br><br><div class="gmail_quote">On Mon, May 24, 2010 at 8:38 AM, Vitalii Colosov <span dir="ltr">&lt;<a href="mailto:vetali100@gmail.com" target="_blank">vetali100@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">


Just to avoid any misunderstanding - this is to check all other things around freeswitch configuration.<div><br><div>If this will work, it will be very easy to add database lookup for the user trying to register:</div><div>



<br></div><div><br></div><div><div>$user = $_POST[&#39;user&#39;];</div><div>$query=&quot;select password from your_users_table where user =&#39;$user&#39;&quot;;</div><div>$result=mysqli_query($db_connection, $query);</div>



<div><br></div><div>...get user and password from the result</div><div><br></div><div>And then use $user and $password variables instead of hard-coded &quot;1018&quot;, &quot;1018&quot; in the code I provided.</div><div>


<br>
</div><div>Really hope this helps, it works for me.</div><div><br></div><div>Regards,</div><div>Vitalie</div><div><br></div><div><div></div><div><br><div class="gmail_quote">2010/5/24 Vitalii Colosov <span dir="ltr">&lt;<a href="mailto:vetali100@gmail.com" target="_blank">vetali100@gmail.com</a>&gt;</span><br>



<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">Sorry there was an else related to the missing entry, i removed it.<div><br></div><div>Please try another one.<br>


<br>
<div class="gmail_quote">2010/5/24 Vitalii Colosov <span dir="ltr">&lt;<a href="mailto:vetali100@gmail.com" target="_blank">vetali100@gmail.com</a>&gt;</span><div><div></div><div><br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">Please try to use my attached php script, if you can.<div><br></div><div>I changed it to fit your data (user 1018, pass: 1018), but I did not check for any syntax error (hope it does not have :-) ).</div>




<div><br></div><div>
Please reply back on result.</div><div><br></div><div>Regards,</div><div><br></div><div>Vitalie<div><div></div><div><br><br><div class="gmail_quote">2010/5/24 Erwin Davis <span dir="ltr">&lt;<a href="mailto:davis.erwin@gmail.com" target="_blank">davis.erwin@gmail.com</a>&gt;</span><br>





<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">yeah, my code replied with line 29-46. I donot know where the rest of html code was generated. <br>


<div><div></div><div>


<br><div class="gmail_quote">On Mon, May 24, 2010 at 10:34 AM, Milena <span dir="ltr">&lt;<a href="mailto:testeador01@gmail.com" target="_blank">testeador01@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div>Hello,</div>You&#39;re not meant to send a whole website full of html tags as a response.<div>







Just reply the part of the lines 29 - 46 on your pastebin and get rid of the rest.</div><div><br><br><div class="gmail_quote">
2010,</div><div class="gmail_quote">/5/24 Erwin Davis <span dir="ltr">&lt;<a href="mailto:davis.erwin@gmail.com" target="_blank">davis.erwin@gmail.com</a>&gt;</span><div><div></div><div><br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">








Hi, I am stuck, My console log is in <a href="http://pastebin.freeswitch.org/13030" target="_blank">http://pastebin.freeswitch.org/13030</a> and my xml log is in <a href="http://pastebin.freeswitch.org/13029" target="_blank">http://pastebin.freeswitch.org/13029</a>.  I guess that the problem should be pretty small but I just can not figure it out. -:(  Thanks for your help.<br>









<br><div class="gmail_quote"><div><div></div><div>On Mon, May 24, 2010 at 8:12 AM, Vitalii Colosov <span dir="ltr">&lt;<a href="mailto:vetali100@gmail.com" target="_blank">vetali100@gmail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div></div><div>
Hi Erwin,<div>Maybe you need to add the first line &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;</div><div><br></div><div>This is what I have and it works perfectly, tested right now:</div>










<div><br></div><div><div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;</div><div><div>&lt;document type=&quot;freeswitch/xml&quot;&gt;</div><div>  &lt;section name=&quot;directory&quot;&gt;</div>










</div><div>    &lt;domain name=&quot;$${domain}&quot;&gt;</div><div>      &lt;params&gt;</div><div>        &lt;param name=&quot;dial-string&quot; value=&quot;{presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}&quot;/&gt;</div>










<div>      &lt;/params&gt;</div><div><div>      &lt;groups&gt;</div><div>        &lt;group name=&quot;default&quot;&gt;</div><div>          &lt;users&gt;</div></div><div>            &lt;user id=&quot;1000&quot;&gt;</div>









<div>              &lt;params&gt;</div>
<div>                &lt;param name=&quot;a1-hash&quot; value=&quot;somehashvalue&quot;/&gt;</div><div>                &lt;param name=&quot;vm-a1-hash&quot; value=&quot;somehashvalue&quot;/&gt;</div><div>              &lt;/params&gt;</div>










<div>              &lt;variables&gt;</div><div>                &lt;variable name=&quot;user_context&quot; value=&quot;default&quot;/&gt;</div><div>                &lt;variable name=&quot;accountcode&quot; value=&quot;1000&quot;/&gt;</div>










<div>              &lt;/variables&gt;</div><div><div>            &lt;/user&gt;</div><div>          &lt;/users&gt;</div><div>        &lt;/group&gt;</div><div>      &lt;/groups&gt;</div><div>    &lt;/domain&gt;</div>
<div>  &lt;/section&gt;</div>
<div>&lt;/document&gt;</div><div><br></div></div><div>Regards,</div><div>Vitalie</div></div>
<br></div></div><div>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></div></blockquote></div><br>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div></div>
</blockquote></div></div></div><br></div>
</blockquote></div><br></div></div></div></div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>