--- channels/chan_multicast_rtp.c.328209 2011-09-16 16:54:24.000000000 -0400 +++ channels/chan_multicast_rtp.c 2011-09-16 17:47:24.000000000 -0400 @@ -118,7 +118,15 @@ struct ast_sockaddr control_address; struct ast_sockaddr destination_address; struct ast_channel *chan; - format_t fmt = ast_best_codec(format); + format_t fmt = 0; + const char *codec; + + if (requestor && (codec = pbx_builtin_getvar_helper((struct ast_channel *)requestor, "MULTICAST_RTP_CODEC"))) { + fmt = ast_getformatbyname(codec); + ast_verb(3, "MulticastRTP set codec to %s\n",codec); + } + if (!fmt) + fmt = ast_best_codec(format); ast_sockaddr_setnull(&control_address);