[asterisk-commits] phsultan: branch phsultan/jabberreceive r209396 - in /team/phsultan/jabberrec...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 28 07:22:35 CDT 2009


Author: phsultan
Date: Tue Jul 28 07:22:30 2009
New Revision: 209396

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=209396
Log:
Merged revisions 209098,209132,209197,209235,209256,209279,209317,209331 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r209098 | dbrooks | 2009-07-27 18:33:50 +0200 (Mon, 27 Jul 2009) | 6 lines

Fixing typos. Replaces "recieved" with "received" and "initilize" with "initialize"

(closes issue #15571)
Reported by: alecdavis


................
r209132 | mmichelson | 2009-07-27 19:50:04 +0200 (Mon, 27 Jul 2009) | 24 lines

Merged revisions 209131 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r209131 | mmichelson | 2009-07-27 12:44:06 -0500 (Mon, 27 Jul 2009) | 18 lines
  
  Allow for UDPTL to use only even-numbered ports if desired.
  
  There are some VoIP providers out there that will not accept SDP
  offers with odd numbered UDPTL ports. While it is my personal opinion
  that these VoIP providers are misinterpreting RFC 2327, it really is
  not a big deal to play along with their silly little games. Of course,
  since restricting UDPTL ports to only even numbers reduces the range
  of available ports by half, so the option to use only even port numbers
  is off by default. A user can enable the behavior by setting
  use_even_ports=yes in udptl.conf.
  
  (closes issue #15182)
  Reported by: CGMChris
  Patches:
        15182.patch uploaded by mmichelson (license 60)
  Tested by: CGMChris
........

................
r209197 | mmichelson | 2009-07-27 22:11:42 +0200 (Mon, 27 Jul 2009) | 9 lines

Honor channel's music class when using realtime music on hold.

(closes issue #15051)
Reported by: alexh
Patches:
      15051.patch uploaded by mmichelson (license 60)
Tested by: alexh


................
r209235 | mmichelson | 2009-07-27 22:54:54 +0200 (Mon, 27 Jul 2009) | 5 lines

Gracefully handle malformed RTP text packets.

AST-2009-004


................
r209256 | kpfleming | 2009-07-27 23:21:43 +0200 (Mon, 27 Jul 2009) | 10 lines

Make T.38 switchover in ReceiveFAX synchronous.

In receive mode, if the channel that ReceiveFAX is running on supports T.38,
we should *always* attempt to switch T.38, rather than listening for an incoming
CNG tone and only triggering on that. The channel may be using a low-bitrate
codec that distorts the CNG tone, the sending FAX endpoint may not send CNG
at all, or there could be a variety of other reasons that we don't detect it,
but in all those cases if T.38 is available we certainly want to use it.


................
r209279 | kpfleming | 2009-07-27 23:43:36 +0200 (Mon, 27 Jul 2009) | 7 lines

Cleanup T.38 negotiation changes.

Convert LOG_NOTICE messages about T.38 negotiation in debug level 1 messages,
clean up some looping logic, and correct an improper use of ast_free() for 
freeing an ast_frame.


................
r209317 | tilghman | 2009-07-28 02:14:12 +0200 (Tue, 28 Jul 2009) | 9 lines

Merged revisions 209315 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r209315 | tilghman | 2009-07-27 19:12:03 -0500 (Mon, 27 Jul 2009) | 2 lines
  
  Publish French extra sounds
........

................
r209331 | tilghman | 2009-07-28 02:20:26 +0200 (Tue, 28 Jul 2009) | 2 lines

Regex FTL

................

Modified:
    team/phsultan/jabberreceive/   (props changed)
    team/phsultan/jabberreceive/addons/chan_mobile.c
    team/phsultan/jabberreceive/apps/app_fax.c
    team/phsultan/jabberreceive/apps/app_rpt.c
    team/phsultan/jabberreceive/channels/chan_dahdi.c
    team/phsultan/jabberreceive/channels/chan_vpb.cc
    team/phsultan/jabberreceive/configs/udptl.conf.sample
    team/phsultan/jabberreceive/include/asterisk/module.h
    team/phsultan/jabberreceive/main/features.c
    team/phsultan/jabberreceive/main/loader.c
    team/phsultan/jabberreceive/main/udptl.c
    team/phsultan/jabberreceive/pbx/pbx_dundi.c
    team/phsultan/jabberreceive/res/res_jabber.c
    team/phsultan/jabberreceive/res/res_musiconhold.c
    team/phsultan/jabberreceive/res/res_rtp_asterisk.c
    team/phsultan/jabberreceive/res/res_smdi.c
    team/phsultan/jabberreceive/sounds/sounds.xml

Propchange: team/phsultan/jabberreceive/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/phsultan/jabberreceive/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jul 28 07:22:30 2009
@@ -1,1 +1,1 @@
-/trunk:1-209090
+/trunk:1-209394

Modified: team/phsultan/jabberreceive/addons/chan_mobile.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/addons/chan_mobile.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/addons/chan_mobile.c (original)
+++ team/phsultan/jabberreceive/addons/chan_mobile.c Tue Jul 28 07:22:30 2009
@@ -146,7 +146,7 @@
 	unsigned int needcallerid:1;	/*!< we need callerid */
 	unsigned int needchup:1;	/*!< we need to send a chup */
 	unsigned int needring:1;	/*!< we need to send a RING */
-	unsigned int answered:1;	/*!< we sent/recieved an answer */
+	unsigned int answered:1;	/*!< we sent/received an answer */
 	unsigned int connected:1;	/*!< do we have an rfcomm connection to a device */
 
 	AST_LIST_ENTRY(mbl_pvt) entry;
@@ -2571,7 +2571,7 @@
 /*!
  * \brief Add an item to the back of the queue.
  * \param pvt a mbl_pvt structure
- * \param expect the msg we expect to recieve
+ * \param expect the msg we expect to receive
  * \param response_to the message that was sent to generate the expected
  * response
  */
@@ -2591,7 +2591,7 @@
 /*!
  * \brief Add an item to the back of the queue with data.
  * \param pvt a mbl_pvt structure
- * \param expect the msg we expect to recieve
+ * \param expect the msg we expect to receive
  * \param response_to the message that was sent to generate the expected
  * response
  * \param data data associated with this message, it will be freed when the
@@ -2803,9 +2803,9 @@
 
 		msg_queue_free_and_pop(pvt);
 	} else if (entry) {
-		ast_debug(1, "[%s] recieved unexpected AT message 'BRSF' when expecting %s, ignoring\n", pvt->id, at_msg2str(entry->expected));
+		ast_debug(1, "[%s] received unexpected AT message 'BRSF' when expecting %s, ignoring\n", pvt->id, at_msg2str(entry->expected));
 	} else {
-		ast_debug(1, "[%s] recieved unexpected AT message 'BRSF'\n", pvt->id);
+		ast_debug(1, "[%s] received unexpected AT message 'BRSF'\n", pvt->id);
 	}
 
 	return 0;
@@ -2845,9 +2845,9 @@
 		}
 		msg_queue_free_and_pop(pvt);
 	} else if (entry) {
-		ast_debug(1, "[%s] recieved unexpected AT message 'CIND' when expecting %s, ignoring\n", pvt->id, at_msg2str(entry->expected));
+		ast_debug(1, "[%s] received unexpected AT message 'CIND' when expecting %s, ignoring\n", pvt->id, at_msg2str(entry->expected));
 	} else {
-		ast_debug(1, "[%s] recieved unexpected AT message 'CIND'\n", pvt->id);
+		ast_debug(1, "[%s] received unexpected AT message 'CIND'\n", pvt->id);
 	}
 
 	return 0;
@@ -2870,7 +2870,7 @@
 	if ((entry = msg_queue_head(pvt)) && entry->expected == AT_OK) {
 		switch (entry->response_to) {
 
-		/* initilization stuff */
+		/* initialization stuff */
 		case AT_BRSF:
 			ast_debug(1, "[%s] BSRF sent successfully\n", pvt->id);
 
@@ -2972,7 +2972,7 @@
 			ast_debug(1, "[%s] sms new message indication enabled\n", pvt->id);
 			pvt->has_sms = 1;
 			break;
-		/* end initilization stuff */
+		/* end initialization stuff */
 
 		case AT_A:
 			ast_debug(1, "[%s] answer sent successfully\n", pvt->id);
@@ -3000,14 +3000,14 @@
 			break;
 		case AT_UNKNOWN:
 		default:
-			ast_debug(1, "[%s] recieved OK for unhandled request: %s\n", pvt->id, at_msg2str(entry->response_to));
+			ast_debug(1, "[%s] received OK for unhandled request: %s\n", pvt->id, at_msg2str(entry->response_to));
 			break;
 		}
 		msg_queue_free_and_pop(pvt);
 	} else if (entry) {
-		ast_debug(1, "[%s] recieved AT message 'OK' when expecting %s, ignoring\n", pvt->id, at_msg2str(entry->expected));
+		ast_debug(1, "[%s] received AT message 'OK' when expecting %s, ignoring\n", pvt->id, at_msg2str(entry->expected));
 	} else {
-		ast_debug(1, "[%s] recieved unexpected AT message 'OK'\n", pvt->id);
+		ast_debug(1, "[%s] received unexpected AT message 'OK'\n", pvt->id);
 	}
 	return 0;
 
@@ -3034,7 +3034,7 @@
 			|| entry->expected == AT_SMS_PROMPT)) {
 		switch (entry->response_to) {
 
-		/* initilization stuff */
+		/* initialization stuff */
 		case AT_BRSF:
 			ast_debug(1, "[%s] error reading BSRF\n", pvt->id);
 			goto e_return;
@@ -3053,7 +3053,7 @@
 		case AT_VGS:
 			ast_debug(1, "[%s] volume level synchronization failed\n", pvt->id);
 
-			/* this is not a fatal error, let's continue with initilization */
+			/* this is not a fatal error, let's continue with initialization */
 
 			/* set the SMS operating mode to text mode */
 			if (hfp_send_cmgf(pvt->hfp, 1) || msg_queue_push(pvt, AT_OK, AT_CMGF)) {
@@ -3069,7 +3069,7 @@
 			ast_debug(1, "[%s] error setting CNMI\n", pvt->id);
 			ast_debug(1, "[%s] no SMS support\n", pvt->id);
 			break;
-		/* end initilization stuff */
+		/* end initialization stuff */
 
 		case AT_A:
 			ast_debug(1, "[%s] answer failed\n", pvt->id);
@@ -3096,14 +3096,14 @@
 			break;
 		case AT_UNKNOWN:
 		default:
-			ast_debug(1, "[%s] recieved ERROR for unhandled request: %s\n", pvt->id, at_msg2str(entry->response_to));
+			ast_debug(1, "[%s] received ERROR for unhandled request: %s\n", pvt->id, at_msg2str(entry->response_to));
 			break;
 		}
 		msg_queue_free_and_pop(pvt);
 	} else if (entry) {
-		ast_debug(1, "[%s] recieved AT message 'ERROR' when expecting %s, ignoring\n", pvt->id, at_msg2str(entry->expected));
+		ast_debug(1, "[%s] received AT message 'ERROR' when expecting %s, ignoring\n", pvt->id, at_msg2str(entry->expected));
 	} else {
-		ast_debug(1, "[%s] recieved unexpected AT message 'ERROR'\n", pvt->id);
+		ast_debug(1, "[%s] received unexpected AT message 'ERROR'\n", pvt->id);
 	}
 
 	return 0;
@@ -3371,13 +3371,13 @@
 	at_message_t at_msg;
 	struct msg_queue_entry *entry;
 
-	/* Note: At one point the initilization procedure was neatly contained
-	 * in the hfp_init() function, but that initilization method did not
-	 * work with non standard devices.  As a result, the initilization
+	/* Note: At one point the initialization procedure was neatly contained
+	 * in the hfp_init() function, but that initialization method did not
+	 * work with non standard devices.  As a result, the initialization
 	 * procedure is not spread throughout the event handling loop.
 	 */
 
-	/* start initilization with the BRSF request */
+	/* start initialization with the BRSF request */
 	ast_mutex_lock(&pvt->lock);
 	pvt->timeout = 10000;
 	if (hfp_send_brsf(hfp, &hfp_our_brsf)  || msg_queue_push(pvt, AT_BRSF, AT_BRSF)) {
@@ -3758,7 +3758,7 @@
 								pvt->connected = 1;
 								adapter->inuse = 1;
 								manager_event(EVENT_FLAG_SYSTEM, "MobileStatus", "Status: Connect\r\nDevice: %s\r\n", pvt->id);
-								ast_verb(3, "Bluetooth Device %s has connected, initilizing...\n", pvt->id);
+								ast_verb(3, "Bluetooth Device %s has connected, initializing...\n", pvt->id);
 							}
 						}
 					}

