]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix for -Wunused-but-set-variable required compiler. : mod_freetdm mod_avmd mod_cidlo...
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Sat, 23 Apr 2011 02:49:41 +0000 (22:49 -0400)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Sat, 23 Apr 2011 02:49:41 +0000 (22:49 -0400)
13 files changed:
libs/freetdm/mod_freetdm/mod_freetdm.c
src/mod/applications/mod_avmd/mod_avmd.c
src/mod/applications/mod_cidlookup/mod_cidlookup.c
src/mod/applications/mod_ladspa/mod_ladspa.c
src/mod/applications/mod_lcr/mod_lcr.c
src/mod/applications/mod_nibblebill/mod_nibblebill.c
src/mod/applications/mod_rss/mod_rss.c
src/mod/applications/mod_vmd/mod_vmd.c
src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c
src/mod/endpoints/mod_portaudio/pablio.c
src/mod/endpoints/mod_skinny/mod_skinny.c
src/mod/endpoints/mod_skinny/skinny_server.c
src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.c

index 8739c4c0bf80b1480823d037fe91197e81b77439..d1a5871b09b6ade23b8dc23f534895ddc3e37b86 100755 (executable)
@@ -720,7 +720,6 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
        ftdm_size_t len;
        unsigned char data[SWITCH_RECOMMENDED_BUFFER_SIZE] = {0};
        ftdm_wait_flag_t wflags = FTDM_WRITE;
-       ftdm_status_t status;
 
        channel = switch_core_session_get_channel(session);
        assert(channel != NULL);
@@ -755,7 +754,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
 
 
        wflags = FTDM_WRITE;    
-       status = ftdm_channel_wait(tech_pvt->ftdmchan, &wflags, ftdm_channel_get_io_interval(tech_pvt->ftdmchan) * 10);
+       ftdm_channel_wait(tech_pvt->ftdmchan, &wflags, ftdm_channel_get_io_interval(tech_pvt->ftdmchan) * 10);
        
        if (!(wflags & FTDM_WRITE)) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Dropping frame! (write not ready)\n");
index 8e6f2e124d6d4b447d79a8ebc8473148d1431ecb..d0c9f6e419168a792bac806437ad0917ff250f32 100644 (file)
@@ -479,7 +479,7 @@ static void avmd_process(avmd_session_t *session, switch_frame_t *frame)
     double success = 0.0;
     double amp = 0.0;
     double s_rate;
-    double e_rate;
+//    double e_rate;
     double avg_a;
     double sine_len;
     uint32_t sine_len_i;
@@ -523,7 +523,7 @@ static void avmd_process(avmd_session_t *session, switch_frame_t *frame)
                /*! Every once in a while we evaluate the desa2 and amplitude results */
         if(((pos + 1) % sine_len_i) == 0){
             s_rate = success / (error + success);
-            e_rate = error   / (error + success);
+//            e_rate = error   / (error + success);
             avg_a  = amp     / sine_len;
 
                        /*! Results out of these ranges are considered invalid */
index 2ec41f19e4c89bd14ba78f84cf7378eec3843633..06bf615ce5878270a2195e95c768ec963cbb89f3 100755 (executable)
@@ -729,6 +729,9 @@ SWITCH_STANDARD_APP(cidlookup_app_function)
        if (!session && pool) {
                switch_core_destroy_memory_pool(&pool);
        }
+       /* This is so compile doesn't failed because status is never used */
+       if (status) {
+       }
 }
 
 SWITCH_STANDARD_API(cidlookup_function)
index 43ea87a3ca4a0d94504e4379125c76aa6b51d314..bab6ff521698452280dd3b8aa38fb9f1711d7724 100644 (file)
@@ -565,12 +565,11 @@ switch_status_t ladspa_session(switch_core_session_t *session, const char *flags
 static void ladspa_parse(switch_core_session_t *session, const char *data)
 {
        char *argv[5] = { 0 };
-       int argc;
        char *lbuf;
 
        if (data) {
                lbuf = strdup(data);
-               argc = switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])));
+               switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])));
                ladspa_session(session, argv[0], argv[1], argv[2], argv[3]);
                free(lbuf);
        }
