[asterisk-commits] branch oej/metermaids-trunk r35234 - in /team/oej/metermaids-trunk: ./ apps/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Jun 21 01:11:52 MST 2006


Author: oej
Date: Wed Jun 21 03:11:52 2006
New Revision: 35234

URL: http://svn.digium.com/view/asterisk?rev=35234&view=rev
Log:
Forced update

Modified:
    team/oej/metermaids-trunk/   (props changed)
    team/oej/metermaids-trunk/apps/app_amd.c
    team/oej/metermaids-trunk/channels/chan_sip.c
    team/oej/metermaids-trunk/formats/format_wav_gsm.c

Propchange: team/oej/metermaids-trunk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jun 21 03:11:52 2006
@@ -1,1 +1,1 @@
-/trunk:1-35125
+/trunk:1-35209

Modified: team/oej/metermaids-trunk/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_amd.c?rev=35234&r1=35233&r2=35234&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_amd.c (original)
+++ team/oej/metermaids-trunk/apps/app_amd.c Wed Jun 21 03:11:52 2006
@@ -346,7 +346,7 @@
 	cat = ast_category_browse(cfg, NULL);
 
 	while (cat) {
-		if (!strcasecmp(cat, "amd") ) {
+		if (!strcasecmp(cat, "general") ) {
 			var = ast_variable_browse(cfg, cat);
 			while (var) {
 				if (!strcasecmp(var->name, "initial_silence")) {

Modified: team/oej/metermaids-trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/channels/chan_sip.c?rev=35234&r1=35233&r2=35234&view=diff
==============================================================================
--- team/oej/metermaids-trunk/channels/chan_sip.c (original)
+++ team/oej/metermaids-trunk/channels/chan_sip.c Wed Jun 21 03:11:52 2006
@@ -11969,6 +11969,14 @@
 	transferer = d->chan2;
 	copy_request(&req, &d->req);
 	free(d);
+
+	if (!transferee || !transferer) {
+		ast_log(LOG_ERROR, "Missing channels for parking! Transferer %s Transferee %s\n", transferer ? "<available>" : "<missing>", transferee ? "<available>" : "<missing>" );
+		return;
+	}
+	if (option_debug > 3) 
+		ast_log(LOG_DEBUG, "SIP Park: Transferer channel %s, Transferee %s\n", transferer->name, transferee->name);
+
 	ast_channel_lock(transferee);
 	if (ast_do_masquerade(transferee)) {
 		ast_log(LOG_WARNING, "Masquerade failed.\n");
@@ -11979,6 +11987,7 @@
 	ast_channel_unlock(transferee);
 
 	res = ast_park_call(transferee, transferer, 0, &ext);
+	
 
 #ifdef WHEN_WE_KNOW_THAT_THE_CLIENT_SUPPORTS_MESSAGE
 	if (!res) {
@@ -11991,9 +12000,11 @@
 #endif
 
 	/* Any way back to the current call??? */
+	/* Transmit response to the REFER request */
 	transmit_response(transferer->tech_pvt, "202 Accepted", &req);
 	if (!res)	{
 		/* Transfer succeeded */
+		append_history(transferer->tech_pvt, "SIPpark","Parked call on %d", ext);
 		transmit_notify_with_sipfrag(transferer->tech_pvt, d->seqno, "200 OK", TRUE);
 		transferer->hangupcause = AST_CAUSE_NORMAL_CLEARING;
 		ast_hangup(transferer); /* This will cause a BYE */
@@ -12001,6 +12012,7 @@
 			ast_log(LOG_DEBUG, "SIP Call parked on extension '%d'\n", ext);
 	} else {
 		transmit_notify_with_sipfrag(transferer->tech_pvt, d->seqno, "503 Service Unavailable", TRUE);
+		append_history(transferer->tech_pvt, "SIPpark","Parking failed\n");
 		if (option_debug)
 			ast_log(LOG_DEBUG, "SIP Call parked failed \n");
 		/* Do not hangup call */
@@ -12008,7 +12020,9 @@
 	return NULL;
 }
 
-/*! \brief Park a call */
+/*! \brief Park a call using the subsystem in res_features.c 
+	This is executed in a separate thread
+*/
 static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct sip_request *req, int seqno)
 {
 	struct sip_dual *d;
@@ -12034,6 +12048,8 @@
 	/* Make formats okay */
 	transferee->readformat = chan1->readformat;
 	transferee->writeformat = chan1->writeformat;
+
+	/* Prepare for taking over the channel */
 	ast_channel_masquerade(transferee, chan1);
 
 	/* Setup the extensions and such */
@@ -12048,6 +12064,8 @@
 	/* Make formats okay */
 	transferer->readformat = chan2->readformat;
 	transferer->writeformat = chan2->writeformat;
+
+	/* Prepare for taking over the channel */
 	ast_channel_masquerade(transferer, chan2);
 
 	/* Setup the extensions and such */
@@ -12064,17 +12082,25 @@
 		return -1;
 	}
 	ast_channel_unlock(transferer);
+	if (!transferer || !transferee) {
+		if (!transferer)
+			ast_log(LOG_DEBUG, "No transferer channel, giving up parking\n");
+		if (!transferee)
+			ast_log(LOG_DEBUG, "No transferee channel, giving up parking\n");
+		return -1;
+	}
 	if ((d = ast_calloc(1, sizeof(*d)))) {
 		/* Save original request for followup */
 		copy_request(&d->req, req);
 		d->chan1 = transferee;	/* Transferee */
 		d->chan2 = transferer;	/* Transferer */
 		d->seqno = seqno;
-		if (!ast_pthread_create(&th, NULL, sip_park_thread, d)) {
-			free(d);
+		if (ast_pthread_create(&th, NULL, sip_park_thread, d) < 0) {
+			/* Could not start thread */
+			free(d);	/* We don't need it anymore. If thread is created, d will be free'd
+					   by sip_park_thread() */
 			return 0;
 		}
-		free(d);
 	} 
 	return -1;
 }

Modified: team/oej/metermaids-trunk/formats/format_wav_gsm.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/formats/format_wav_gsm.c?rev=35234&r1=35233&r2=35234&view=diff
==============================================================================
--- team/oej/metermaids-trunk/formats/format_wav_gsm.c (original)
+++ team/oej/metermaids-trunk/formats/format_wav_gsm.c Wed Jun 21 03:11:52 2006
@@ -277,7 +277,7 @@
 	/* Mono = 1 channel */
 	unsigned short chans = htols(1);
 	/* Each block of data is exactly 65 bytes in size. */
-	unsigned short block_align = htols(MSGSM_FRAME_SIZE);
+	unsigned int block_align = htoll(MSGSM_FRAME_SIZE);
 	/* Not actually 2, but rounded up to the nearest bit */
 	unsigned short bits_per_sample = htols(2);
 	/* Needed for compressed formats */



More information about the asterisk-commits mailing list