[asterisk-commits] rmudgett: trunk r358262 - in /trunk: ./ channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 5 15:48:34 CST 2012


Author: rmudgett
Date: Mon Mar  5 15:48:32 2012
New Revision: 358262

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=358262
Log:
Setup DSP when SS7 call is connected or early media is available.

Outgoing SS7 calls fail to detect incoming DTMF so any bridged channel
that requires out-of-band DTMF will not work.

* Added sig_ss7_open_media() calls at appropriate places in sig_ss7.c.
The new call converts conditionaled out unconverted code and shows that
the code really did something useful.

* Improved some chan_dahdi DTMF debug messages to help track DTMF
handling.

(closes issue ASTERISK-19312)
Reported by: Igor Nikolaev
........

Merged revisions 358260 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 358261 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/channels/chan_dahdi.c
    trunk/channels/sig_ss7.c
    trunk/channels/sig_ss7.h

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

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=358262&r1=358261&r2=358262
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Mon Mar  5 15:48:32 2012
@@ -2637,17 +2637,17 @@
 
 static int set_actual_gain(int fd, float rxgain, float txgain, float rxdrc, float txdrc, int law);
 
-#if defined(HAVE_PRI)
+#if defined(HAVE_PRI) || defined(HAVE_SS7)
 /*!
  * \internal
- * \brief Open the PRI channel media path.
+ * \brief Open the PRI/SS7 channel media path.
  * \since 1.8
  *
  * \param p Channel private control structure.
  *
  * \return Nothing
  */
-static void my_pri_open_media(void *p)
+static void my_pri_ss7_open_media(void *p)
 {
 	struct dahdi_pvt *pvt = p;
 	int res;
@@ -2686,7 +2686,7 @@
 		pvt->dsp_features = 0;
 	}
 }
-#endif	/* defined(HAVE_PRI) */
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 
 #if defined(HAVE_PRI)
 /*!
@@ -3422,7 +3422,7 @@
 	.module_ref = my_module_ref,
 	.module_unref = my_module_unref,
 	.dial_digits = my_pri_dial_digits,
-	.open_media = my_pri_open_media,
+	.open_media = my_pri_ss7_open_media,
 	.ami_channel_event = my_ami_channel_event,
 };
 #endif	/* defined(HAVE_PRI) */
@@ -3586,6 +3586,7 @@
 	.set_remotelyblocked = my_set_remotelyblocked,
 	.set_callerid = my_set_callerid,
 	.set_dnid = my_set_dnid,
+	.open_media = my_pri_ss7_open_media,
 };
 #endif	/* defined(HAVE_SS7) */
 
@@ -4500,11 +4501,13 @@
 		zo.dialstr[1] = digit;
 		zo.dialstr[2] = '\0';
 		if ((res = ioctl(pvt->subs[SUB_REAL].dfd, DAHDI_DIAL, &zo)))
-			ast_log(LOG_WARNING, "Couldn't dial digit %c: %s\n", digit, strerror(errno));
+			ast_log(LOG_WARNING, "Channel %s couldn't dial digit %c: %s\n",
+				ast_channel_name(chan), digit, strerror(errno));
 		else
 			pvt->dialing = 1;
 	} else {
-		ast_debug(1, "Started VLDTMF digit '%c'\n", digit);
+		ast_debug(1, "Channel %s started VLDTMF digit '%c'\n",
+			ast_channel_name(chan), digit);
 		pvt->dialing = 1;
 		pvt->begindigit = digit;
 	}
@@ -4540,7 +4543,8 @@
 
 	if (pvt->begindigit) {
 		x = -1;
-		ast_debug(1, "Ending VLDTMF digit '%c'\n", digit);
+		ast_debug(1, "Channel %s ending VLDTMF digit '%c'\n",
+			ast_channel_name(chan), digit);
 		res = ioctl(pvt->subs[SUB_REAL].dfd, DAHDI_SENDTONE, &x);
 		pvt->dialing = 0;
 		pvt->begindigit = 0;

Modified: trunk/channels/sig_ss7.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_ss7.c?view=diff&rev=358262&r1=358261&r2=358262
==============================================================================
--- trunk/channels/sig_ss7.c (original)
+++ trunk/channels/sig_ss7.c Mon Mar  5 15:48:32 2012
@@ -153,6 +153,22 @@
 
 /*!
  * \internal
+ * \brief Open the SS7 channel media path.
+ * \since 1.8.12
+ *
+ * \param p Channel private control structure.
+ *
+ * \return Nothing
+ */
+static void sig_ss7_open_media(struct sig_ss7_chan *p)
+{
+	if (p->calls->open_media) {
+		p->calls->open_media(p->chan_pvt);
+	}
+}
+
+/*!
+ * \internal
  * \brief Set the caller id information in the parent module.
  * \since 1.8
  *
@@ -807,12 +823,7 @@
 						sig_ss7_queue_control(linkset, chanpos, AST_CONTROL_PROGRESS);
 						p->progress = 1;
 						sig_ss7_set_dialing(p, 0);
-#if 0	/* This code no longer seems to be necessary so I did not convert it. */
-						if (p->dsp && p->dsp_features) {
-							ast_dsp_set_features(p->dsp, p->dsp_features);
-							p->dsp_features = 0;
-						}
-#endif
+						sig_ss7_open_media(p);
 					}
 					break;
 				default:
@@ -1184,12 +1195,8 @@
 						p->call_level = SIG_SS7_CALL_LEVEL_CONNECT;
 					}
 					sig_ss7_queue_control(linkset, chanpos, AST_CONTROL_ANSWER);
-#if 0	/* This code no longer seems to be necessary so I did not convert it. */
-					if (p->dsp && p->dsp_features) {
-						ast_dsp_set_features(p->dsp, p->dsp_features);
-						p->dsp_features = 0;
-					}
-#endif
+					sig_ss7_set_dialing(p, 0);
+					sig_ss7_open_media(p);
 					sig_ss7_set_echocanceller(p, 1);
 					sig_ss7_unlock_private(p);
 				}
@@ -1622,6 +1629,7 @@
 	if (p->call_level < SIG_SS7_CALL_LEVEL_CONNECT) {
 		p->call_level = SIG_SS7_CALL_LEVEL_CONNECT;
 	}
+	sig_ss7_open_media(p);
 	res = isup_anm(p->ss7->ss7, p->ss7call);
 	ss7_rel(p->ss7);
 	return res;

Modified: trunk/channels/sig_ss7.h
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_ss7.h?view=diff&rev=358262&r1=358261&r2=358262
==============================================================================
--- trunk/channels/sig_ss7.h (original)
+++ trunk/channels/sig_ss7.h Mon Mar  5 15:48:32 2012
@@ -150,6 +150,7 @@
 	void (* const set_dnid)(void *pvt, const char *dnid);
 
 	void (* const queue_control)(void *pvt, int subclass);
+	void (* const open_media)(void *pvt);
 };
 
 struct sig_ss7_chan {




More information about the asterisk-commits mailing list