]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
too bad nobody reads all the rest of the code where more critical issues may lie
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 25 Nov 2009 22:21:02 +0000 (22:21 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 25 Nov 2009 22:21:02 +0000 (22:21 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15675 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_glue.c

index 44d8614cac1f82560d2a94ca90746431b58f3025..643c57e3b987009a89efef1b9b4f6b208e5ee709 100644 (file)
@@ -411,17 +411,17 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32
 
 const char *sofia_glue_get_codec_string(private_object_t *tech_pvt)
 {
-       const char *codec_string = NULL;
+       const char *codec_string = NULL, *preferred = NULL, *fallback = NULL;
        
        if (switch_channel_direction(tech_pvt->channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
-               if (!zstr(tech_pvt->profile->outbound_codec_string)) {
-                       codec_string = tech_pvt->profile->outbound_codec_string ? tech_pvt->profile->outbound_codec_string : tech_pvt->profile->inbound_codec_string;
-               }
+               preferred = tech_pvt->profile->outbound_codec_string;
+               fallback = tech_pvt->profile->inbound_codec_string;
        } else {
-               if (!zstr(tech_pvt->profile->inbound_codec_string)) {
-                       codec_string = tech_pvt->profile->inbound_codec_string ? tech_pvt->profile->inbound_codec_string : tech_pvt->profile->outbound_codec_string;
-               }
+               preferred = tech_pvt->profile->inbound_codec_string;
+               fallback = tech_pvt->profile->outbound_codec_string;
        }
+
+       codec_string = !zstr(preferred) ? preferred : fallback;
        
        return codec_string;
 }