Merge branch 'master' of ssh://jolly@www.mISDN.org/var/git/lcr
[lcr.git] / extension.c
index f498438..eaaff7d 100644 (file)
@@ -62,14 +62,8 @@ int read_extension(struct extension *ext, char *num)
        /* default values */
        memset(ext, 0, sizeof(struct extension));
        SCPY(ext->number, number);
+//     ********** NOTE: also change value in apppbx constructor
        ext->rights = 4; /* international */
-       ext->tout_setup = 120;
-       ext->tout_dialing = 120;
-       ext->tout_proceeding = 120;
-       ext->tout_alerting = 120;
-       ext->tout_disconnect = 120;
-//     ext->tout_hold = 900;
-//     ext->tout_park = 900;
        ext->cfnr_delay = 20;
        ext->vbox_codec = CODEC_MONO;
 
@@ -402,24 +396,6 @@ int read_extension(struct extension *ext, char *num)
                                PDEBUG(DEBUG_CONFIG, "unknown parameter given keypad: %s\n", param);
                        }
                } else
-               if (!strcmp(option,"centrex"))
-               {
-                       i=0;
-                       while(ext_yesno[i])
-                       {
-                               if (!strcasecmp(param,ext_yesno[i]))
-                                       break;
-                               i++;
-                       }
-                       if (ext_yesno[i])
-                       {
-                               ext->centrex = i;
-                               PDEBUG(DEBUG_CONFIG, "use centrex to display name %s\n", ext_yesno[i]);
-                       } else
-                       {
-                               PDEBUG(DEBUG_CONFIG, "unknown parameter given centrex: %s\n", param);
-                       }
-               } else
                if (!strcmp(option,"rights"))
                {
                        i=0;
@@ -474,80 +450,24 @@ int read_extension(struct extension *ext, char *num)
                                PDEBUG(DEBUG_CONFIG, "given noknocking param unknown: %s\n", param);
                        }
                } else
-               if (!strcmp(option,"rxvol"))
-               {
-                       ext->rxvol = atoi(param);
-                       if (ext->rxvol<-8 || ext->rxvol>8)
-                               ext->rxvol = 0;
-
-                       PDEBUG(DEBUG_CONFIG, "receive volume: %d\n",ext->rxvol);
-               } else
-               if (!strcmp(option,"txvol"))
-               {
-                       ext->txvol = atoi(param);
-                       if (ext->txvol<-8 || ext->txvol>8)
-                               ext->txvol = 0;
-
-                       PDEBUG(DEBUG_CONFIG, "transmit volume: %d\n",ext->txvol);
-               } else
-               if (!strcmp(option,"tout_setup"))
-               {
-                       ext->tout_setup = atoi(param);
-                       if (ext->tout_setup < 0)
-                               ext->tout_setup = 0;
-
-                       PDEBUG(DEBUG_CONFIG, "timeout setup: %d\n",ext->tout_setup);
-               } else
-               if (!strcmp(option,"tout_dialing"))
-               {
-                       ext->tout_dialing = atoi(param);
-                       if (ext->tout_dialing < 0)
-                               ext->tout_dialing = 0;
-
-                       PDEBUG(DEBUG_CONFIG, "timeout dialing: %d\n",ext->tout_dialing);
-               } else
-               if (!strcmp(option,"tout_proceeding"))
-               {
-                       ext->tout_proceeding = atoi(param);
-                       if (ext->tout_proceeding < 0)
-                               ext->tout_proceeding = 0;
-
-                       PDEBUG(DEBUG_CONFIG, "timeout proceeding: %d\n",ext->tout_proceeding);
-               } else
-               if (!strcmp(option,"tout_alerting"))
-               {
-                       ext->tout_alerting = atoi(param);
-                       if (ext->tout_alerting < 0)
-                               ext->tout_alerting = 0;
-
-                       PDEBUG(DEBUG_CONFIG, "timeout alerting: %d\n",ext->tout_alerting);
-               } else
-               if (!strcmp(option,"tout_disconnect"))
-               {
-                       ext->tout_disconnect = atoi(param);
-                       if (ext->tout_disconnect < 0)
-                               ext->tout_disconnect = 0;
-
-                       PDEBUG(DEBUG_CONFIG, "timeout disconnect: %d\n",ext->tout_disconnect);
-               } else
-#if 0
-               if (!strcmp(option,"tout_hold"))
+               if (!strcmp(option,"rx_gain")
+                || !strcmp(option,"rxvol"))
                {
-                       ext->tout_hold = atoi(param);
-                       if (ext->tout_hold < 0)
-                               ext->tout_hold = 0;
+                       ext->rx_gain = atoi(param);
+                       if (ext->rx_gain<-8 || ext->rx_gain>8)
+                               ext->rx_gain = 0;
 
-                       PDEBUG(DEBUG_CONFIG, "timeout hold: %d\n",ext->tout_hold);
+                       PDEBUG(DEBUG_CONFIG, "receive volume: %d\n",ext->rx_gain);
                } else
-               if (!strcmp(option,"tout_park"))
+               if (!strcmp(option,"tx_gain")
+                || !strcmp(option,"txvol"))
                {
-                       ext->tout_park = atoi(param);
-                       if (ext->tout_park < 0)
-                               ext->tout_park = 0;
+                       ext->tx_gain = atoi(param);
+                       if (ext->tx_gain<-8 || ext->tx_gain>8)
+                               ext->tx_gain = 0;
 
-                       PDEBUG(DEBUG_CONFIG, "timeout park: %d\n",ext->tout_park);
+                       PDEBUG(DEBUG_CONFIG, "transmit volume: %d\n",ext->tx_gain);
                } else
