<p>Check if you have selinux enforcing anf try to disable it</p>
<p>I am typing from my mobile phone...</p>
<div class="gmail_quote">Il giorno 04/feb/2013 18:43, &quot;C. Savinovich&quot; &lt;<a href="mailto:c.savinovich@itntelecom.com">c.savinovich@itntelecom.com</a>&gt; ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><span style="font-size:10pt;font-family:Verdana"><div><br></div><div>I would just type in the web service url manually in a browser, and if the browser displays the response, then there it is, the connection to the host server is open.<br>
</div><div><br></div><div>Christian Savinovich</div><div><strong><em>VoIP &amp; Telephony Consultant</em></strong></div><div><a href="tel:646-982-3572" value="+16469823572" target="_blank">646-982-3572</a></div><div> </div>
<div><br><br></div>
<blockquote style="padding-left:8px;font-size:10pt;margin-left:8px;font-family:verdana;border-left:2px solid blue">
<div>
-------- Original Message --------<br>
Subject: Re: [asterisk-users] problem to socket programming in AGI<br>
From: Justin Killen &lt;<a href="mailto:jkillen@allamericanasphalt.com" target="_blank">jkillen@allamericanasphalt.com</a>&gt;<br>
Date: Mon, February 04, 2013 12:25 pm<br>
To: Asterisk Users Mailing List - Non-Commercial Discussion<br>
&lt;<a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a>&gt;<br>
<br>
        <div> <div class="MsoNormal" style="font-size:12pt"><font color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">Yes, I think curl would probably be a better option than trying to use sockets directly, but if the socket won’t connect it doesn’t really matter what higher level method is used. <u></u><u></u></span></font></div>
 <div> <div> <div class="MsoNormal" style="font-size:12pt"><font color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">-Justin</span></font> <u></u><u></u></div> </div> </div> <div> <div class="MsoNormal" style="font-size:12pt;text-align:center" align="center">