index ac5d90871ebf713f4dc9f9b56c840db6d3e4a3ba..fcb75ef4d53100a53e0fde3cbc76c5c3cb7255da 100644 (file)
@@ -248,14 +248,13 @@ static char *get_bridge_data(switch_memory_pool_t *pool, char *dialed_number, ch
        size_t  tstrip;
        char *data = NULL;
        char *destination_number = NULL;
-       char *orig_destination_number = NULL; 
        char *codec = NULL;
        char *cid = NULL;
        char *header = NULL;
        char *user_rate = NULL;
        char *export_fields = NULL;
 
-       orig_destination_number = destination_number = switch_core_strdup(pool, dialed_number);
+       destination_number = switch_core_strdup(pool, dialed_number);
        
        tstrip = ((cur_route->digit_len - cur_route->tstrip) + 1);
        lstrip = cur_route->lstrip;
@@ -1263,7 +1262,6 @@ static switch_call_cause_t lcr_outgoing_channel(switch_core_session_t *session,
        const char *intralata = NULL;
        switch_core_session_t *mysession = NULL;
        switch_channel_t *channel = NULL;
-       switch_caller_profile_t *caller_profile = NULL;
        
        dest = strdup(outbound_profile->destination_number);
        
@@ -1290,7 +1288,6 @@ static switch_call_cause_t lcr_outgoing_channel(switch_core_session_t *session,
                        timelimit = atoi(var);
                }
                routes.session = session;
-               caller_profile = switch_channel_get_caller_profile(channel);
                intrastate = switch_channel_get_variable(channel, "intrastate");
                intralata = switch_channel_get_variable(channel, "intralata");
                cid_name_override = switch_channel_get_variable(channel, "origination_caller_id_name");
@@ -1670,7 +1667,7 @@ SWITCH_STANDARD_API(dialplan_lcr_function)
        char *argv[4] = { 0 };
        int argc;
        char *mydata = NULL;
-       char *dialstring = NULL;
+       //char *dialstring = NULL;
        char *lcr_profile = NULL;
        lcr_route current = NULL;
        max_obj_t maximum_lengths = { 0 };
@@ -1792,7 +1789,8 @@ SWITCH_STANDARD_API(dialplan_lcr_function)
                        current = cb_struct.head;
                        while (current) {
 
-                               dialstring = get_bridge_data(pool, cb_struct.lookup_number, cb_struct.cid, current, cb_struct.profile, cb_struct.session);
+                               //dialstring = 
+                               get_bridge_data(pool, cb_struct.lookup_number, cb_struct.cid, current, cb_struct.profile, cb_struct.session);
                                rowcount++;
 
                                if (as_xml) {
index 8487d0be620d9dd63356095afc6c935e52511b13..068a31f5f3fca3b703c28f26eed176953328b7c4 100755 (executable)
@@ -399,7 +399,7 @@ static switch_status_t do_billing(switch_core_session_t *session)
        const char *billrate;
        const char *billaccount;
        float nobal_amt = globals.nobal_amt;
-       float lowbal_amt = globals.lowbal_amt;
+       //float lowbal_amt = globals.lowbal_amt;
        float balance;
 
        if (!session) {
@@ -421,10 +421,11 @@ static switch_status_t do_billing(switch_core_session_t *session)
        if (!zstr(switch_channel_get_variable(channel, "nobal_amt"))) {
                nobal_amt = (float)atof(switch_channel_get_variable(channel, "nobal_amt"));
        }
+       /*
        if (!zstr(switch_channel_get_variable(channel, "lowbal_amt"))) {
                lowbal_amt = (float)atof(switch_channel_get_variable(channel, "lowbal_amt"));
        }
-
+       */
        /* Return if there's no billing information on this session */
        if (!billrate || !billaccount) {
                return SWITCH_STATUS_SUCCESS;
@@ -802,9 +803,6 @@ SWITCH_STANDARD_API(nibblebill_api_function)
                if ((argc == 2 || argc == 3) && !zstr(argv[0])) {
                        char *uuid = argv[0];
                        if ((psession = switch_core_session_locate(uuid))) {
-                               switch_channel_t *channel;
-                               channel = switch_core_session_get_channel(psession);
-
                                if (!strcasecmp(argv[1], "adjust") && argc == 3) {
                                        nibblebill_adjust(psession, (float) atof(argv[2]));
                                } else if (!strcasecmp(argv[1], "flush")) {
index b85d86bb99fa4513f60379d40dafa05d08a089c8..073b471bb45983faddddd0152abc9212f4c73496 100644 (file)
@@ -175,7 +175,7 @@ SWITCH_STANDARD_APP(rss_function)
        char *filename = NULL;
        char *argv[3], *feed_list[TTS_MAX_ENTRIES] = { 0 }, *feed_names[TTS_MAX_ENTRIES] = {
        0};
-       int argc, feed_index = 0;
+       int feed_index = 0;
        const char *cf = "rss.conf";
        switch_xml_t cfg, cxml, feeds, feed;
        char buf[1024] = "";
@@ -236,7 +236,7 @@ SWITCH_STANDARD_APP(rss_function)
 
        if (!zstr(data)) {
                if ((mydata = switch_core_session_strdup(session, data))) {
-                       argc = switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0]));
+                       switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0]));
 
                        if (argv[0]) {
                                engine = argv[0];
index 4a20df8183f743c8d4ef0828a28ffed1536325df..3bb1e6b16e09e2a978eb1750fb98307ad30b473a 100644 (file)
@@ -237,9 +237,8 @@ static switch_bool_t process_data(vmd_session_info_t *vmd_info, switch_frame_t *
        double pts[P];
        int16_t *data;
        int16_t max;
-       switch_ssize_t len;
 
-       len = frame->samples * sizeof(int16_t);
+       //len = frame->samples * sizeof(int16_t);
        data = (int16_t *) frame->data;
 
        for (max = (int16_t) abs(data[0]), i = 1; i < frame->samples; i++) {
index 0553607bfef370e03151e054bfc6576500b1098b..a5bf1ecad75754325924027e659739c3bb73e2bb 100644 (file)
@@ -250,7 +250,6 @@ static switch_status_t switch_dahdi_encode(switch_codec_t *codec,
 {
        int32_t res;
        short *dbuf_linear;
-       unsigned char *ebuf_g729;
        unsigned char ebuf_ulaw[decoded_data_len / 2];
        uint32_t i;
        struct dahdi_context *context = NULL;
@@ -268,7 +267,6 @@ static switch_status_t switch_dahdi_encode(switch_codec_t *codec,
        }
 
        dbuf_linear = decoded_data;
-       ebuf_g729 = encoded_data;
        for (i = 0; i < decoded_data_len / sizeof(short); i++) {
                ebuf_ulaw[i] = linear_to_ulaw(dbuf_linear[i]);
        }
index b994d21c2a3df3f73699f183c7dd901774ea49a3..05fdf0f280dde6e4911d1cc510143a1f00e3e9c5 100644 (file)
@@ -251,7 +251,7 @@ PaError OpenAudioStream(PABLIO_Stream ** rwblPtr,
        PABLIO_Stream *aStream;
        long numFrames;
        //long numBytes;
-       int channels = 1;
+       //int channels = 1;
 
        if (!(inputParameters || outputParameters)) {
                return -1;
@@ -262,11 +262,13 @@ PaError OpenAudioStream(PABLIO_Stream ** rwblPtr,
        switch_assert(aStream);
        memset(aStream, 0, sizeof(PABLIO_Stream));
 
+       /*
        if (inputParameters) {
                channels = inputParameters->channelCount;
        } else if (outputParameters) {
                channels = outputParameters->channelCount;
        }
+       */
 
        numFrames = RoundUpToNextPowerOf2(samples_per_packet * 5);
        aStream->bytesPerFrame = bytesPerSample;
index 38ab78553aa7e3ecc2f853b81e045b455174e805..3879cca7d47accf3964585cd0637dc5ab098874c 100644 (file)
@@ -462,7 +462,6 @@ uint32_t skinny_line_get_state(listener_t *listener, uint32_t line_instance, uin
 
 switch_status_t skinny_tech_set_codec(private_t *tech_pvt, int force)
 {
-       int ms;
        switch_status_t status = SWITCH_STATUS_SUCCESS;
        int resetting = 0;
 
@@ -542,7 +541,7 @@ switch_status_t skinny_tech_set_codec(private_t *tech_pvt, int force)
        }
 
        tech_pvt->read_frame.rate = tech_pvt->rm_rate;
-       ms = tech_pvt->write_codec.implementation->microseconds_per_packet / 1000;
+       //ms = tech_pvt->write_codec.implementation->microseconds_per_packet / 1000;
 
        if (!switch_core_codec_ready(&tech_pvt->read_codec)) {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "Can't load codec?\n");
@@ -880,7 +879,6 @@ switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_
 {
        switch_channel_t *channel = switch_core_session_get_channel(session);
        private_t *tech_pvt = switch_core_session_get_private(session);
-       int payload = 0;
 
        while (!(tech_pvt->read_codec.implementation && switch_rtp_ready(tech_pvt->rtp_session))) {
                if (switch_channel_ready(channel)) {
@@ -908,7 +906,7 @@ switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_
                                return SWITCH_STATUS_FALSE;
                        }
 
-                       payload = tech_pvt->read_frame.payload;
+                       //payload = tech_pvt->read_frame.payload;
 
                        if (switch_rtp_has_dtmf(tech_pvt->rtp_session)) {
                                switch_dtmf_t dtmf = { 0 };
index 35cb74adb56ed9e4f723881c488d46684dde37d5..f6887060fcbf85d6e88a0187fa294dc82c6dbebf 100644 (file)
@@ -588,14 +588,12 @@ switch_call_cause_t skinny_ring_lines(private_t *tech_pvt, switch_core_session_t
 
 switch_status_t skinny_session_ring_out(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
 {
-       switch_channel_t *channel = NULL;
        private_t *tech_pvt = NULL;
 
        switch_assert(session);
        switch_assert(listener);
        switch_assert(listener->profile);
        
-       channel = switch_core_session_get_channel(session);
        tech_pvt = switch_core_session_get_private(session);
 
        send_start_tone(listener, SKINNY_TONE_ALERT, 0, line_instance, tech_pvt->call_id);
@@ -732,14 +730,12 @@ switch_status_t skinny_session_start_media(switch_core_session_t *session, liste
 
 switch_status_t skinny_session_hold_line(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
 {
-       switch_channel_t *channel = NULL;
        private_t *tech_pvt = NULL;
 
        switch_assert(session);
        switch_assert(listener);
        switch_assert(listener->profile);
        
-       channel = switch_core_session_get_channel(session);
        tech_pvt = switch_core_session_get_private(session);
 
        skinny_session_stop_media(session, listener, line_instance);
@@ -760,17 +756,15 @@ switch_status_t skinny_session_hold_line(switch_core_session_t *session, listene
 
 switch_status_t skinny_session_unhold_line(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
 {
-       switch_channel_t *channel = NULL;
        private_t *tech_pvt = NULL;
 
        switch_assert(session);
        switch_assert(listener);
        switch_assert(listener->profile);
        
-       channel = switch_core_session_get_channel(session);
        tech_pvt = switch_core_session_get_private(session);
 
-    skinny_hold_active_calls(listener);
+       skinny_hold_active_calls(listener);
        send_set_ringer(listener, SKINNY_RING_OFF, SKINNY_RING_FOREVER, 0, tech_pvt->call_id);
        send_set_speaker_mode(listener, SKINNY_SPEAKER_ON);
        send_select_soft_keys(listener, line_instance, tech_pvt->call_id, SKINNY_KEY_SET_RING_OUT, 0xffff);
@@ -825,14 +819,12 @@ switch_status_t skinny_session_transfer(switch_core_session_t *session, listener
 
 switch_status_t skinny_session_stop_media(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
 {
-       switch_channel_t *channel = NULL;
        private_t *tech_pvt = NULL;
 
        switch_assert(session);
        switch_assert(listener);
        switch_assert(listener->profile);
        
-       channel = switch_core_session_get_channel(session);
        tech_pvt = switch_core_session_get_private(session);
 
        switch_clear_flag_locked(tech_pvt, TFLAG_IO);
@@ -1773,7 +1765,6 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
        uint32_t call_id = 0;
        switch_core_session_t *session = NULL;
        switch_channel_t *channel = NULL;
-       private_t *tech_pvt = NULL;
 
        skinny_check_data_length(request, sizeof(request->data.soft_key_event.event));
 
@@ -1790,7 +1781,6 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
                        break;
                case SOFTKEY_NEWCALL:
                status = skinny_create_incoming_session(listener, &line_instance, &session);
-                   tech_pvt = switch_core_session_get_private(session);
 
                    skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0);
                        break;
@@ -1874,13 +1864,10 @@ switch_status_t skinny_handle_unregister(listener_t *listener, skinny_message_t
 switch_status_t skinny_handle_soft_key_template_request(listener_t *listener, skinny_message_t *request)
 {
        skinny_message_t *message;
-       skinny_profile_t *profile;
 
        switch_assert(listener->profile);
        switch_assert(listener->device_name);
 
-       profile = listener->profile;
-
        message = switch_core_alloc(listener->pool, 12+sizeof(message->data.soft_key_template));
        message->type = SOFT_KEY_TEMPLATE_RES_MESSAGE;
        message->length = 4 + sizeof(message->data.soft_key_template);
index 0b96db82a1954eb3b4e0f42e85ef4e059e526a59..7f2a7e8b3cafc747b1695430d5da89ce7e7c53d2 100644 (file)
@@ -160,7 +160,6 @@ static void do_rotate(cdr_fd_t *fd)
        char date[80] = "";
        switch_size_t retsize;
        char *p;
-       size_t len;
 
        close(fd->fd);
        fd->fd = -1;
@@ -169,7 +168,6 @@ static void do_rotate(cdr_fd_t *fd)
                switch_time_exp_lt(&tm, switch_micro_time_now());
                switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d-%H-%M-%S", &tm);
 
-               len = strlen(fd->path) + strlen(date) + 2;
                p = switch_mprintf("%s.%s", fd->path, date);
                assert(p);
                switch_file_rename(fd->path, p, globals.pool);