<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EstiloDeEmail17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=PT-BR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>Estou recebendo na CLI o seguinte resultado;<br><br>[Aug 20 16:03:12] ERROR[4951]: utils.c:1211 ast_careful_fwrite: fwrite() returned error: Broken pipe<br><br>Quando executado o seguinte .php;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'><?</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:PT-BR'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>$timeout = 10;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>$asterisk_ip = "127.0.0.1";<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>$socket = fsockopen($asterisk_ip,"5038", $errno, $errstr, $timeout);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>fputs($socket, "Action: Login\r\n");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>fputs($socket, "UserName: admin\r\n");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>fputs($socket, "Secret: 123456\r\n\r\n");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>$wrets=fgets($socket,128);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>fputs($socket, "Action: Originate\r\n" );<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>fputs($socket, "Channel: SIP/200\r" );<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>fputs($socket, "Exten: 34067524\r" );<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>fputs($socket, "Context: saida\r" );<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>fputs($socket, "Timeout: 15000\r" );<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>fputs($socket, "Priority: 1\r" );<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>fputs($socket, "Async: yes\r\n\r" );<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>fputs($socket, "Action: Logoff\r\n\r");<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:PT-BR'>?><br><br>Porem, as vezes funciona e outras não, mas o erro:<br>[Aug 20 16:03:12] ERROR[4951]: utils.c:1211 ast_careful_fwrite: fwrite() returned error: Broken pipe<br><br>Sempre aparece, independente se funcionar ou não.<br><br>Nas versões de Asterisk até 1.4.21 não recebo esse erro e todas funcionam.<br><br>Mas hj estou utilizando 1.8.5.<br><br>Abraços.<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>