]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7903 #resolve [proxy_media gives Codec PROXY Exists but not at the desired impleme...
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 24 Aug 2015 22:43:59 +0000 (17:43 -0500)
committerBrian West <brian@freeswitch.org>
Mon, 24 Aug 2015 22:44:20 +0000 (17:44 -0500)
src/switch_core_codec.c
src/switch_core_media.c
src/switch_pcm.c

index 8f1b921380bbc34dc02c451997b57c0dce2034cf..2c3654e8970486e84bb98295ab3c92bdb2ac1d48 100644 (file)
@@ -666,6 +666,17 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init_with_bitrate(switch_codec
                return SWITCH_STATUS_GENERR;
        }
 
+       if (!strncasecmp(codec_name, "PROXY", 5)) {
+               for (iptr = codec_interface->implementations; iptr; iptr = iptr->next) {
+                       if ((!channels || channels == iptr->number_of_channels)) {
+                               implementation = iptr;
+                               break;
+                       }
+               }
+
+               goto found;
+       }
+       
        /* If no specific codec interval is requested opt for 20ms above all else because lots of stuff assumes it */
        if (!ms) {
                for (iptr = codec_interface->implementations; iptr; iptr = iptr->next) {
index 01fcd5b1b4d52cc46c16642a28e4bafb9d66393d..9d7406d561c250c3e69bf7d1036d66fca41c0ce7 100644 (file)
@@ -782,7 +782,6 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
 
        pmap->allocated = 1;
 
-
        pmap->recv_pt = (switch_payload_t) pt;
 
 
@@ -8410,7 +8409,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
                                                                                                 SDP_TYPE_RESPONSE,
                                                                                                 0,
                                                                                                 8000,
-                                                                                                8000,
+                                                                                                20,
                                                                                                 1,
                                                                                                 SWITCH_TRUE);
 
@@ -9834,7 +9833,7 @@ SWITCH_DECLARE(void) switch_core_media_check_outgoing_proxy(switch_core_session_
                                                                                         SDP_TYPE_RESPONSE,
                                                                                         0,
                                                                                         8000,
-                                                                                        8000,
+                                                                                        20,
                                                                                         1,
                                                                                         SWITCH_TRUE);
 
index 3e66540d1b33dc28aa77744427f45ca0865cc17b..7c5a98756e88e433cc6f18f6bd93102803e25f58 100644 (file)
@@ -402,24 +402,24 @@ SWITCH_MODULE_LOAD_FUNCTION(core_pcm_load)
                                                                                 switch_proxy_decode,   /* function to decode encoded data into raw data */
                                                                                 switch_proxy_destroy); /* deinitalize a codec handle using this implementation */
 
-  SWITCH_ADD_CODEC(codec_interface, "PROXY PASS-THROUGH");
-  switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO,  /* enumeration defining the type of the codec */
-                     0, /* the IANA code number */
-                     "PROXY", /* the IANA code name */
-                     NULL,  /* default fmtp to send (can be overridden by the init function) */
-                     8000,  /* samples transferred per second */
-                     8000,  /* actual samples transferred per second */
-                     0, /* bits transferred per second */
-                     20000, /* number of microseconds per frame */
-                     160, /* number of samples per frame */
-                     320 * 2, /* number of bytes per frame decompressed */
-                     320 * 2, /* number of bytes per frame compressed */
-                     2, /* number of channels represented */
-                     1, /* number of frames per network packet */
-                     switch_proxy_init, /* function to initialize a codec handle using this implementation */
-                     switch_proxy_encode, /* function to encode raw data into encoded data */
-                     switch_proxy_decode, /* function to decode encoded data into raw data */
-                     switch_proxy_destroy); /* deinitalize a codec handle using this implementation */
+
+       switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO,  /* enumeration defining the type of the codec */
+                                                                                0, /* the IANA code number */
+                                                                                "PROXY", /* the IANA code name */
+                                                                                NULL,  /* default fmtp to send (can be overridden by the init function) */
+                                                                                8000,  /* samples transferred per second */
+                                                                                8000,  /* actual samples transferred per second */
+                                                                                0, /* bits transferred per second */
+                                                                                20000, /* number of microseconds per frame */
+                                                                                160, /* number of samples per frame */
+                                                                                320 * 2, /* number of bytes per frame decompressed */
+                                                                                320 * 2, /* number of bytes per frame compressed */
+                                                                                2, /* number of channels represented */
+                                                                                1, /* number of frames per network packet */
+                                                                                switch_proxy_init, /* function to initialize a codec handle using this implementation */
+                                                                                switch_proxy_encode, /* function to encode raw data into encoded data */
+                                                                                switch_proxy_decode, /* function to decode encoded data into raw data */
+                                                                                switch_proxy_destroy); /* deinitalize a codec handle using this implementation */
 
        SWITCH_ADD_CODEC(codec_interface, "RAW Signed Linear (16 bit)");