Fixed wrong reference when requesting a channel from chan_lcr.
[lcr.git] / gsm_bs.cpp
index 22ac70c..2da06c7 100644 (file)
@@ -57,34 +57,6 @@ void generate_dtmf(void)
 
 
 /*
- * DTMF stuff
- */
-unsigned char dtmf_samples[16][8000];
-static int dtmf_x[4] = { 1209, 1336, 1477, 1633 };
-static int dtmf_y[4] = { 697, 770, 852, 941 };
-
-void generate_dtmf(void)
-{
-       double fx, fy, sample;
-       int i, x, y;
-       unsigned char *law;
-
-       for (y = 0; y < 4; y++) {
-               fy = 2 * 3.1415927 * ((double)dtmf_y[y]) / 8000.0;
-               for (x = 0; x < 4; x++) {
-                       fx = 2 * 3.1415927 * ((double)dtmf_x[x]) / 8000.0;
-                       law = dtmf_samples[y << 2 | x];
-                       for (i = 0; i < 8000; i++) {
-                               sample = sin(fy * ((double)i)) * 0.251 * 32767.0; /* -6 dB */
-                               sample += sin(fx * ((double)i)) * 0.158 * 32767.0; /* -8 dB */
-                               *law++ = audio_s16_to_law[(int)sample & 0xffff];
-                       }
-               }
-       }
-}
-
-
-/*
  * constructor
  */
 Pgsm_bs::Pgsm_bs(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive, int mode) : Pgsm(type, mISDNport, portname, settings, channel, exclusive, mode)
@@ -824,18 +796,8 @@ int Pgsm_bs::message_epoint(unsigned int epoint_id, int message_id, union parame
 
 int gsm_bs_exit(int rc)
 {
-#if 0
-       /* free gsm instance */
-       if (gsm) {
-               /* shutdown network */
-               if (gsm->network)
-                       bsc_shutdown_net((struct gsm_network *)gsm->network);
-               /* free network */
-//             if (gsm->network) {
-//                     free((struct gsm_network *)gsm->network); /* TBD */
-//             }
-       }
-#endif
+       gsm->network = NULL;
+
        return(rc);
 }
 
@@ -1041,5 +1003,8 @@ int gsm_bs_init(void)
        /* do the initial connect */
        socket_retry_cb(&gsm->socket_retry, NULL, 0);
 
+       /* dummy instance */
+       gsm->network = (void *)1;
+
        return 0;
 }