Modified: team/phsultan/jabberreceive/apps/app_fax.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/apps/app_fax.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/apps/app_fax.c (original)
+++ team/phsultan/jabberreceive/apps/app_fax.c Tue Jul 28 07:22:30 2009
@@ -366,12 +366,82 @@
 	int original_write_fmt = AST_FORMAT_SLINEAR;
 	fax_state_t fax;
 	t30_state_t *t30state;
-	struct ast_dsp *dsp = NULL;
-	int detect_tone = 0;
 	struct ast_frame *inf = NULL;
-	struct ast_frame *fr;
 	int last_state = 0;
 	struct timeval now, start, state_change;
+	enum ast_t38_state t38_state;
+	struct ast_control_t38_parameters t38_parameters = { .version = 0,
+							     .max_ifp = 800,
+							     .rate = AST_T38_RATE_9600,
+							     .rate_management = AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF,
+							     .fill_bit_removal = 1,
+							     .transcoding_mmr = 1,
+							     .transcoding_jbig = 1,
+	};
+
+	/* if in receive mode, try to use T.38 */
+	if (!s->direction) {
+		/* check if we are already in T.38 mode (unlikely), or if we can request
+		 * a switch... if so, request it now and wait for the result, rather
+		 * than starting an audio FAX session that will have to be cancelled
+		 */
+		if ((t38_state = ast_channel_get_t38_state(s->chan)) == T38_STATE_NEGOTIATED) {
+			return 1;
+		} else if ((t38_state != T38_STATE_UNAVAILABLE) &&
+			   (t38_parameters.request_response = AST_T38_REQUEST_NEGOTIATE,
+			    (ast_indicate_data(s->chan, AST_CONTROL_T38_PARAMETERS, &t38_parameters, sizeof(t38_parameters)) == 0))) {
+			/* wait up to five seconds for negotiation to complete */
+			unsigned int timeout = 5000;
+			int ms;
+			
+			ast_debug(1, "Negotiating T.38 for receive on %s\n", s->chan->name);
+			while (timeout > 0) {
+				ms = ast_waitfor(s->chan, 1000);
+				if (ms < 0) {
+					ast_log(LOG_WARNING, "something bad happened while channel '%s' was polling.\n", s->chan->name);
+					return -1;
+				}
+				if (!ms) {
+					/* nothing happened */
+					if (timeout > 0) {
+						timeout -= 1000;
+						continue;
+					} else {
+						ast_log(LOG_WARNING, "channel '%s' timed-out during the T.38 negotiation.\n", s->chan->name);
+						break;
+					}
+				}
+				if (!(inf = ast_read(s->chan))) {
+					return -1;
+				}
+				if ((inf->frametype == AST_FRAME_CONTROL) &&
+				    (inf->subclass == AST_CONTROL_T38_PARAMETERS) &&
+				    (inf->datalen == sizeof(t38_parameters))) {
+					struct ast_control_t38_parameters *parameters = inf->data.ptr;
+					
+					switch (parameters->request_response) {
+					case AST_T38_NEGOTIATED:
+						ast_debug(1, "Negotiated T.38 for receive on %s\n", s->chan->name);
+						res = 1;
+						break;
+					case AST_T38_REFUSED:
+						ast_log(LOG_WARNING, "channel '%s' refused to negotiate T.38\n", s->chan->name);
+						break;
+					default:
+						ast_log(LOG_ERROR, "channel '%s' failed to negotiate T.38\n", s->chan->name);
+						break;
+					}
+					ast_frfree(inf);
+					if (res == 1) {
+						return 1;
+					} else {
+						break;
+					}
+				}
+				ast_frfree(inf);
+			}
+		}
+	}
 
 #if SPANDSP_RELEASE_DATE >= 20080725
         /* for spandsp shaphots 0.0.6 and higher */
