Merged revisions 318231 via svnmerge from
authorRichard Mudgett <rmudgett@digium.com>
Mon, 9 May 2011 17:00:05 +0000 (17:00 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 9 May 2011 17:00:05 +0000 (17:00 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r318231 | rmudgett | 2011-05-09 11:57:18 -0500 (Mon, 09 May 2011) | 41 lines

  Don't get early media for ISDN on outgoing calls.

  It looks to be a long-standing misinterpretation of the progress indicator
  ie values:
  1 - Call is not end-to-end ISDN; further call progress information may be
  available in-band.
  8 - In-band information or an appropriate pattern is now available.

  Only value 8 is handled by chan_dahdi/sig_pri.  The 1 value is not handled
  as early media probably because the meaning of the second half of it's
  description was overlooked.

  * Test to see if either PRI_PROG_CALL_NOT_E2E_ISDN(1) or
  PRI_PROG_INBAND_AVAILABLE(8) bits are set to open the media path.

  (closes issue #18868)
  Reported by: isrl
  Patches:
        issue18868_19246_v1.8.patch uploaded by rmudgett (license 664)
  Tested by: satish_lx

  ..........

  No inband progress on PRI_EVENT_RINGING even if inband flag set.

  My ISDN-PRI provider sends an ALERTING with "Inband information or
  appropriate pattern now available", but Asterisk only generates and passes
  the RING to the SIP extension, not the inband message.  Unfortunately, the
  inband message is not a ringback tone but a prompt that says the number is
  not in service.  The SIP extension then hears two rings and the call is
  hungup which confuses the caller.

  * Post an AST_CONTROL_PROGRESS as well as opening the media path if inband
  audio is indicated with an ALERTING message.

  (closes issue #19246)
  Reported by: cristiandimache
  Patches:
        issue19246_v1.8.patch uploaded by rmudgett (license 664)
  Tested by: cristiandimache
................

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

channels/sig_pri.c

index ad72f69..9440df6 100644 (file)
@@ -6247,13 +6247,19 @@ static void *pri_dchannel(void *vpri)
                                        pri->pvts[chanpos]->call_level = SIG_PRI_CALL_LEVEL_ALERTING;
                                }
 
-                               if (
+                               if (!pri->pvts[chanpos]->progress
+                                       && !pri->pvts[chanpos]->no_b_channel
 #ifdef PRI_PROGRESS_MASK
-                                       e->ringing.progressmask & PRI_PROG_INBAND_AVAILABLE
+                                       && (e->ringing.progressmask
+                                               & (PRI_PROG_CALL_NOT_E2E_ISDN | PRI_PROG_INBAND_AVAILABLE))
 #else
-                                       e->ringing.progress == 8
+                                       && e->ringing.progress == 8
 #endif
                                        ) {
+                                       /* Bring voice path up */
+                                       pri_queue_control(pri, chanpos, AST_CONTROL_PROGRESS);
+                                       pri->pvts[chanpos]->progress = 1;
+                                       sig_pri_set_dialing(pri->pvts[chanpos], 0);
                                        sig_pri_open_media(pri->pvts[chanpos]);
                                }
 
@@ -6305,7 +6311,8 @@ static void *pri_dchannel(void *vpri)
                                if (!pri->pvts[chanpos]->progress
                                        && !pri->pvts[chanpos]->no_b_channel
 #ifdef PRI_PROGRESS_MASK
-                                       && (e->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE)
+                                       && (e->proceeding.progressmask
+                                               & (PRI_PROG_CALL_NOT_E2E_ISDN | PRI_PROG_INBAND_AVAILABLE))
 #else
                                        && e->proceeding.progress == 8
 #endif
@@ -6347,7 +6354,8 @@ static void *pri_dchannel(void *vpri)
                                if (!pri->pvts[chanpos]->progress
                                        && !pri->pvts[chanpos]->no_b_channel
 #ifdef PRI_PROGRESS_MASK
-                                       && (e->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE)
+                                       && (e->proceeding.progressmask
+                                               & (PRI_PROG_CALL_NOT_E2E_ISDN | PRI_PROG_INBAND_AVAILABLE))
 #else
                                        && e->proceeding.progress == 8
 #endif