BIG refactoring in pjsua_media.c:
 - switchboard/conf detection is done at run-time, removing #ifdefs
     - use one function, open_snd_dev() to open device
     - use one function, create_aud_param() to initialize 
       audio parameters:
         - get the default from device
         - override with user settings previously done with
           pjsua_snd_set_setting() (new API)
 - added new API to set/get sound device settings. The settings are
    semi permanent, it will be used for future opening of sound dev:
     - pjsua_snd_set_setting()
     - pjsua_snd_get_setting()
 - snd_auto_close_time default value changed to 1 (from -1)
 - both pjsua_enum_snd_devs() and pjsua_enum_aud_devs() API are now
    supported (previously it was done with #ifdef).
 - make_call() will not open the sound device is switchboard is 
    used



git-svn-id: https://svn.pjsip.org/repos/pjproject/branches/projects/aps-direct@2493 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c
index c2f9ae2..87dcfde 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -370,9 +370,13 @@
 
     PJSUA_LOCK();
 
-    /* Create sound port if none is instantiated */
-    if (pjsua_var.snd_port==NULL && pjsua_var.null_snd==NULL && 
-	!pjsua_var.no_snd) 
+    /* Create sound port if none is instantiated, to check if sound device
+     * can be used. But only do this with the conference bridge, as with 
+     * audio switchboard (i.e. APS-Direct), we can only open the sound 
+     * device once the correct format has been known
+     */
+    if (!pjsua_var.is_mswitch && pjsua_var.snd_port==NULL && 
+	pjsua_var.null_snd==NULL && !pjsua_var.no_snd) 
     {
 	pj_status_t status;