<font face="Times New Roman" size="3"><span style="font-size:12.0pt"> <hr align="center" size="2" width="100%"> </span></font></div> <div class="MsoNormal" style="font-size:12pt"><b><font face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">From:</span></font></b><font face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma"> <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a> [<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">mailto:asterisk-users-bounces@lists.digium.com</a>] <b><span style="font-weight:bold">On Behalf Of </span></b>C. Savinovich<br>
 <b><span style="font-weight:bold">Sent:</span></b> Monday, February 04, 2013 9:16 AM<br> <b><span style="font-weight:bold">To:</span></b> Asterisk Users Mailing List - Non-Commercial Discussion<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [asterisk-users] problem to socket programming in AGI</span></font><u></u><u></u></div>
 </div> <div class="MsoNormal" style="font-size:12pt"><font face="Times New Roman" size="3"><span style="font-size:12.0pt"><u></u> <u></u></span></font></div> <div> <div class="MsoNormal" style="font-size:12pt"><font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"><u></u> <u></u></span></font></div>
 </div> <div> <div class="MsoNormal" style="font-size:12pt"><font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana">I don&#39;t get it, if it is a web service, why do you use sockets? Isn&#39;t it just a matter of calling the web service using curl,and then wait for the response? what am I missing?<u></u><u></u></span></font></div>
 </div> <div> <div class="MsoNormal" style="font-size:12pt"><font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"><u></u> <u></u></span></font></div> </div> <div> <div class="MsoNormal" style="font-size:12pt">
<font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana">Christian Savinovich<u></u><u></u></span></font></div> </div> <div> <div class="MsoNormal" style="font-size:12pt"><em><b><i><font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana;font-weight:bold">VoIP &amp; Telephony Consultant</span></font></i></b></em><font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"><u></u><u></u></span></font></div>
 </div> <div> <div class="MsoNormal" style="font-size:12pt"><font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"><a href="tel:646-982-3572" value="+16469823572" target="_blank">646-982-3572</a><u></u><u></u></span></font></div>
 </div> <div> <div class="MsoNormal" style="font-size:12pt"><font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"> <u></u><u></u></span></font></div> </div> <div> <div class="MsoNormal" style="font-size:12pt;margin-bottom:12.0pt">
<font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"><u></u> <u></u></span></font></div> </div> <blockquote style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 6.0pt;margin-left:6.0pt;margin-top:5.0pt;margin-bottom:5.0pt">
 <div> <div class="MsoNormal" style="font-size:12pt"><font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana">-------- Original Message --------<br> Subject: Re: [asterisk-users] problem to socket programming in AGI<br>
 From: Justin Killen &lt;<a href="mailto:jkillen@allamericanasphalt.com" target="_blank"><font color="black"><span style="color:windowtext">jkillen@allamericanasphalt.com</span></font></a>&gt;<br> Date: Mon, February 04, 2013 12:05 pm<br>
 To: Asterisk Users Mailing List - Non-Commercial Discussion<br> &lt;<a href="mailto:asterisk-users@lists.digium.com" target="_blank"><font color="black"><span style="color:windowtext">asterisk-users@lists.digium.com</span></font></a>&gt;<br>
 <br> <br> <u></u><u></u></span></font></div> <u></u> <div> <div> <div class="MsoNormal" style="font-size:12pt"><font color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">You are correct, this is not an asterisk question.  What I would suggest would be to run your script outside of asterisk and debug the connection.  Looking at the php doc page for fsockopen (<a href="http://php.net/manual/en/function.fsockopen.php" target="_blank"><u><font color="blue"><span style="color:blue">http://php.net/manual/en/function.fsockopen.php</span></font></u></a>), I see this example:<u></u><u></u></span></font><font color="black" face="Verdana"><span style="font-family:Verdana"><u></u><u></u></span></font></div>
 </div> <div> <div class="MsoNormal" style="font-size:12pt"><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">&lt;?php</span></font></code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#0000bb"><br>
 <code><font face="Courier New">$fp </font></code></span></font><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">= </span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">fsockopen</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">(</span></font></code><code><font color="#dd0000" face="Courier New"><span style="font-size:10.0pt;color:#dd0000">&quot;<a href="http://www.example.com" target="_blank">www.example.com</a>&quot;</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">, </span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">80</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">, </span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$errno</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">, </span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$errstr</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">, </span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">30</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">);</span></font></code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#007700"><br>
 <code><font face="Courier New">if (!</font></code></span></font><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$fp</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">) {</span></font></code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#007700"><br>
 <code><font face="Courier New">    echo </font></code></span></font><code><font color="#dd0000" face="Courier New"><span style="font-size:10.0pt;color:#dd0000">&quot;</span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$errstr</span></font></code><code><font color="#dd0000" face="Courier New"><span style="font-size:10.0pt;color:#dd0000"> (</span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$errno</span></font></code><code><font color="#dd0000" face="Courier New"><span style="font-size:10.0pt;color:#dd0000">)&lt;br /&gt;\n&quot;</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">;</span></font></code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#007700"><br>
 <code><font face="Courier New">} else {</font></code><br> <code><font face="Courier New">    </font></code></span></font><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$out </span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">= </span></font></code><code><font color="#dd0000" face="Courier New"><span style="font-size:10.0pt;color:#dd0000">&quot;GET / HTTP/1.1\r\n&quot;</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">;</span></font></code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#007700"><br>
 <code><font face="Courier New">    </font></code></span></font><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$out </span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">.= </span></font></code><code><font color="#dd0000" face="Courier New"><span style="font-size:10.0pt;color:#dd0000">&quot;Host: <a href="http://www.example.com" target="_blank"><u><font color="blue"><span style="color:blue">www.example.com</span></font></u></a>\r\n&quot;</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">;</span></font></code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#007700"><br>
 <code><font face="Courier New">    </font></code></span></font><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$out </span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">.= </span></font></code><code><font color="#dd0000" face="Courier New"><span style="font-size:10.0pt;color:#dd0000">&quot;Connection: Close\r\n\r\n&quot;</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">;</span></font></code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#007700"><br>
 <code><font face="Courier New">    </font></code></span></font><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">fwrite</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">(</span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$fp</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">, </span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$out</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">);</span></font></code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#007700"><br>
 <code><font face="Courier New">    while (!</font></code></span></font><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">feof</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">(</span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$fp</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">)) {</span></font></code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#007700"><br>
 <code><font face="Courier New">        echo </font></code></span></font><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">fgets</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">(</span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$fp</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">, </span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">128</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">);</span></font></code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#007700"><br>
 <code><font face="Courier New">    }</font></code><br> <code><font face="Courier New">    </font></code></span></font><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">fclose</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">(</span></font></code><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">$fp</span></font></code><code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;color:#007700">);</span></font></code><font color="#007700" face="Courier New"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#007700"><br>
 <code><font face="Courier New">}</font></code><br> </span></font><code><font color="#0000bb" face="Courier New"><span style="font-size:10.0pt;color:#0000bb">?&gt;</span></font></code><code><font color="black" face="Courier New"><span style="font-size:10.0pt"> </span></font></code><font color="black" face="Verdana"><span style="font-family:Verdana"><u></u><u></u></span></font></div>
 </div> <u></u><u></u> <div> <div class="MsoNormal" style="font-size:12pt"><font color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font><font color="black" face="Verdana"><span style="font-family:Verdana"><u></u><u></u></span></font></div>
 </div> <div> <div class="MsoNormal" style="font-size:12pt"><font color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">I would first try running that (put in your host and port) and see what the error string coming back is.<u></u><u></u></span></font><font color="black" face="Verdana"><span style="font-family:Verdana"><u></u><u></u></span></font></div>
 </div> <div> <div class="MsoNormal" style="font-size:12pt"><font color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font><font color="black" face="Verdana"><span style="font-family:Verdana"><u></u><u></u></span></font></div>
 </div> <div> <div> <div style="margin-top:5.0pt;margin-bottom:5.0pt"> <div class="MsoNormal" style="font-size:12pt"><font color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">-Justin<u></u><u></u></span></font><font color="black" face="Verdana"><span style="font-family:Verdana"><u></u><u></u></span></font></div>
 </div> </div> </div> <div> <div class="MsoNormal" style="font-size:12pt;text-align:center" align="center"><font color="black" face="Times New Roman" size="3"><span style="font-size:12.0pt"> <hr align="center" size="2" width="100%">
 </span></font></div> <div> <div class="MsoNormal" style="font-size:12pt"><b><font color="black" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">From:</span></font></b><font color="black" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma"> <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank"><u><font color="blue"><span style="color:blue">asterisk-users-bounces@lists.digium.com</span></font></u></a> [<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank"><u><font color="blue"><span style="color:blue">mailto:asterisk-users-bounces@lists.digium.com</span></font></u></a>] <b><span style="font-weight:bold">On Behalf Of </span></b>Muhammad<br>
 <b><span style="font-weight:bold">Sent:</span></b> Monday, February 04, 2013 5:07 AM<br> <b><span style="font-weight:bold">To:</span></b> <u></u>Asterisk Users Mailing List - Non-Commercial Discussion<u></u><br> <b><span style="font-weight:bold">Subject:</span></b> [asterisk-users] problem to socket programming in AGI</span></font><font color="black" face="Verdana"><span style="font-family:Verdana"><u></u><u></u></span></font></div>
 <u></u><u></u></div> </div> <div> <div class="MsoNormal" style="font-size:12pt"><font color="black" face="Times New Roman" size="3"><span style="font-size:12.0pt"><u></u> <u></u></span></font><font color="black" face="Verdana"><span style="font-family:Verdana"><u></u><u></u></span></font></div>
 </div> <div> <div> <div class="MsoNormal" style="font-size:12pt"><font color="black" face="Times New Roman" size="3"><span style="font-size:12.0pt">Hi,<br> I know maybe this question is not related to asterisk, but I want to make XML RPC web service to other http server.<br>
 I have elastix system. it is https and problem is source not destination server. In xml rpc we have fsockopen connection to connect destination server(xml rpc server). It return me connect error(0).<br> <br> what is the problem. is this related to elastix(asterisk) server?<u></u><u></u></span></font><font color="black" face="Verdana"><span style="font-family:Verdana"><u></u><u></u></span></font></div>
 </div> </div> </div> <div class="MsoNormal" style="font-size:12pt;text-align:center" align="center"><font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"> <hr align="center" size="2" width="100%">
 </span></font></div> <div class="MsoNormal" style="font-size:12pt"><font color="black" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana">--<br> _____________________________________________________________________<br>
 -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank"><u><font color="blue"><span style="color:blue">http://www.api-digital.com</span></font></u></a> --<br> New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
 <a href="http://www.asterisk.org/hello" target="_blank"><u><font color="blue"><span style="color:blue">http://www.asterisk.org/hello</span></font></u></a><br> <br> asterisk-users mailing list<br> To UNSUBSCRIBE or update options visit:<br>
 <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank"><u><font color="blue"><span style="color:blue">http://lists.digium.com/mailman/listinfo/asterisk-users</span></font></u></a> <u></u><u></u></span></font></div>
 <u></u></div> </blockquote> </div>   <hr>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a>
</div>
</blockquote></span></div>

<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div>