@@ -414,18 +484,6 @@
 	fax_set_transmit_on_idle(&fax, TRUE);
 
 	t30_set_phase_e_handler(t30state, phase_e_handler, s);
-
-	if (s->t38state == T38_STATE_UNAVAILABLE) {
-		ast_debug(1, "T38 is unavailable on %s\n", s->chan->name);
-	} else if (!s->direction) {
-		/* We are receiving side and this means we are the side which should
-		   request T38 when the fax is detected. Use DSP to detect fax tone */
-		ast_debug(1, "Setting up CNG detection on %s\n", s->chan->name);
-		dsp = ast_dsp_new();
-		ast_dsp_set_features(dsp, DSP_FEATURE_FAX_DETECT);
-		ast_dsp_set_faxmode(dsp, DSP_FAXMODE_DETECT_CNG);
-		detect_tone = 1;
-	}
 
 	start = state_change = ast_tvnow();
 
@@ -460,32 +518,6 @@
 		}
 
 		ast_debug(10, "frame %d/%d, len=%d\n", inf->frametype, inf->subclass, inf->datalen);
-
-		/* Detect fax tone */
-		if (detect_tone && inf->frametype == AST_FRAME_VOICE) {
-			/* Duplicate frame because ast_dsp_process may free the frame passed */
-			fr = ast_frdup(inf);
-
-			/* Do not pass channel to ast_dsp_process otherwise it may queue modified audio frame back */
-			fr = ast_dsp_process(NULL, dsp, fr);
-			if (fr && fr->frametype == AST_FRAME_DTMF && fr->subclass == 'f') {
-				struct ast_control_t38_parameters parameters = { .request_response = AST_T38_REQUEST_NEGOTIATE,
-										 .version = 0,
-										 .max_ifp = 800,
-										 .rate = AST_T38_RATE_9600,
-										 .rate_management = AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF,
-										 .fill_bit_removal = 1,
-										 .transcoding_mmr = 1,
-										 .transcoding_jbig = 1,
-				};
-				ast_debug(1, "Fax tone detected. Requesting T38\n");
-				ast_indicate_data(s->chan, AST_CONTROL_T38_PARAMETERS, &parameters, sizeof(parameters));
-				detect_tone = 0;
-			}
-
-			ast_frfree(fr);
-		}
-
 
 		/* Check the frame type. Format also must be checked because there is a chance
 		   that a frame in old format was already queued before we set channel format
@@ -501,8 +533,10 @@
 				state_change = ast_tvnow();
 				last_state = t30state->state;
 			}
-		} else if (inf->frametype == AST_FRAME_CONTROL && inf->subclass == AST_CONTROL_T38_PARAMETERS) {
+		} else if ((inf->frametype == AST_FRAME_CONTROL) &&
+			   (inf->subclass == AST_CONTROL_T38_PARAMETERS)) {
 			struct ast_control_t38_parameters *parameters = inf->data.ptr;
+
 			if (parameters->request_response == AST_T38_NEGOTIATED) {
 				/* T38 switchover completed */
 				s->t38parameters = *parameters;
