[AsteriskBrasil] ASTERISK.JAVA + OUTGOING
Pablo Câmara
pscamara em gmail.com
Sexta Outubro 10 10:13:24 BRT 2008
Olá a Todos,
Esse é meu primeiro post.
Estou querendo implementar algo como o: Asterisk auto-dial out
1º tenho que criar os arquivos do tipo call dentro da pasta :
*/var/spool/asterisk/outgoing.
*
Porem eu não faço mais ideia de como eu irei criar esses arquivos dentro
desse diretório. Pois a aplicacao está em outro servidor.
Gostaria de saber se alguem já fez algo do tipo. E se seria possivel usar o
Asterisk.java para para pegar o caminho?
public void createCallFiles() {
String[] txt = getSelectedOptions();
Writer output = null;
String path = "C:/Call/";
for (int i = 0; i < getSelectedOptions().length; i++) {
try {
File file = new File(path + txt[i] + ".call");
output = new BufferedWriter(new FileWriter(file));
output.write("Channel: SIP/" + txt[i] + "\n");
output.write("MaxRetries: 2" + "\n");
output.write("RetryTime: 60" + "\n");
output.write("WaitTime: 30" + "\n");
output.write("Context: CALLME" + "\n");
output.write("Extension: 800" + "\n");
output.write("Priority: 1" + "\n");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (output != null) {
output.close();
}
} catch (IOException ex) {
Logger.getLogger(ScheduleCall.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
Pablo
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: http://listas.asteriskbrasil.org/pipermail/asteriskbrasil/attachments/20081010/3dd15ee1/attachment.htm
Mais detalhes sobre a lista de discussão AsteriskBrasil