#include “asterisk.h”
#include “asterisk/file.h”
#include “asterisk/channel.h”
#include “asterisk/pbx.h”
#include “asterisk/module.h”
#include “asterisk/lock.h”
#include “asterisk/app.h”
ASTERISK_FILE_VERSION(FILE, “$Revision$”)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
static char *app = “helloapp”
static int myapp_exec(struct ast_channel *chan, const char *data)
{
int res=0;
FILE *fp=NULL;
int i=123;
fp=fopen("netc.txt","w+");
fprintf(fp,"%d\n",i);
i=111;
fprintf(fp,"%d\n",i);
i=222;
fprintf(fp,"%d\n",i);
i=333;
fprintf(fp,"%d\n",i);
i=666;
fprintf(fp,"%d\n",i);
fclose(fp);
return res;
}
static int load_module(void)
{
return ast_register_application_xml(app,myapp_exec);
}
static int unload_module(void)
{
return ast_unregister_application(app);
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, “MY OWN helloapp”);
// end
What condition does the myapp_exec function run ?
or When call the myapp_exec function ?
Any help ?