@@ -510,20 +544,13 @@
 				res = 1;
 				break;
 			} else if (parameters->request_response == AST_T38_REQUEST_NEGOTIATE) {
-				struct ast_control_t38_parameters our_parameters = { .request_response = AST_T38_NEGOTIATED,
-										     .version = 0,
-										     .max_ifp = 800,
-										     .rate = AST_T38_RATE_9600,
-										     .rate_management = AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF,
-										     .fill_bit_removal = 1,
-										     .transcoding_mmr = 1,
-										     .transcoding_jbig = 1,
-				};
+				t38_parameters.request_response = AST_T38_NEGOTIATED;
 				ast_debug(1, "T38 request received, accepting\n");
 				/* Complete T38 switchover */
-				ast_indicate_data(s->chan, AST_CONTROL_T38_PARAMETERS, &our_parameters, sizeof(our_parameters));
+				ast_indicate_data(s->chan, AST_CONTROL_T38_PARAMETERS, &t38_parameters, sizeof(t38_parameters));
 				/* Do not break audio loop, wait until channel driver finally acks switchover
-				   with AST_T38_NEGOTIATED */
+				 * with AST_T38_NEGOTIATED
+				 */
 			}
 		}
 
@@ -534,9 +561,6 @@
 
 	if (inf)
 		ast_frfree(inf);