-#endif
                if (!strcmp(option,"own_setup"))
                {
                        i=0;
@@ -1028,7 +948,7 @@ int write_extension(struct extension *ext, char *number)
 
        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);
 
@@ -1144,7 +1064,7 @@ int write_extension(struct extension *ext, char *number)
        }
 
        fprintf(fp,"# CLIP Prefix\n");
-       fprintf(fp,"# Adds a prefix to incomming caller IDs, so telephones will be able to respond\n");
+       fprintf(fp,"# Adds a prefix to incoming caller IDs, so telephones will be able to respond\n");
        fprintf(fp,"# to unanswered calls from their list. The prefix must be the digit(s) to get\n");
        fprintf(fp,"# an external line. The caller ID will then be extendet so that they can be\n");
        fprintf(fp,"# dialed from internal telephones. Many telephones have this feature, but some\n");
@@ -1156,11 +1076,6 @@ int write_extension(struct extension *ext, char *number)
        fprintf(fp,"# DTMF tone, but the digit is transmitted via D-channel diaing info.\n");
        fprintf(fp,"keypad          %s\n\n",(ext->keypad)?"yes":"no");
 
-       fprintf(fp,"# Called Name Identification Presentation (CNIP/CONP)\n");
-       fprintf(fp,"# If supported by telephone, special information element on the d-channel are\n");
-       fprintf(fp,"# used to show name of caller. It is supported by newer Siemens telephones\n# (Centrex).\n");
-       fprintf(fp,"centrex         %s  #this is currently not working!!!\n\n",(ext->centrex)?"yes":"no");
-
        fprintf(fp,"# Ignore restriction of COLP and CLIP\n");
        fprintf(fp,"# In this case even restricted numbers are presented to this extension.\n");
        fprintf(fp,"# This also works for incoming external anonymous calls IF:\n");
@@ -1184,51 +1099,12 @@ int write_extension(struct extension *ext, char *number)
        fprintf(fp,"# 1 = double, 2 = quadrupel, 8 = 256 times (amplitude)\n");
        fprintf(fp,"# -1 = half, -2 = quarter, 8 = 1/256th (amplitude)\n");
        fprintf(fp,"# Audio data is limited to the maximum value when exceeds limit.\n");
-       fprintf(fp,"txvol           %d\n\n",ext->txvol);
+       fprintf(fp,"tx_gain          %d\n\n",ext->tx_gain);
 
        fprintf(fp,"# Receive volume (-8 .. 8)\n");
-       fprintf(fp,"# (see txvol)\n");
-       fprintf(fp,"rxvol           %d\n\n",ext->rxvol);
-
-       fprintf(fp,"# Timeout values\n# The keywords specify the following timeouts:\n");
-       fprintf(fp,"# tout_setup: after pickup before dialing anything. (default 60 seconds)\n");
-       fprintf(fp,"# tout_dialing: after dialing last digit of uncomplete number (default 15)\n");
-       fprintf(fp,"# tout_proceeding: after start proceeding (default 120)\n");
-       fprintf(fp,"# tout_alerting: after start ringing (default 120)\n");
-       fprintf(fp,"# tout_disconnect: after disconnect (default 120)\n");
-//     fprintf(fp,"# tout_hold: maximum time to hold a call (default 900)\n");
-//     fprintf(fp,"# tout_park: maximum time to park a call (default 900)\n");
-       fprintf(fp,"# All timeouts may be disabled by using keyword 'off' instead of seconds.\n");
-       fprintf(fp,"# All timeouts refer to internal ports only. External timeouts are controlled\n");
-       fprintf(fp,"# by external line.\n");
-       if (ext->tout_setup)
-               fprintf(fp,"tout_setup      %d\n",ext->tout_setup);
-       else
-               fprintf(fp,"tout_setup      off\n");
-       if (ext->tout_dialing)
-               fprintf(fp,"tout_dialing    %d\n",ext->tout_dialing);
-       else
-               fprintf(fp,"tout_dialing    off\n");
-       if (ext->tout_proceeding)
-               fprintf(fp,"tout_proceeding %d\n",ext->tout_proceeding);
-       else
-               fprintf(fp,"tout_proceeding off\n");
-       if (ext->tout_alerting)
-               fprintf(fp,"tout_alerting   %d\n",ext->tout_alerting);
-       else
-               fprintf(fp,"tout_alerting   off\n");
-       if (ext->tout_disconnect)
-               fprintf(fp,"tout_disconnect %d\n\n",ext->tout_disconnect);
-       else
-               fprintf(fp,"tout_disconnect off\n\n");
-//     if (ext->tout_hold)
-//             fprintf(fp,"tout_hold       %d\n",ext->tout_hold);
-//     else
-//             fprintf(fp,"tout_hold       off\n");
-//     if (ext->tout_park)
-//             fprintf(fp,"tout_park       %d\n\n",ext->tout_park);
-//     else
-//             fprintf(fp,"tout_park       off\n\n");
+       fprintf(fp,"# (see tx_gain)\n");
+       fprintf(fp,"rx_gain          %d\n\n",ext->rx_gain);
+
 
        fprintf(fp,"# Force to use tones and announcements generated by the pbx.\n");
        fprintf(fp,"# For internal calls always own tones are used. You may specify own tones for\n");