i found in google loligo.com/asterisk/misc/app … _odbcexec/ and downlad app_odbcexec.c, copy it to /usr/src/asterisk-1.2.10/apps
add app_odbcexec at the end of APPS= run make and i get error similar to
In file included from app_odbcexec.c:21:
/usr/include/asterisk/file.h:27:2: #error You must include stdio.h before file.h!
it was easy to remove, i changed
#include <sys/types.h>
#include <asterisk/options.h>
#include <asterisk/config.h>
#include <asterisk/file.h>
#include <asterisk/logger.h>
#include <asterisk/channel.h>
#include <asterisk/pbx.h>
#include <asterisk/module.h>
#include <asterisk/pbx.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <pthread.h>
into
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <pthread.h>
#include <sys/types.h>
#include <asterisk/options.h>
#include <asterisk/config.h>
#include <asterisk/file.h>
#include <asterisk/logger.h>
#include <asterisk/channel.h>
#include <asterisk/module.h>
#include <asterisk/pbx.h>
#include <stdio.h> was added
next make give me error like:
app_odbcexec.c: In function `odbcexec_exec':
app_odbcexec.c:101: warning: implicit declaration of function `qast_exists_extension'
app_odbcexec.c:101: error: structure has no member named `callerid'
app_odbcexec.c: In function `odbcexec_query':
app_odbcexec.c:147: error: structure has no member named `callerid'
app_odbcexec.c: In function `odbc_load_module':
in line 101-102 and 147-148 there is:
101 if (ast_exists_extension (chan, chan->context, chan->exten, chan->priority + 101, chan->callerid))
102 chan->priority += 100;
definition of ast_exist_extenion is in /usr/src/asterisk-1.2.10/include/asterisk/pbx.h
335 /*! If an extension exists, return non-zero */
336 /* work */
337 /*!
338 * \param c this is not important
339 * \param context which context to look in
340 * \param exten which extension to search for
341 * \param priority priority of the action within the extension
342 * \param callerid callerid to search for
343 * If an extension within the given context(or callerid) with the given priority is found a non zero value will be returned.
344 * Otherwise, 0 is returned.
345 */
346 int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid);
code is in /usr/src/asterisk-1.2.10/pbx.c
2203 int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
2204 {
2205 return pbx_extension_helper(c, NULL, context, exten, priority, NULL, callerid, HELPER_EXISTS);
2206 }
there is 'const chan *callerid’
i’m not good at programing and i don’t know how to resolve this.
maybe someone more skillfull will have a clue