-
-	if (dsp)
-		ast_dsp_free(dsp);
 
 	ast_deactivate_generator(s->chan);
 

Modified: team/phsultan/jabberreceive/apps/app_rpt.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/apps/app_rpt.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/apps/app_rpt.c (original)
+++ team/phsultan/jabberreceive/apps/app_rpt.c Tue Jul 28 07:22:30 2009
@@ -6712,7 +6712,7 @@
 		strcpy(mylink->linklist,tmp + 2);
 		time(&mylink->linklistreceived);
 		rpt_mutex_unlock(&myrpt->lock);
-		if (debug > 6) ast_log(LOG_NOTICE,"@@@@ node %s recieved node list %s from node %s\n",
+		if (debug > 6) ast_log(LOG_NOTICE,"@@@@ node %s received node list %s from node %s\n",
 			myrpt->name,tmp,mylink->name);
 		return;
 	}

Modified: team/phsultan/jabberreceive/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/channels/chan_dahdi.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/channels/chan_dahdi.c (original)
+++ team/phsultan/jabberreceive/channels/chan_dahdi.c Tue Jul 28 07:22:30 2009
@@ -6422,13 +6422,13 @@
 	case DAHDI_EVENT_BITSCHANGED:
 #ifdef HAVE_OPENR2
 		if (p->sig != SIG_MFCR2) {
-			ast_log(LOG_WARNING, "Recieved bits changed on %s signalling?\n", sig2str(p->sig));
+			ast_log(LOG_WARNING, "Received bits changed on %s signalling?\n", sig2str(p->sig));
 		} else {
 			ast_log(LOG_DEBUG, "bits changed in chan %d\n", p->channel);
 			openr2_chan_handle_cas(p->r2chan);
 		}
 #else
-		ast_log(LOG_WARNING, "Recieved bits changed on %s signalling?\n", sig2str(p->sig));
+		ast_log(LOG_WARNING, "Received bits changed on %s signalling?\n", sig2str(p->sig));
 #endif
 	case DAHDI_EVENT_PULSE_START:
 		/* Stop tone if there's a pulse start and the PBX isn't started */
@@ -8751,7 +8751,7 @@
 				else if (smdi_msg->type == 'N')
 					pbx_builtin_setvar_helper(chan, "_SMDI_VM_TYPE", "u");
 
-				ast_debug(1, "Recieved SMDI message on %s\n", chan->name);
+				ast_debug(1, "Received SMDI message on %s\n", chan->name);
 			} else {
 				ast_log(LOG_WARNING, "SMDI enabled but no SMDI message present\n");
 			}

Modified: team/phsultan/jabberreceive/channels/chan_vpb.cc
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/channels/chan_vpb.cc?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/channels/chan_vpb.cc (original)
+++ team/phsultan/jabberreceive/channels/chan_vpb.cc Tue Jul 28 07:22:30 2009
@@ -1509,7 +1509,7 @@
 	tmp->callgroup = callgroup;
 	tmp->pickupgroup = pickupgroup;
 
