[asterisk-commits] rmudgett: trunk r330052 - in /trunk: ./ channels/sig_pri.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 28 12:16:11 CDT 2011


Author: rmudgett
Date: Thu Jul 28 12:16:07 2011
New Revision: 330052

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=330052
Log:
Merged revisions 330051 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r330051 | rmudgett | 2011-07-28 12:10:37 -0500 (Thu, 28 Jul 2011) | 29 lines
  
  Merged revisions 330050 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ................
    r330050 | rmudgett | 2011-07-28 12:04:24 -0500 (Thu, 28 Jul 2011) | 22 lines
    
    Merged revisions 330033 from
    https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
    
    ..........
      r330033 | rmudgett | 2011-07-28 11:26:38 -0500 (Thu, 28 Jul 2011) | 15 lines
    
      Datacalls with B410P fail.
    
      Incoming and outgoing call legs of a data call are using different
      formats: a-law, u-law.  When the call is bridged, the media stream is run
      through translation to convert the media formats.  The translation is bad
      for data calls.
    
      * Make incoming call that does not explicitly specify u-law or a-law use
      the DAHDI channel's default law.  The outgoing call always uses the
      default law from the DAHDI channel.
    
      (closes issue ABE-2800)
      Patches:
    	jira_abe_2800_companding.patch (license #5621) patch uploaded by rmudgett
    ..........
  ................
................

Modified:
    trunk/   (props changed)
    trunk/channels/sig_pri.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_pri.c?view=diff&rev=330052&r1=330051&r2=330052
==============================================================================
--- trunk/channels/sig_pri.c (original)
+++ trunk/channels/sig_pri.c Thu Jul 28 12:16:07 2011
@@ -5334,6 +5334,7 @@
 	int res;
 	int chanpos = 0;
 	int x;
+	int law;
 	struct ast_channel *c;
 	struct timeval tv, lowest, *next;
 	int doidling=0;
@@ -5962,7 +5963,20 @@
 				/* Make sure extension exists (or in overlap dial mode, can exist) */
 				if (((pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING) && ast_canmatch_extension(NULL, pri->pvts[chanpos]->context, pri->pvts[chanpos]->exten, 1, pri->pvts[chanpos]->cid_num)) ||
 					ast_exists_extension(NULL, pri->pvts[chanpos]->context, pri->pvts[chanpos]->exten, 1, pri->pvts[chanpos]->cid_num)) {
-					/* Setup law */
+					/* Select audio companding mode. */
+					switch (e->ring.layer1) {
+					case PRI_LAYER_1_ALAW:
+						law = SIG_PRI_ALAW;
+						break;
+					case PRI_LAYER_1_ULAW:
+						law = SIG_PRI_ULAW;
+						break;
+					default:
+						/* This is a data call to us. */
+						law = SIG_PRI_DEFLAW;
+						break;
+					}
+
 					if (e->ring.complete || !(pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING)) {
 						/* Just announce proceeding */
 						pri->pvts[chanpos]->call_level = SIG_PRI_CALL_LEVEL_PROCEEDING;
@@ -5988,10 +6002,8 @@
 						sig_pri_unlock_private(pri->pvts[chanpos]);
 						ast_mutex_unlock(&pri->lock);
 						c = sig_pri_new_ast_channel(pri->pvts[chanpos],
-							AST_STATE_RESERVED,
-							(e->ring.layer1 == PRI_LAYER_1_ALAW)
-								? SIG_PRI_ALAW : SIG_PRI_ULAW,
-							e->ring.ctype, pri->pvts[chanpos]->exten, NULL);
+							AST_STATE_RESERVED, law, e->ring.ctype,
+							pri->pvts[chanpos]->exten, NULL);
 						ast_mutex_lock(&pri->lock);
 						sig_pri_lock_private(pri->pvts[chanpos]);
 						if (c) {
@@ -6107,9 +6119,7 @@
 						sig_pri_unlock_private(pri->pvts[chanpos]);
 						ast_mutex_unlock(&pri->lock);
 						c = sig_pri_new_ast_channel(pri->pvts[chanpos],
-							AST_STATE_RING,
-							(e->ring.layer1 == PRI_LAYER_1_ALAW)
-								? SIG_PRI_ALAW : SIG_PRI_ULAW, e->ring.ctype,
+							AST_STATE_RING, law, e->ring.ctype,
 							pri->pvts[chanpos]->exten, NULL);
 						ast_mutex_lock(&pri->lock);
 						sig_pri_lock_private(pri->pvts[chanpos]);




More information about the asterisk-commits mailing list