]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Commit patch from MODENDP-174
authorAndrew Thompson <andrew@hijacked.us>
Thu, 15 Jan 2009 22:58:59 +0000 (22:58 +0000)
committerAndrew Thompson <andrew@hijacked.us>
Thu, 15 Jan 2009 22:58:59 +0000 (22:58 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11236 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_portaudio/mod_portaudio.c

index ee4b33b0affd1861aff544ec87cf46ccf4444f9a..bd976b19fc20c518243bc2842a40ccd8abcdad8c 100644 (file)
@@ -1030,7 +1030,7 @@ static void PrintSupportedStandardSampleRates(const PaStreamParameters * inputPa
 
 static switch_status_t devlist(char **argv, int argc, switch_stream_handle_t *stream)
 {
-       int i, numDevices;
+       int i, numDevices, prev;
        const PaDeviceInfo *deviceInfo;
 
        numDevices = Pa_GetDeviceCount();
@@ -1039,7 +1039,32 @@ static switch_status_t devlist(char **argv, int argc, switch_stream_handle_t *st
        }
        for (i = 0; i < numDevices; i++) {
                deviceInfo = Pa_GetDeviceInfo(i);
-               stream->write_function(stream, "%d;%s;%d;%d\n", i, deviceInfo->name, deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels);
+               stream->write_function(stream, "%d;%s;%d;%d;", i, deviceInfo->name, deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels);
+
+               prev = 0;
+               if (globals.ringdev == i) {
+                       stream->write_function(stream, "r");
+                       prev = 1;
+               }
+
+               if (globals.indev == i) {
+                       if (prev) {
+                               stream->write_function(stream, ",");
+                       }
+                       stream->write_function(stream, "i");
+                       prev = 1;
+               }
+
+               if (globals.outdev == i) {
+                       if (prev) {
+                               stream->write_function(stream, ",");
+                       }
+                       stream->write_function(stream, "o");
+                       prev = 1;
+               }
+
+               stream->write_function(stream, "\n");
+
        }
 
        return SWITCH_STATUS_SUCCESS;