Merged revisions 272446 via svnmerge from
authorRichard Mudgett <rmudgett@digium.com>
Thu, 24 Jun 2010 22:11:26 +0000 (22:11 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 24 Jun 2010 22:11:26 +0000 (22:11 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r272446 | rmudgett | 2010-06-24 16:58:49 -0500 (Thu, 24 Jun 2010) | 10 lines

  ss_thread calls pri_grab without lock during overlap dial

  Recent changes to chan_dahdi with relation to overlap dialing call
  pri_grab without first obtaining a lock.

  (closes issue #17414)
  Reported by: pdf
  Patches:
        bug17414.patch uploaded by jpeeler (license 325)
........

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

channels/sig_pri.c

index 2a0c8ef..e7b059f 100644 (file)
@@ -1510,6 +1510,7 @@ static void *pri_ss_thread(void *data)
                ast_copy_string(chan->exten, exten, sizeof(chan->exten));
                sig_pri_dsp_reset_and_flush_digits(p);
                if (p->pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING) {
                ast_copy_string(chan->exten, exten, sizeof(chan->exten));
                sig_pri_dsp_reset_and_flush_digits(p);
                if (p->pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING) {
+                       sig_pri_lock_private(p);
                        if (p->pri->pri) {              
                                if (!pri_grab(p, p->pri)) {
                                        pri_proceeding(p->pri->pri, p->call, PVT_TO_CHANNEL(p), 0);
                        if (p->pri->pri) {              
                                if (!pri_grab(p, p->pri)) {
                                        pri_proceeding(p->pri->pri, p->call, PVT_TO_CHANNEL(p), 0);
@@ -1519,6 +1520,7 @@ static void *pri_ss_thread(void *data)
                                        ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->pri->span);
                                }
                        }
                                        ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->pri->span);
                                }
                        }
+                       sig_pri_unlock_private(p);
                }
 
                sig_pri_set_echocanceller(p, 1);
                }
 
                sig_pri_set_echocanceller(p, 1);