/* extension */
-char *ext_rights[] = {
+const char *ext_rights[] = {
"none",
"internal",
"local",
NULL
};
-char *ext_yesno[] = {
+const char *ext_yesno[] = {
"no",
"yes",
NULL
if (number[0] == '\0')
return(0);
- SPRINT(filename, "%s/%s/%s/settings", INSTALL_DATA, options.extensions_dir, number);
+ SPRINT(filename, "%s/%s/settings", EXTENSION_DATA, number);
if (!(fp = fopen(filename, "r")))
{
+ printf("the given extension doesn't exist: \"%s\"\n", filename);
PDEBUG(DEBUG_CONFIG, "the given extension doesn't exist: \"%s\"\n", filename);
return(0);
}
SCPY(ext->name, param);
if (param2[0])
{
- SCAT(ext->name, " ");
+ SCAT(ext->name, (char *)" ");
SCAT(ext->name, param2);
}
if (number[0] == '\0')
return(0);
- SPRINT(filename, "%s/%s/%s/settings", INSTALL_DATA, options.extensions_dir, number);
+ SPRINT(filename, "%s/%s/settings", EXTENSION_DATA, number);
if (!(fp = fopen(filename, "w")))
{
fprintf(fp,"# Interface(s) to ring on calls to extension (as named in interface.conf)\n");
fprintf(fp,"# Seperate multiple interfaces by using komma without spaces\n");
- fprintf(fp,"# Example: Int would ring on the interface with the name \"Int\"");
+ fprintf(fp,"# Example: Int would ring on the interface with the name \"Int\"\n");
fprintf(fp,"# Int1,Int2 would ring incoming calls on both interfaces Int1 and Int2.\n");
fprintf(fp,"interfaces %s\n\n",ext->interfaces);
*/
int write_log(char *number, char *callerid, char *calledid, time_t start, time_t stop, int aoce, int cause, int location)
{
- char *mon[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+ const char *mon[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
FILE *fp=NULL;
char filename[256];
struct tm *tm;
if (callerid[0] == '\0')
- callerid = "<unknown>";
+ callerid = (char *)"<unknown>";
- SPRINT(filename, "%s/%s/%s/log", INSTALL_DATA, options.extensions_dir, number);
+ SPRINT(filename, "%s/%s/log", EXTENSION_DATA, number);
if (!(fp = fopen(filename, "a")))
{
tm = localtime(&start);
fprintf(fp,"%s %2d %04d %02d:%02d:%02d %s", mon[tm->tm_mon], tm->tm_mday, tm->tm_year+1900, tm->tm_hour, tm->tm_min, tm->tm_sec, number);
if (stop)
- fprintf(fp," %2ld:%02ld:%02ld", (stop-start)/3600, (((unsigned long)(stop-start))/60)%60, ((unsigned long)(stop-start))%60);
+ fprintf(fp," %2ld:%02d:%02d", (stop-start)/3600, (((unsigned int)(stop-start))/60)%60, ((unsigned int)(stop-start))%60);
else
fprintf(fp," --:--:--");
fprintf(fp," %s -> %s", callerid, calledid);
char buffer[1024];
int found = 0, found_if_more_digits = 0;
- SPRINT(filename, "%s/%s/%s/phonebook", INSTALL_DATA, options.extensions_dir, number);
+ SPRINT(filename, "%s/%s/phonebook", EXTENSION_DATA, number);
if (!(fp = fopen(filename, "r")))
{
char buffer[4096];
int found = 0;
- SPRINT(filename, "%s/%s/%s/secrets", INSTALL_DATA, options.extensions_dir, number);
+ SPRINT(filename, "%s/%s/secrets", EXTENSION_DATA, number);
if (!(fp = fopen(filename, "r")))
{
char buffer[256];
int found = 0;
- SPRINT(filename, "%s/directory.list", INSTALL_DATA);
+ SPRINT(filename, "%s/directory.list", CONFIG_DATA);
if (!(fp = fopen(filename, "r")))
{
static char caller_type[32], caller_id[64];
int found = 0;
- SPRINT(filename, "%s/%s/%s/callbackauth", INSTALL_DATA, options.extensions_dir, number);
+ SPRINT(filename, "%s/%s/callbackauth", EXTENSION_DATA, number);
if (!(fp = fopen(filename, "r")))
{
FILE *fp = NULL;
char filename[256];
- SPRINT(filename, "%s/%s/%s/callbackauth", INSTALL_DATA, options.extensions_dir, number);
+ SPRINT(filename, "%s/%s/callbackauth", EXTENSION_DATA, number);
if (callerinfo->id[0]=='\0')
{