> if ((file = fopen("/home/mlima/asteriskfuc<div style="direction: ltr;">ked","a+")) == NULL )<br><br>Now that is one heck of a filename you got there.<br></div><br><div><span class="gmail_quote">On 3/8/07,
<b class="gmail_sendername">Mhayk Whandson da Silva Lima</b> <<a href="mailto:eu@mhayk.com.br">eu@mhayk.com.br</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Can we help me ?<br><br>Well I want to do the communication app with res. I tested my simple<br>app and I added in the extensions.conf the rule exten => Genius(), it<br>is already ok, but now I want get just the function, get it one other
<br>name and this is get in my res file, and when I called Genius() the<br>app menage to speak with res.<br><br>extensions.conf:<br><br>exten => 2007,1,Genius()<br><br>genius_hw.c<br>-----------------------------------------------------------------------------------------------------------------------------------
<br>#include <stdio.h><br>#include "asterisk.h"<br>#include "asterisk/pbx.h"<br>#include "asterisk/lock.h"<br>#include "asterisk/module.h"<br><br>int genius_premodule(void);<br>
static char *app = "Genius";<br>static char *synopsis = "Communication test with pre-module by Genius";<br><br>static char *descrip =<br>"This module is just to do a conversation with pre-module genius_pm
<br>and genius_hw!";<br><br>static int genius_exec(struct ast_channel *chan, void *data)<br>{<br><br> genius_premodule();<br> return 0;<br>}<br><br>static int unload_module(void)<br>{<br> int res;<br><br> res = ast_unregister_application(app);
<br><br> ast_module_user_hangup_all();<br><br> return res;<br>}<br><br>static int load_module(void)<br>{<br> int res;<br><br> res = ast_register_application(app, genius_exec, synopsis, descrip);<br><br> return res;
<br>}<br>AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Genius Speeach Recognizer")<br>----------------------------------------------------------------------------------------------------------------------------------
<br>and now the res file:<br><br>genius_pm.c<br>----------------------------------------------------------------------------------------------------------------------------------<br>#include <stdio.h><br><br>#include "
asterisk.h"<br><br>int genius_premodule(void)<br>{<br> FILE *file;<br> char string[20];<br> int qtd;<br><br> if ((file = fopen("/home/mlima/asteriskfucked","a+")) == NULL )<br> {<br>
printf("Problema ao tentar criado/abrir arquivo.\n");<br> }<br> sprintf(string,"Testando...\n");<br> qtd = fwrite(string, sizeof(char),20,file);<br> if(fclose(file) != 0)<br> {<br>
printf("Impossibilitado de fechar arquivo!\n");<br> }<br> else{<br> printf("Arquivo criado com sucesso.\n");<br> }<br> return 0;<br>}<br><br>AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Genius Speeach Recognizer");
<br>-----------------------------------------------------------------------------------------------------------------------------------<br><br>so after, I will put in modules.conf<br>preload => genius_pm.so<br><br>so when I call to 2007 .. i will see the file :P. I would know what I
<br>need to do ... Well while you are reading this I am continue studding<br>.<br><br>regards,<br><br>--<br>Mhayk Whandson<br>MSN: <a href="mailto:eu@mhayk.com.br">eu@mhayk.com.br</a><br>ICQ: 163967537<br>GoogleTalk: <a href="mailto:mhaykwhandson@gmail.com">
mhaykwhandson@gmail.com</a><br>Skype: mhaykwhandson<br>_______________________________________________<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</a> --<br><br>asterisk-dev mailing list
<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div><br><br clear="all"><br>--
<br>sean