*
* reads extension from given extension number and fills structure
*/
-int read_extension(struct extension *ext, char *number)
+int read_extension(struct extension *ext, char *num)
{
FILE *fp=NULL;
+ char number[32];
char filename[256];
char *p;
char option[32];
char buffer[1024];
int last_in_count = 0, last_out_count = 0;
+ /* save number, so &ext and ext.number can be given as parameters - without overwriting itself */
+ SCPY(number, num);
+
if (number[0] == '\0')
return(0);
/* default values */
memset(ext, 0, sizeof(struct extension));
+ SCPY(ext->number, number);
ext->rights = 4; /* international */
ext->tout_setup = 120;
ext->tout_dialing = 120;
PDEBUG(DEBUG_CONFIG, "given display_int param unknown: %s\n", param);
}
} else
- if (!strcmp(option,"display_voip"))
- {
- i=0;
- while(ext_yesno[i])
- {
- if (!strcasecmp(param,ext_yesno[i]))
- break;
- i++;
- }
- if (ext_yesno[i])
- {
- ext->display_voip = i;
- PDEBUG(DEBUG_CONFIG, "display voip %s\n", ext_yesno[i]);
- } else
- {
- PDEBUG(DEBUG_CONFIG, "given display_voip param unknown: %s\n", param);
- }
- } else
if (!strcmp(option,"display_fake"))
{
i=0;
fprintf(fp,"# example: \"200 (int)\"\n");
fprintf(fp,"display_int %s\n\n",(ext->display_int)?"yes":"no");
- fprintf(fp,"# Display H323 caller ids using display override (yes or no)\n");
- fprintf(fp,"# example: \"15551212 jolly@192.168.0.3\"\n");
- fprintf(fp,"display_voip %s\n\n",(ext->display_voip)?"yes":"no");
-
fprintf(fp,"# Display if calls are anonymous using display override (yes or no)\n");
fprintf(fp,"# This makes only sense if the anon-ignore feature is enabled.\n");
fprintf(fp,"# example: \"15551212 anon\"\n");