-	/* Initilize dtmf caller ID position variable */
+	/* Initialize dtmf caller ID position variable */
 	tmp->dtmf_caller_pos = 0;
 
 	ast_copy_string(tmp->language, language, sizeof(tmp->language));

Modified: team/phsultan/jabberreceive/configs/udptl.conf.sample
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/configs/udptl.conf.sample?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/configs/udptl.conf.sample (original)
+++ team/phsultan/jabberreceive/configs/udptl.conf.sample Tue Jul 28 07:22:30 2009
@@ -28,3 +28,8 @@
 ; The span over which parity is calculated for FEC in a UDPTL packet
 ;
 udptlfecspan = 3
+;
+; Some VoIP providers will only accept an offer with an even-numbered
+; UDPTL port. Set this option so that Asterisk will only attempt to use
+; even-numbered ports when negotiating T.38. Default is no.
+use_even_ports = no

Modified: team/phsultan/jabberreceive/include/asterisk/module.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/include/asterisk/module.h?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/include/asterisk/module.h (original)
+++ team/phsultan/jabberreceive/include/asterisk/module.h Tue Jul 28 07:22:30 2009
@@ -70,7 +70,7 @@
  * \param resource_name The name of the module to load.
  *
  * This function is run by the PBX to load the modules.  It performs
- * all loading and initilization tasks.   Basically, to load a module, just
+ * all loading and initialization tasks.   Basically, to load a module, just
  * give it the name of the module and it will do the rest.
  *
  * \return See possible enum values for ast_module_load_result.

Modified: team/phsultan/jabberreceive/main/features.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/main/features.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/main/features.c (original)
+++ team/phsultan/jabberreceive/main/features.c Tue Jul 28 07:22:30 2009
@@ -1363,7 +1363,7 @@
 		if (!transferer->cdr) { /* this code should never get called (in a perfect world) */
 			transferer->cdr=ast_cdr_alloc();
 			if (transferer->cdr) {
-				ast_cdr_init(transferer->cdr, transferer); /* initilize our channel's cdr */
+				ast_cdr_init(transferer->cdr, transferer); /* initialize our channel's cdr */
 				ast_cdr_start(transferer->cdr);
 			}
 		}

Modified: team/phsultan/jabberreceive/main/loader.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/main/loader.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/main/loader.c (original)
+++ team/phsultan/jabberreceive/main/loader.c Tue Jul 28 07:22:30 2009
@@ -756,7 +756,7 @@
  *
  *  If the ast_heap is provided (not NULL) the module is found and added to the
  *  heap without running the module's load() function.  By doing this, modules
- *  added to the resource_heap can be initilized later in order by priority. 
+ *  added to the resource_heap can be initialized later in order by priority. 
  *
  *  If the ast_heap is not provided, the module's load function will be executed
  *  immediately */

Modified: team/phsultan/jabberreceive/main/udptl.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/main/udptl.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/main/udptl.c (original)
+++ team/phsultan/jabberreceive/main/udptl.c Tue Jul 28 07:22:30 2009
@@ -85,6 +85,7 @@
 static int udptlfecentries;
 static int udptlfecspan;
 static int udptlmaxdatagram;
+static int use_even_ports;
 
 #define LOCAL_FAX_MAX_DATAGRAM      1400
 #define MAX_FEC_ENTRIES             5
@@ -889,6 +890,9 @@
 #endif
 	/* Find us a place */
 	x = (udptlstart == udptlend) ? udptlstart : (ast_random() % (udptlend - udptlstart)) + udptlstart;
+	if (use_even_ports && (x & 1)) {
+		++x;
+	}
 	startplace = x;
 	for (;;) {
 		udptl->us.sin_port = htons(x);
@@ -901,7 +905,12 @@
 			ast_free(udptl);
 			return NULL;
 		}
-		if (++x > udptlend)
+		if (use_even_ports) {
+			x += 2;
+		} else {
+			++x;
+		}
+		if (x > udptlend)
 			x = udptlstart;
 		if (x == startplace) {
 			ast_log(LOG_WARNING, "No UDPTL ports remaining\n");
@@ -1258,6 +1267,7 @@
 	udptlfecentries = 0;
 	udptlfecspan = 0;
 	udptlmaxdatagram = 0;
+	use_even_ports = 0;
 
 	if (cfg) {
 		if ((s = ast_variable_retrieve(cfg, "general", "udptlstart"))) {
@@ -1332,6 +1342,9 @@
 				udptlfecspan = MAX_FEC_SPAN;
 			}
 		}
+		if ((s = ast_variable_retrieve(cfg, "general", "use_even_ports"))) {
+			use_even_ports = ast_true(s);
+		}
 		ast_config_destroy(cfg);
 	}
 	if (udptlstart >= udptlend) {
@@ -1339,6 +1352,14 @@
 		udptlstart = 4500;
 		udptlend = 4999;
 	}
