Reverted revision 201717.
authorMatthew Nicholson <mnicholson@digium.com>
Tue, 10 Nov 2009 15:53:52 +0000 (15:53 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Tue, 10 Nov 2009 15:53:52 +0000 (15:53 +0000)
(closes issue 0016175)
Reported by: paul-tg

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229102 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 6850f83..4103fa5 100644 (file)
@@ -6468,14 +6468,6 @@ static void try_suggested_sip_codec(struct sip_pvt *p)
 {
        format_t fmt;
        const char *codec;
-       struct ast_channel* chan;
-
-       chan = ast_channel_ref(p->owner);
-       while (ast_channel_trylock(chan)) {
-               sip_pvt_unlock(p);
-               sched_yield();
-               sip_pvt_lock(p);
-       }
 
        if (p->outgoing_call) {
                codec = pbx_builtin_getvar_helper(p->owner, "SIP_CODEC_OUTBOUND");
@@ -6483,12 +6475,7 @@ static void try_suggested_sip_codec(struct sip_pvt *p)
                codec = pbx_builtin_getvar_helper(p->owner, "SIP_CODEC");
        }
 
-       codec = ast_strdupa(S_OR(codec, ""));
-
-       ast_channel_unlock(chan);
-       chan = ast_channel_unref(chan);
-
-       if (ast_strlen_zero(codec))
+       if (!codec) 
                return;
 
        fmt = ast_getformatbyname(codec);