<HTML><HEAD>
<META content="text/html; charset=ISO-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="IncrediMail 1.0">
<STYLE>v\:* {
        BEHAVIOR: url (#default#vml)
}
</STYLE>

<!--IncrdiXMLRemarkStart>
<IncrdiX-Info>
<X-FID>B433CDFE-B71C-42C2-A5C1-D34C076A9851</X-FID>
<X-FVER></X-FVER>
<X-FIT></X-FIT>
<X-FILE></X-FILE>
<X-FCOL></X-FCOL>
<X-FCAT></X-FCAT>
<X-FDIS></X-FDIS>
<X-Extensions></X-Extensions>
<X-BG></X-BG>
<X-BGT>repeat</X-BGT>
<X-BGC>#ffffff</X-BGC>
<X-BGPX></X-BGPX>
<X-BGPY></X-BGPY>
<X-ASN></X-ASN>
<X-ASNF></X-ASNF>
<X-ASH></X-ASH>
<X-ASHF></X-ASHF>
<X-AN></X-AN>
<X-ANF></X-ANF>
<X-AP></X-AP>
<X-APF></X-APF>
<X-AD></X-AD>
<X-ADF></X-ADF>
<X-AUTO>X-ASN,X-ASH,X-AN,X-AP,X-AD</X-AUTO>
<X-CNT>;</X-CNT>
</IncrdiX-Info>
<IncrdiXMLRemarkEnd-->
</HEAD>
<BODY bottomMargin=5 leftMargin=5 rightMargin=5 scroll=yes topMargin=5 bgColor=#ffffff marginheight="0" marginwidth="0" webfixed="1">
<TABLE id=INCREDIMAINTABLE border=0 cellSpacing=0 cellPadding=0 width="100%" background="" bgColor=#ffffff height="100%">
<TBODY>
<TR>
<TD style="POSITION: relative; PADDING-BOTTOM: 20px; PADDING-LEFT: 20px; PADDING-RIGHT: 20px; FONT-FAMILY: Verdana; DIRECTION: ltr; COLOR: #1c3966; FONT-SIZE: 12pt; PADDING-TOP: 20px" id=INCREDITEXTREGION vAlign=top>
<DIV style="PADDING-LEFT: 2px" id=INCREDI_TEXT_AREA>
<DIV>
<DIV>$QUERY = "SELECT * FROM callback_callcenter WHERE status= 'pendente'";<BR>$telefone = "2188002233";</DIV>
<DIV><BR>$tmp = time().$telefone;<BR>$origem = "/tmp/$tmp";<BR>$destino = "/var/spool/asterisk/outgoing/$origem";</DIV>
<DIV>&nbsp;</DIV>
<DIV>$callerid = "Callback &lt;99990000&gt;";</DIV>
<DIV>&nbsp;</DIV>
<DIV>$fp = fopen($origem, "w+");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>if($fp){</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp, "CallerID: $callerid\r\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp, "Set: CALLERID(num)=$callerid\r\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp, "Channel: SIP/VONO/$telefone/n\r\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // CASO QUEIRA RODAR UM APP, UTILIZE ESSA PARTE</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp, "Application: Playback\r\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp, "Data: som-do-callback\r\n");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //=================================</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //CASO QUEIRA ENVIAR PARA&nbsp;ALGUM CONTEXTO</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp, "Context: default\r\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp, "Extension: s\r\n");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp, "Priority: 1\r\n");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //=================================<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp, "MaxRetries: 2\r\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp, "RetryTime: 30\r\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fwrite($fp, "WaitTime: 30\r\n");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fclose($fp);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec("/bin/mv $origem $destino");&nbsp;</DIV>
<DIV>}else{</DIV>
<DIV>&nbsp;&nbsp;&nbsp; die("Erro ao criar arquivo .call");</DIV>
<DIV>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></DIV></DIV>
<DIV>
<DIV><FONT color=#004080 size=2>Sem mais,</FONT></DIV>
<DIV style="FONT-FAMILY: Verdana; FONT-SIZE: 12pt" dir=ltr id=IncrediOriginalFontSize>
<DIV id=INCREDISIGNATUREID ondrag="return false;">
<DIV style="FONT-FAMILY: MS Sans Serif"><FONT color=#004080 size=2></FONT>&nbsp;</DIV>
<DIV style="FONT-FAMILY: MS Sans Serif"><FONT color=#004080 size=2><STRONG>Fernando da Silva Santos</STRONG></FONT></DIV>
<DIV style="FONT-FAMILY: MS Sans Serif"><FONT color=#004080 size=2>WebApps &amp; Asterisk* Developer</FONT></DIV>
<DIV style="FONT-FAMILY: MS Sans Serif"><FONT color=#004080 size=2><BR><IMG border=0 src="cid:9357479E-DB11-4E31-9020-AAFD5568A19A"><A href="mailto:fernandojdk@gmail.com.br">fernandojdk@gmail.com.br</A></FONT></DIV>
<DIV style="FONT-FAMILY: MS Sans Serif"><FONT color=#004080 size=2><A href="mailto:fernando@nextbilling.com.br"><IMG border=0 src="cid:06A1EB25-AAD8-4FB6-89A4-50ED6D57DB91">fernando@nextbilling.com.br</A></FONT></DIV>
<DIV style="FONT-FAMILY: MS Sans Serif"><FONT size=2><A href="http://www.nextbilling.com.br/"><IMG border=0 src="cid:2BCE6529-150A-41B4-B9AF-F4BA30E639DD">http://www.nextbilling.com.br</A></FONT></DIV></DIV>
<DIV style="FONT-SIZE: 11pt" dir=ltr id=IncrediOriginalMessage><I>-------Mensagem original-------</I></DIV>
<DIV>&nbsp;</DIV>
<DIV id=receivestrings>
<DIV style="FONT-SIZE: 11pt" dir=ltr><I><B>De:</B></I> <A href="mailto:monica@addphone.net">monica@addphone.net</A></DIV>
<DIV style="FONT-SIZE: 11pt" dir=ltr><I><B>Data:</B></I> 24/02/2011 11:48:44</DIV>
<DIV style="FONT-SIZE: 11pt" dir=ltr><I><B>Para:</B></I> <A href="mailto:asteriskbrasil@listas.asteriskbrasil.org">asteriskbrasil@listas.asteriskbrasil.org</A></DIV>
<DIV style="FONT-SIZE: 11pt" dir=ltr><I><B>Assunto:</B></I> [AsteriskBrasil] torpedo de voz</DIV></DIV>
<DIV>&nbsp;</DIV>ola a todos estou precisando fazer torpedo de voz para meu asterisk, estou tentando usar o arquivo.call enviando para a pasta outgoing do asteirsk.<BR><BR>eu ja tenho os dados gravado no banco de dados com dados da ligaçao, e fiz un cron para pegar os dados no banco e gerar o arquivo .cal<BR><BR>$QUERY = "SELECT * FROM callback_callcenter WHERE status= 'pendente'";<BR><BR>esta busca ja me retorna o Channel formato SIP/VONO/01140040435 entre outras variaveis como o ramal<BR><BR>o que preciso é ligar para este channels e quando ele atende rodar outro contexto para rodar o torpedo de voz<BR><BR>[torpedo]<BR>exten =&gt; _X.,1,Background(audio1)<BR>exten =&gt; _X.,n,Hangup<BR><BR><BR>como tem que ficar o arquivo .call ?<BR><BR><BR>obrigada<BR><BR>
<DIV>&nbsp;</DIV></DIV></DIV></TD>
<TD vAlign=bottom width=1 align=right><IMG src="cid:58D8CADF-0A4E-485F-B489-3F46558F82E7"></TD></TR></TBODY></TABLE></BODY></HTML>