+	if (use_even_ports && (udptlstart & 1)) {
+		++udptlstart;
+		ast_log(LOG_NOTICE, "Odd numbered udptlstart specified but use_even_ports enabled. udptlstart is now %d\n", udptlstart);
+	}
+	if (use_even_ports && (udptlend & 1)) {
+		--udptlend;
+		ast_log(LOG_NOTICE, "Odd numbered udptlend specified but use_event_ports enabled. udptlend is now %d\n", udptlend);
+	}
 	ast_verb(2, "UDPTL allocating from port range %d -> %d\n", udptlstart, udptlend);
 }
 

Modified: team/phsultan/jabberreceive/pbx/pbx_dundi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/pbx/pbx_dundi.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/pbx/pbx_dundi.c (original)
+++ team/phsultan/jabberreceive/pbx/pbx_dundi.c Tue Jul 28 07:22:30 2009
@@ -1885,7 +1885,7 @@
 		break;
 	default:
 		/* Send unknown command if we don't know it, with final flag IFF it's the
-		   first command in the dialog and only if we haven't recieved final notification */
+		   first command in the dialog and only if we haven't received final notification */
 		if (!final) {
 			dundi_ie_append_byte(ied, DUNDI_IE_UNKNOWN, cmd);
 			dundi_send(trans, DUNDI_COMMAND_UNKNOWN, 0, !hdr->oseqno, ied);

Modified: team/phsultan/jabberreceive/res/res_jabber.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/res/res_jabber.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/res/res_jabber.c (original)
+++ team/phsultan/jabberreceive/res/res_jabber.c Tue Jul 28 07:22:30 2009
@@ -1749,7 +1749,7 @@
 
 	resource = aji_find_resource(buddy, pak->from->resource);
 	if (pak->subtype == IKS_TYPE_ERROR) {
-		ast_log(LOG_WARNING, "Recieved error from a client, turn on jabber debug!\n");
+		ast_log(LOG_WARNING, "Received error from a client, turn on jabber debug!\n");
 		return IKS_FILTER_EAT;
 	}
 	if (pak->subtype == IKS_TYPE_RESULT) {

Modified: team/phsultan/jabberreceive/res/res_musiconhold.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/res/res_musiconhold.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/res/res_musiconhold.c (original)
+++ team/phsultan/jabberreceive/res/res_musiconhold.c Tue Jul 28 07:22:30 2009
@@ -1166,7 +1166,9 @@
 {
 	struct mohclass *mohclass = NULL;
 	struct moh_files_state *state = chan->music_state;
+	struct ast_variable *var = NULL;
 	int res;
+	int realtime_possible = ast_check_realtime("musiconhold");
 
 	/* The following is the order of preference for which class to use:
 	 * 1) The channels explicitly set musicclass, which should *only* be
@@ -1181,28 +1183,37 @@
 	 */
 	if (!ast_strlen_zero(chan->musicclass)) {
 		mohclass = get_mohbyname(chan->musicclass, 1);
-	}
-	if (!mohclass && !ast_strlen_zero(mclass)) {
+		if (!mohclass && realtime_possible) {
+			var = ast_load_realtime("musiconhold", "name", chan->musicclass, SENTINEL);
+		}
+	}
+	if (!mohclass && !var && !ast_strlen_zero(mclass)) {
 		mohclass = get_mohbyname(mclass, 1);
-	}
-	if (!mohclass && !ast_strlen_zero(interpclass)) {
+		if (!mohclass && realtime_possible) {
+			var = ast_load_realtime("musiconhold", "name", mclass, SENTINEL);
+		}
+	}
+	if (!mohclass && !var && !ast_strlen_zero(interpclass)) {
 		mohclass = get_mohbyname(interpclass, 1);
-	}
-
-	/* If no moh class found in memory, then check RT */
-	if (!mohclass && ast_check_realtime("musiconhold")) {
-		struct ast_variable *var = NULL, *tmp = NULL;
-
-		if (!ast_strlen_zero(chan->musicclass)) {
-			var = ast_load_realtime("musiconhold", "name", chan->musicclass, SENTINEL);
-		}
-		if (!var && !ast_strlen_zero(mclass))
-			var = ast_load_realtime("musiconhold", "name", mclass, SENTINEL);
-		if (!var && !ast_strlen_zero(interpclass))
+		if (!mohclass && realtime_possible) {
 			var = ast_load_realtime("musiconhold", "name", interpclass, SENTINEL);
-		if (!var)
+		}
+	}
+
+	if (!mohclass && !var) {
+		mohclass = get_mohbyname("default", 1);
+		if (!mohclass && realtime_possible) {
 			var = ast_load_realtime("musiconhold", "name", "default", SENTINEL);
-		if (var && (mohclass = moh_class_malloc())) {
+		}
+	}
+
+	/* If no moh class found in memory, then check RT. Note that the logic used
+	 * above guarantees that if var is non-NULL, then mohclass must be NULL.
+	 */
+	if (var) {
+		struct ast_variable *tmp = NULL;
+
+		if ((mohclass = moh_class_malloc())) {
 			mohclass->realtime = 1;
 			for (tmp = var; tmp; tmp = tmp->next) {
 				if (!strcasecmp(tmp->name, "name"))
@@ -1333,13 +1344,9 @@
 					return -1;
 				}
 			}
-		} else if (var) {
+		} else {
 			ast_variables_destroy(var);
 		}
-	}
-
-	if (!mohclass) {
-		mohclass = get_mohbyname("default", 1);
 	}
 
 	if (!mohclass) {

Modified: team/phsultan/jabberreceive/res/res_rtp_asterisk.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/res/res_rtp_asterisk.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/res/res_rtp_asterisk.c (original)
+++ team/phsultan/jabberreceive/res/res_rtp_asterisk.c Tue Jul 28 07:22:30 2009
@@ -2078,6 +2078,9 @@
 
 		rtp->f.subclass = AST_FORMAT_T140;
 		header_end = memchr(data, ((*data) & 0x7f), rtp->f.datalen);
+		if (header_end == NULL) {
+			return &ast_null_frame;
+		}
 		header_end++;
 
 		header_length = header_end - data;

Modified: team/phsultan/jabberreceive/res/res_smdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/res/res_smdi.c?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/res/res_smdi.c (original)
+++ team/phsultan/jabberreceive/res/res_smdi.c Tue Jul 28 07:22:30 2009
@@ -753,7 +753,7 @@
 			/* add the message to the message queue */
 			md_msg->timestamp = ast_tvnow();
 			ast_smdi_md_message_push(iface, md_msg);
-			ast_log(LOG_DEBUG, "Recieved SMDI MD message on %s\n", iface->name);
+			ast_log(LOG_DEBUG, "Received SMDI MD message on %s\n", iface->name);
 			
 			ASTOBJ_UNREF(md_msg, ast_smdi_md_message_destroy);
 
@@ -802,11 +802,11 @@
 			/* add the message to the message queue */
 			mwi_msg->timestamp = ast_tvnow();
 			ast_smdi_mwi_message_push(iface, mwi_msg);
-			ast_log(LOG_DEBUG, "Recieved SMDI MWI message on %s\n", iface->name);
+			ast_log(LOG_DEBUG, "Received SMDI MWI message on %s\n", iface->name);
 			
 			ASTOBJ_UNREF(mwi_msg, ast_smdi_mwi_message_destroy);
 		} else {
-			ast_log(LOG_ERROR, "Unknown SMDI message type recieved on %s (M%c).\n", iface->name, c);
+			ast_log(LOG_ERROR, "Unknown SMDI message type received on %s (M%c).\n", iface->name, c);
 			start = 0;
 		}
 	}

Modified: team/phsultan/jabberreceive/sounds/sounds.xml
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/jabberreceive/sounds/sounds.xml?view=diff&rev=209396&r1=209395&r2=209396
==============================================================================
--- team/phsultan/jabberreceive/sounds/sounds.xml (original)
+++ team/phsultan/jabberreceive/sounds/sounds.xml Tue Jul 28 07:22:30 2009
@@ -95,4 +95,22 @@
 		</member>
 		<member name="EXTRA-SOUNDS-EN-SIREN14" displayname="English, G.722.1C (Siren14) format">
 		</member>
+		<member name="EXTRA-SOUNDS-FR-WAV" displayname="French, WAV format">
+		</member>
+		<member name="EXTRA-SOUNDS-FR-ULAW" displayname="French, mu-Law format">
+		</member>
+		<member name="EXTRA-SOUNDS-FR-ALAW" displayname="French, a-Law format">
+		</member>
+		<member name="EXTRA-SOUNDS-FR-GSM" displayname="French, GSM format" >
+		</member>
+		<member name="EXTRA-SOUNDS-FR-G729" displayname="French, G.729 format">
+		</member>
+		<member name="EXTRA-SOUNDS-FR-G722" displayname="French, G.722 format">
+		</member>
+		<member name="EXTRA-SOUNDS-FR-SLN16" displayname="French, Signed-linear 16kHz format">
+		</member>
+		<member name="EXTRA-SOUNDS-FR-SIREN7" displayname="French, G.722.1 (Siren7) format">
+		</member>
+		<member name="EXTRA-SOUNDS-FR-SIREN14" displayname="French, G.722.1C (Siren14) format">
+		</member>
 	</category>




More information about the asterisk-commits mailing list