[asterisk-commits] murf: branch murf/AEL2-1.2 r48159 - in /team/murf/AEL2-1.2: ./ apps/ channels...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Nov 30 13:09:03 MST 2006


Author: murf
Date: Thu Nov 30 14:09:02 2006
New Revision: 48159

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48159
Log:
Merged revisions 47910,47958,47968,47987,48037,48045,48053,48087,48106,48127,48142,48146,48151,48154 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47910 | murf | 2006-11-21 19:19:09 -0700 (Tue, 21 Nov 2006) | 1 line

This is the fix for bug 8386, wherein the time-limit args to dial didn't work correctly
........
r47958 | oej | 2006-11-23 03:54:40 -0700 (Thu, 23 Nov 2006) | 2 lines

Remove unused variable (rizzo)

........
r47968 | crichter | 2006-11-23 09:10:23 -0700 (Thu, 23 Nov 2006) | 1 line

fixed a litle bug regarding HOLD/RETRIEVE. beatufied some logs, changed some loglevels. changed the default value of block_on_alarm
........
r47987 | oej | 2006-11-24 07:33:27 -0700 (Fri, 24 Nov 2006) | 2 lines

Change some logging levels. Not having hints is not an ERROR, but still should be reported.

........
r48037 | file | 2006-11-27 08:30:37 -0700 (Mon, 27 Nov 2006) | 2 lines

Do not reference the freed outgoing structure in the debug message. (issue #8425 reported by arkadia)

........
r48045 | tilghman | 2006-11-27 10:15:54 -0700 (Mon, 27 Nov 2006) | 2 lines

Random MOH wasn't really random (bug 8381)

........
r48053 | file | 2006-11-27 11:03:57 -0700 (Mon, 27 Nov 2006) | 2 lines

Use the proper function to get the new message count instead of always using the filesystem. (issue #8421 reported by slimey)

........
r48087 | file | 2006-11-28 09:56:01 -0700 (Tue, 28 Nov 2006) | 2 lines

According to the research I have done we never needed to include compiler.h in the first place so let's not! (issue #8430 reported by edguy3)

........
r48106 | file | 2006-11-29 09:47:10 -0700 (Wed, 29 Nov 2006) | 2 lines

If the frame was duplicated before writing out then we need to free it. (issue #8429 reported by edguy3)

........
r48127 | oej | 2006-11-30 02:05:07 -0700 (Thu, 30 Nov 2006) | 2 lines

Do proper test and don't leave dialogs hanging...

........
r48142 | file | 2006-11-30 10:55:23 -0700 (Thu, 30 Nov 2006) | 2 lines

Document 'port' for SIP peers, came up because of the current mailing list thread. (issue #8450 reported by blitzrage)

........
r48146 | file | 2006-11-30 11:17:54 -0700 (Thu, 30 Nov 2006) | 2 lines

Remember the pointer to the allocated block of memory so that we can free it and not cause a memory leak. (issue #8449 reported by arkadia)

........
r48151 | file | 2006-11-30 11:42:45 -0700 (Thu, 30 Nov 2006) | 2 lines

Print certain CDR messages out at the NOTICE level versus WARNING since they can occur when used with the CDR applications and are perfectly fine. (issue #8367 reported by dartvader)

........
r48154 | file | 2006-11-30 12:04:11 -0700 (Thu, 30 Nov 2006) | 2 lines

Do not listen for DTMF on the bridge that comes into existence when ParkedCall is executed. This means native bridging can now occur for this. (issue #8406 reported by kebl0155)

........

Modified:
    team/murf/AEL2-1.2/   (props changed)
    team/murf/AEL2-1.2/apps/app_voicemail.c
    team/murf/AEL2-1.2/cdr.c
    team/murf/AEL2-1.2/channel.c
    team/murf/AEL2-1.2/channels/chan_misdn.c
    team/murf/AEL2-1.2/channels/chan_phone.c
    team/murf/AEL2-1.2/channels/chan_sip.c
    team/murf/AEL2-1.2/channels/misdn/isdn_lib.c
    team/murf/AEL2-1.2/channels/misdn_config.c
    team/murf/AEL2-1.2/configs/sip.conf.sample
    team/murf/AEL2-1.2/pbx/pbx_spool.c
    team/murf/AEL2-1.2/res/res_features.c
    team/murf/AEL2-1.2/res/res_musiconhold.c
    team/murf/AEL2-1.2/rtp.c

Propchange: team/murf/AEL2-1.2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Nov 30 14:09:02 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-47908
+/branches/1.2:1-48156

Modified: team/murf/AEL2-1.2/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/apps/app_voicemail.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/apps/app_voicemail.c (original)
+++ team/murf/AEL2-1.2/apps/app_voicemail.c Thu Nov 30 14:09:02 2006
@@ -5768,22 +5768,13 @@
 			}
 		}
 		while (vmu) {
-			char dirname[256];
-			DIR *vmdir;
-			struct dirent *vment;
-			int vmcount = 0;
-			char count[12];
+			int newmsgs = 0, oldmsgs = 0;
+			char count[12], tmp[256] = "";
 
 			if ((argc == 3) || ((argc == 5) && !strcmp(argv[4],vmu->context))) {
-				make_dir(dirname, 255, vmu->context, vmu->mailbox, "INBOX");
-				if ((vmdir = opendir(dirname))) {
-					/* No matter what the format of VM, there will always be a .txt file for each message. */
-					while ((vment = readdir(vmdir)))
-						if (strlen(vment->d_name) > 7 && !strncmp(vment->d_name + 7,".txt",4))
-							vmcount++;
-					closedir(vmdir);
-				}
-				snprintf(count,sizeof(count),"%d",vmcount);
+				snprintf(tmp, sizeof(tmp), "%s@%s", vmu->mailbox, ast_strlen_zero(vmu->context) ? "default" : vmu->context);
+				messagecount(tmp, &newmsgs, &oldmsgs);
+				snprintf(count,sizeof(count),"%d",newmsgs);
 				ast_cli(fd, output_format, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count);
 			}
 			vmu = vmu->next;

Modified: team/murf/AEL2-1.2/cdr.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/cdr.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/cdr.c (original)
+++ team/murf/AEL2-1.2/cdr.c Thu Nov 30 14:09:02 2006
@@ -440,11 +440,11 @@
 		next = cdr->next;
 		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_POSTED) && !ast_test_flag(cdr, AST_CDR_FLAG_POST_DISABLED))
-			ast_log(LOG_WARNING, "CDR on channel '%s' not posted\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' not posted\n", chan);
 		if (ast_tvzero(cdr->end))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks end\n", chan);
 		if (ast_tvzero(cdr->start))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks start\n", chan);
 
 		ast_cdr_free_vars(cdr, 0);
 		free(cdr);
@@ -806,11 +806,11 @@
 	while (cdr) {
 		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
 		if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
-			ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' already posted\n", chan);
 		if (ast_tvzero(cdr->end))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks end\n", chan);
 		if (ast_tvzero(cdr->start)) {
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks start\n", chan);
 			cdr->disposition = AST_CDR_FAILED;
 		} else
 			cdr->duration = cdr->end.tv_sec - cdr->start.tv_sec;

Modified: team/murf/AEL2-1.2/channel.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channel.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/channel.c (original)
+++ team/murf/AEL2-1.2/channel.c Thu Nov 30 14:09:02 2006
@@ -355,8 +355,11 @@
 {
 	struct chanlist *chan, *last=NULL;
 
-	if (option_debug)
+	if (option_debug && tech && tech->type )
 		ast_log(LOG_DEBUG, "Unregistering channel type '%s'\n", tech->type);
+	else if (option_debug)
+		ast_log(LOG_DEBUG, "Unregistering channel, tech is NULL!!!\n");
+		
 
 	ast_mutex_lock(&chlock);
 
@@ -3502,10 +3505,11 @@
 		if (!ast_tvzero(nexteventts)) {
 			now = ast_tvnow();
 			to = ast_tvdiff_ms(nexteventts, now);
-			if (to <= 0) {
+			if (to <= 0 && !config->timelimit) {	
 				res = AST_BRIDGE_COMPLETE;
 				break;
-			}
+			}	
+				
 		}
 
 		if (config->timelimit) {
@@ -3525,7 +3529,7 @@
 				break;
 			}
 			
-			if (!to) {
+			if (to <= 0) {
 				if (time_left_ms >= 5000) {
 					/* force the time left to round up if appropriate */
 					if (caller_warning && config->warning_sound && config->play_warning)
@@ -3537,8 +3541,11 @@
 				}
 				if (config->warning_freq) {
 					nexteventts = ast_tvadd(nexteventts, ast_samp2tv(config->warning_freq, 1000));
-				} else
+				}
+					
+				if ( (!config->warning_freq) ||  ( config->timelimit - ast_tvdiff_ms(nexteventts, config->start_time) < 0)) {
 					nexteventts = ast_tvadd(config->start_time, ast_samp2tv(config->timelimit, 1000));
+				}
 			}
 		}
 
@@ -3636,8 +3643,6 @@
 			o1nativeformats = c1->nativeformats;
 		}
 		res = ast_generic_bridge(c0, c1, config, fo, rc, nexteventts);
-		if (res != AST_BRIDGE_RETRY)
-			break;
 	}
 
 	c0->_bridge = NULL;

Modified: team/murf/AEL2-1.2/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channels/chan_misdn.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/channels/chan_misdn.c (original)
+++ team/murf/AEL2-1.2/channels/chan_misdn.c Thu Nov 30 14:09:02 2006
@@ -796,8 +796,8 @@
 			print_bc_info(fd, help, bc);
 		} else {
 			if (help->state == MISDN_HOLDED) {
-				chan_misdn_log(0, 0, "ITS A HOLDED BC:\n");
-				chan_misdn_log(0,0," --> l3_id: %x\n"
+				chan_misdn_log(2, 0, "ITS A HOLDED BC:\n");
+				chan_misdn_log(2,0," --> l3_id: %x\n"
 						" --> dad:%s oad:%s\n"
 				
 						,help->l3id
@@ -1220,8 +1220,7 @@
 	
 	int port=bc->port;
 	
-	chan_misdn_log(1,port,"update_config: Getting Config\n");
-
+	chan_misdn_log(7,port,"update_config: Getting Config\n");
 
 	int hdlc=0;
 	misdn_cfg_get( port, MISDN_CFG_HDLC, &hdlc, sizeof(int));
@@ -1635,7 +1634,7 @@
 	
 	chan_misdn_log(1, port, "* CALL: %s\n",dest);
 	
-	chan_misdn_log(1, port, " --> * dad:%s tech:%s ctx:%s\n",ast->exten,ast->name, ast->context);
+	chan_misdn_log(2, port, " --> * dad:%s tech:%s ctx:%s\n",ast->exten,ast->name, ast->context);
 	
 	chan_misdn_log(3, port, " --> * adding2newbc ext %s\n",ast->exten);
 	if (ast->exten) {
@@ -1691,7 +1690,7 @@
 		return -1;
 	}
 	
-	chan_misdn_log(1, port, " --> * SEND: State Dialing pid:%d\n",newbc?newbc->pid:1);
+	chan_misdn_log(2, port, " --> * SEND: State Dialing pid:%d\n",newbc?newbc->pid:1);
 
 	ast_setstate(ast, AST_STATE_DIALING);
 	ast->hangupcause=16;
@@ -1855,12 +1854,11 @@
 		return -1;
 	}
 	
-	chan_misdn_log(1, p->bc->port, "* IND : Indication [%d] from %s\n",cond, ast->exten);
+	chan_misdn_log(5, p->bc->port, "* IND : Indication [%d] from %s\n",cond, ast->exten);
 	
 	switch (cond) {
 	case AST_CONTROL_BUSY:
-		chan_misdn_log(1, p->bc->port, "* IND :\tbusy\n");
-		chan_misdn_log(1, p->bc->port, " --> * SEND: State Busy pid:%d\n",p->bc?p->bc->pid:-1);
+		chan_misdn_log(1, p->bc->port, "* IND :\tbusy pid:%d\n",p->bc?p->bc->pid:-1);
 		ast_setstate(ast,AST_STATE_BUSY);
 
 		p->bc->out_cause=17;
@@ -1873,41 +1871,42 @@
 		return -1;
 		break;
 	case AST_CONTROL_RING:
-		chan_misdn_log(1, p->bc->port, " --> * IND :\tring pid:%d\n",p->bc?p->bc->pid:-1);
+		chan_misdn_log(1, p->bc->port, "* IND :\tring pid:%d\n",p->bc?p->bc->pid:-1);
 		return -1;
 		break;
 		
 	case AST_CONTROL_RINGING:
+		chan_misdn_log(1, p->bc->port, "* IND :\tringing pid:%d\n",p->bc?p->bc->pid:-1);
 		switch (p->state) {
 			case MISDN_ALERTING:
-				chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d but I was Ringing before, so ignoreing it\n",p->bc?p->bc->pid:-1);
+				chan_misdn_log(2, p->bc->port, " --> * IND :\tringing pid:%d but I was Ringing before, so ignoreing it\n",p->bc?p->bc->pid:-1);
 				break;
 			case MISDN_CONNECTED:
-				chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d but Connected, so just send TONE_ALERTING without state changes \n",p->bc?p->bc->pid:-1);
+				chan_misdn_log(2, p->bc->port, " --> * IND :\tringing pid:%d but Connected, so just send TONE_ALERTING without state changes \n",p->bc?p->bc->pid:-1);
 				return -1;
 				break;
 			default:
 				p->state=MISDN_ALERTING;
-				chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d\n",p->bc?p->bc->pid:-1);
+				chan_misdn_log(2, p->bc->port, " --> * IND :\tringing pid:%d\n",p->bc?p->bc->pid:-1);
 				misdn_lib_send_event( p->bc, EVENT_ALERTING);
 			
 				if (p->other_ch && p->other_ch->bc) {
 					if (misdn_inband_avail(p->other_ch->bc)) {
-						chan_misdn_log(1,p->bc->port, " --> other End is mISDN and has inband info available\n");
+						chan_misdn_log(2,p->bc->port, " --> other End is mISDN and has inband info available\n");
 						break;
 					}
 
 					if (!p->other_ch->bc->nt) {
-						chan_misdn_log(1,p->bc->port, " --> other End is mISDN TE so it has inband info for sure (?)\n");
+						chan_misdn_log(2,p->bc->port, " --> other End is mISDN TE so it has inband info for sure (?)\n");
 						break;
 					}
 				}
 
-				chan_misdn_log(1, p->bc->port, " --> * SEND: State Ring pid:%d\n",p->bc?p->bc->pid:-1);
+				chan_misdn_log(3, p->bc->port, " --> * SEND: State Ring pid:%d\n",p->bc?p->bc->pid:-1);
 				ast_setstate(ast,AST_STATE_RINGING);
 			
 				if ( !p->bc->nt && (p->orginator==ORG_MISDN) && !p->incoming_early_audio ) 
-					chan_misdn_log(1,p->bc->port, " --> incoming_early_audio off\n");
+					chan_misdn_log(2,p->bc->port, " --> incoming_early_audio off\n");
 				else 
 					return -1;
 		}
@@ -2044,10 +2043,10 @@
 		}
     
 		chan_misdn_log(1, bc->port, "* IND : HANGUP\tpid:%d ctx:%s dad:%s oad:%s State:%s\n",p->bc?p->bc->pid:-1, ast->context, ast->exten, AST_CID_P(ast), misdn_get_ch_state(p));
-		chan_misdn_log(2, bc->port, " --> l3id:%x\n",p->l3id);
-		chan_misdn_log(1, bc->port, " --> cause:%d\n",bc->cause);
-		chan_misdn_log(1, bc->port, " --> out_cause:%d\n",bc->out_cause);
-		chan_misdn_log(1, bc->port, " --> state:%s\n", misdn_get_ch_state(p));
+		chan_misdn_log(3, bc->port, " --> l3id:%x\n",p->l3id);
+		chan_misdn_log(3, bc->port, " --> cause:%d\n",bc->cause);
+		chan_misdn_log(2, bc->port, " --> out_cause:%d\n",bc->out_cause);
+		chan_misdn_log(2, bc->port, " --> state:%s\n", misdn_get_ch_state(p));
 		
 		switch (p->state) {
 		case MISDN_CALLING:
@@ -2132,7 +2131,7 @@
 	}
 	
 
-	chan_misdn_log(1, bc->port, "Channel: %s hanguped new state:%s\n",ast->name,misdn_get_ch_state(p));
+	chan_misdn_log(3, bc->port, " --> Channel: %s hanguped new state:%s\n",ast->name,misdn_get_ch_state(p));
 	
 	return 0;
 }
@@ -2348,9 +2347,9 @@
 			/* got hangup .. */
 
 			if (!f) 
-				chan_misdn_log(1,ch1->bc->port,"Read Null Frame\n");
+				chan_misdn_log(4,ch1->bc->port,"Read Null Frame\n");
 			else
-				chan_misdn_log(1,ch1->bc->port,"Read Frame Controll class:%d\n",f->subclass);
+				chan_misdn_log(4,ch1->bc->port,"Read Frame Controll class:%d\n",f->subclass);
 			
 			*fo=f;
 			*rc=who;
@@ -2955,11 +2954,11 @@
 		return;
 	}
 
-	cb_log(1,port,"hangup_chan\n");
+	cb_log(5,port,"hangup_chan called\n");
 
 	if (ch->need_hangup) 
 	{
-		cb_log(1,port,"-> hangup\n");
+		cb_log(2,port," --> hangup\n");
 		send_cause2ast(ch->ast,ch->bc,ch);
 		ch->need_hangup=0;
 		ch->need_queue_hangup=0;
@@ -2969,7 +2968,7 @@
 	}
 
 	if (!ch->need_queue_hangup) {
-		cb_log(1,port,"No need to queue hangup\n");
+		cb_log(2,port," --> No need to queue hangup\n");
 	}
 
 	ch->need_queue_hangup=0;
@@ -2978,7 +2977,7 @@
 
 		if (ch->ast)
 			ast_queue_hangup(ch->ast);
-		cb_log(1,port,"-> queue_hangup\n");
+		cb_log(2,port," --> queue_hangup\n");
 	} else {
 		cb_log(1,port,"Cannot hangup chan, no ast\n");
 	}
@@ -2998,7 +2997,7 @@
 			ast=ch->ast;
 		} 
 		
-		chan_misdn_log(1, bc->port, "release_chan: bc with l3id: %x\n",bc->l3_id);
+		chan_misdn_log(5, bc->port, "release_chan: bc with l3id: %x\n",bc->l3_id);
 		
 		/*releaseing jitterbuffer*/
 		if (ch->jb ) {
@@ -3177,7 +3176,7 @@
 	tmp=pbx_builtin_getvar_helper(chan,"MISDN_PID");
 	if (tmp) {
 		ch->other_pid=atoi(tmp);
-		chan_misdn_log(1,bc->port,"IMPORT_PID: importing pid:%s\n",tmp);
+		chan_misdn_log(3,bc->port," --> IMPORT_PID: importing pid:%s\n",tmp);
 
 		if (ch->other_pid >0) {
 			ch->other_ch=find_chan_by_pid(cl_te,ch->other_pid);
@@ -3190,7 +3189,7 @@
 {
 	char tmp[32];
 
-	chan_misdn_log(1,bc->port,"EXPORT_PID: pid:%d\n",bc->pid);
+	chan_misdn_log(3,bc->port," --> EXPORT_PID: pid:%d\n",bc->pid);
 	sprintf(tmp,"%d",bc->pid);
 	pbx_builtin_setvar_helper(chan,"_MISDN_PID",tmp);
 }
@@ -3730,15 +3729,15 @@
 		ast_queue_control(ch->ast, AST_CONTROL_RINGING);
 		ast_setstate(ch->ast, AST_STATE_RINGING);
 		
-		cb_log(1,bc->port,"Set State Ringing\n");
+		cb_log(7,bc->port," --> Set State Ringing\n");
 		
 		if ( misdn_cap_is_speech(bc->capability) && misdn_inband_avail(bc)) {
 			cb_log(1,bc->port,"Starting Tones, we have inband Data\n");
 			start_bc_tones(ch);
 		} else {
-			cb_log(1,bc->port,"We have no inband Data, the other end must create ringing\n");
+			cb_log(3,bc->port," --> We have no inband Data, the other end must create ringing\n");
 			if (ch->far_alerting) {
-				cb_log(1,bc->port,"The other end can not do ringing eh ?.. we must do all ourself..");
+				cb_log(1,bc->port," --> The other end can not do ringing eh ?.. we must do all ourself..");
 				start_bc_tones(ch);
 				/*tone_indicate(ch, TONE_FAR_ALERTING);*/
 			}
@@ -4009,6 +4008,9 @@
 		ch->bc=bc;
 		ch->state = MISDN_CONNECTED;
 
+		ch->hold_info.port=0;
+		ch->hold_info.channel=0;
+		
 		struct ast_channel *hold_ast=AST_BRIDGED_P(ch->ast);
 		
 		if (hold_ast) {

Modified: team/murf/AEL2-1.2/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channels/chan_phone.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/channels/chan_phone.c (original)
+++ team/murf/AEL2-1.2/channels/chan_phone.c Thu Nov 30 14:09:02 2006
@@ -37,11 +37,6 @@
 #include <linux/telephony.h>
 /* Still use some IXJ specific stuff */
 #include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
-# include <linux/compiler.h>
-#endif
-#endif
 #include <linux/ixjuser.h>
 
 #include "asterisk.h"

Modified: team/murf/AEL2-1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channels/chan_sip.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/channels/chan_sip.c (original)
+++ team/murf/AEL2-1.2/channels/chan_sip.c Thu Nov 30 14:09:02 2006
@@ -2261,7 +2261,7 @@
 		case INC_CALL_LIMIT:
 			if (*call_limit > 0 ) {
 				if (*inuse >= *call_limit) {
-					ast_log(LOG_ERROR, "Call %s %s '%s' rejected due to usage limit of %d\n", outgoing ? "to" : "from", u ? "user":"peer", name, *call_limit);
+					ast_log(LOG_NOTICE, "Call %s %s '%s' rejected due to usage limit of %d\n", outgoing ? "to" : "from", u ? "user":"peer", name, *call_limit);
 					if (u)
 						ASTOBJ_UNREF(u,sip_destroy_user);
 					else
@@ -11110,7 +11110,7 @@
 		if ((firststate = ast_extension_state(NULL, p->context, p->exten)) < 0) {
 			char iabuf[INET_ADDRSTRLEN];
 
-			ast_log(LOG_ERROR, "Got SUBSCRIBE for extension %s@%s from %s, but there is no hint for that extension\n", p->exten, p->context, ast_inet_ntoa(iabuf, sizeof(iabuf), p->sa.sin_addr));
+			ast_log(LOG_NOTICE, "Got SUBSCRIBE for extension %s@%s from %s, but there is no hint for that extension\n", p->exten, p->context, ast_inet_ntoa(iabuf, sizeof(iabuf), p->sa.sin_addr));
 			transmit_response(p, "404 Not found", req);
 			ast_set_flag(p, SIP_NEEDDESTROY);	
 			return 0;
@@ -11180,7 +11180,6 @@
 {
 	/* Called with p->lock held, as well as p->owner->lock if appropriate, keeping things
 	   relatively static */
-	struct sip_request resp;
 	char *cmd;
 	char *cseq;
 	char *useragent;
@@ -11194,9 +11193,6 @@
 	char *e;
 	int error = 0;
 
-	/* Clear out potential response */
-	memset(&resp, 0, sizeof(resp));
-
 	/* Get Method and Cseq */
 	cseq = get_header(req, "Cseq");
 	cmd = req->header[0];
@@ -11211,7 +11207,7 @@
 		error = 1;
 	}
 	if (error) {
-		if (!p->initreq.header)	/* New call */
+		if (!p->initreq.headers)	/* New call */
 			ast_set_flag(p, SIP_NEEDDESTROY);	/* Make sure we destroy this dialog */
 		return -1;
 	}
@@ -13390,7 +13386,9 @@
 			sip_destroy(iterator->call);
 		}
 		ASTOBJ_UNLOCK(iterator);
+	
 	} while(0));
+
 
 	ASTOBJ_CONTAINER_DESTROYALL(&userl, sip_destroy_user);
 	ASTOBJ_CONTAINER_DESTROYALL(&regl, sip_registry_destroy);

Modified: team/murf/AEL2-1.2/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channels/misdn/isdn_lib.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/channels/misdn/isdn_lib.c (original)
+++ team/murf/AEL2-1.2/channels/misdn/isdn_lib.c Thu Nov 30 14:09:02 2006
@@ -420,10 +420,10 @@
 {
 	int i;
 
-	cb_log(1,stack->port,"find_free_chan: req_chan:%d\n",channel);
+	cb_log(5,stack->port,"find_free_chan: req_chan:%d\n",channel);
 
 	if (channel < 0 || channel > MAX_BCHANS) {
-		cb_log(4, stack->port, " !! out of bound call to find_free_chan_in_stack! (ch:%d)\n", channel);
+		cb_log(0, stack->port, " !! out of bound call to find_free_chan_in_stack! (ch:%d)\n", channel);
 		return 0;
 	}
 	
@@ -432,14 +432,14 @@
 	for (i = 0; i < stack->b_num; i++) {
 		if (i != 15 && (channel < 0 || i == channel)) { /* skip E1 Dchannel ;) and work with chan preselection */
 			if (!stack->channels[i]) {
-				cb_log (1, stack->port, " --> found chan%s: %d\n", channel>=0?" (preselected)":"", i+1);
+				cb_log (3, stack->port, " --> found chan%s: %d\n", channel>=0?" (preselected)":"", i+1);
 				stack->channels[i] = 1;
 				return i+1;
 			}
 		}
 	}
 
-	cb_log (4, stack->port, " !! NO FREE CHAN IN STACK\n");
+	cb_log (1, stack->port, " !! NO FREE CHAN IN STACK\n");
 	dump_chan_list(stack);
   
 	return 0;
@@ -1671,8 +1671,6 @@
 	     stack;
 	     stack=stack->next) {
 		
-		if ( !stack->ptp && !check) return 1;
-		
 		if (stack->port == port) {
 
 			if (stack->blocked) {
@@ -1690,7 +1688,7 @@
 					return 0;
 				}
 			} else {
-				if ( stack->l1link)
+				if ( !check || stack->l1link )
 					return 1;
 				else {
 					cb_log(0,port, "Port down PMP\n");
@@ -2030,7 +2028,7 @@
 						if (stack->ptp) 
 							set_chan_in_stack(stack, bc->channel);
 						else 
-							cb_log(0,stack->port," --> PTMP but channel requested\n");
+							cb_log(3,stack->port," --> PTMP but channel requested\n");
 
 					} else {
 
@@ -3173,7 +3171,7 @@
 	}
 	
 	cb_log(1, stack->port, "I SEND:%s oad:%s dad:%s pid:%d\n", isdn_get_info(msgs_g, event, 0), bc->oad, bc->dad, bc->pid);
-	cb_log(1, stack->port, " --> bc_state:%s\n",bc_state2str(bc->bc_state));
+	cb_log(4, stack->port, " --> bc_state:%s\n",bc_state2str(bc->bc_state));
 	misdn_lib_log_ies(bc);
 	
 	switch (event) {
@@ -4182,7 +4180,7 @@
 
 	struct misdn_stack *stack=get_stack_by_bc(bc);
 	
-	cb_log(1, stack?stack->port:0,"ec_enable\n");
+	cb_log(4, stack?stack->port:0,"ec_enable\n");
 
 	if (!misdn_cap_is_speech(bc->capability)) {
 		cb_log(1, stack?stack->port:0, " --> no speech? cannot enable EC\n");
@@ -4190,7 +4188,7 @@
 	}
 
 	if (bc->ec_enable) {
-		cb_log(1, stack?stack->port:0,"Sending Control ECHOCAN_ON taps:%d training:%d\n",bc->ec_deftaps, bc->ec_training);
+		cb_log(3, stack?stack->port:0,"Sending Control ECHOCAN_ON taps:%d training:%d\n",bc->ec_deftaps, bc->ec_training);
 	
 		switch (bc->ec_deftaps) {
 		case 4:
@@ -4222,7 +4220,7 @@
 {
 	struct misdn_stack *stack=get_stack_by_bc(bc);
 	
-	cb_log(1, stack?stack->port:0,"ec_disable\n");
+	cb_log(4, stack?stack->port:0," --> ec_disable\n");
 
 	if (!misdn_cap_is_speech(bc->capability)) {
 		cb_log(1, stack?stack->port:0, " --> no speech? cannot disable EC\n");
@@ -4230,7 +4228,7 @@
 	}
 
 	if ( ! bc->ec_enable) {
-		cb_log(1, stack?stack->port:0, "Sending Control ECHOCAN_OFF\n");
+		cb_log(3, stack?stack->port:0, "Sending Control ECHOCAN_OFF\n");
 		manager_ph_control(bc,  ECHOCAN_OFF, 0);
 	}
 }
@@ -4247,7 +4245,7 @@
 	manager_ph_control(bc, CMX_RECEIVE_OFF, 0);
 	manager_ph_control(bc, CMX_CONF_JOIN, conf_id);
 
-	cb_log(1,bc->port, "Joining bc:%x in conf:%d\n",bc->addr,conf_id);
+	cb_log(3,bc->port, "Joining bc:%x in conf:%d\n",bc->addr,conf_id);
 
 	char data[16];
 	int len=15;
@@ -4265,13 +4263,13 @@
 	manager_ph_control(bc, CMX_RECEIVE_ON, 0);
 	manager_ph_control(bc, CMX_CONF_SPLIT, conf_id);
 
-	cb_log(1,bc->port, "Splitting bc:%x in conf:%d\n",bc->addr,conf_id);
+	cb_log(4,bc->port, "Splitting bc:%x in conf:%d\n",bc->addr,conf_id);
 }
 
 void misdn_lib_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2) {
 	int conf_id=bc1->pid +1;
 
-	cb_log(1, bc1->port, "I Send: BRIDGE from:%d to:%d\n",bc1->port,bc2->port);
+	cb_log(4, bc1->port, "I Send: BRIDGE from:%d to:%d\n",bc1->port,bc2->port);
 	
 	struct misdn_bchannel *bc_list[]={
 		bc1,bc2,NULL
@@ -4280,7 +4278,7 @@
 		
 	for (bc=bc_list; *bc;  *bc++) { 
 		(*bc)->conf_id=conf_id;
-		cb_log(1, (*bc)->port, " --> bc_addr:%x\n",(*bc)->addr);
+		cb_log(4, (*bc)->port, " --> bc_addr:%x\n",(*bc)->addr);
 	
 		switch((*bc)->bc_state) {
 			case BCHAN_ACTIVATED:
@@ -4315,7 +4313,7 @@
 
 void misdn_lib_echo(struct misdn_bchannel *bc, int onoff)
 {
-	cb_log(1,bc->port, " --> ECHO %s\n", onoff?"ON":"OFF");
+	cb_log(3,bc->port, " --> ECHO %s\n", onoff?"ON":"OFF");
 	manager_ph_control(bc, onoff?CMX_ECHO_ON:CMX_ECHO_OFF, 0);
 }
 

Modified: team/murf/AEL2-1.2/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/channels/misdn_config.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/channels/misdn_config.c (original)
+++ team/murf/AEL2-1.2/channels/misdn_config.c Thu Nov 30 14:09:02 2006
@@ -91,7 +91,7 @@
 	{ "far_alerting", MISDN_CFG_FAR_ALERTING, MISDN_CTYPE_BOOL, "no", NONE },
 	{ "pmp_l1_check", MISDN_CFG_PMP_L1_CHECK, MISDN_CTYPE_BOOL, "yes", NONE },
 	{ "reject_cause", MISDN_CFG_REJECT_CAUSE, MISDN_CTYPE_INT, "21", NONE },
-	{ "block_on_alarm", MISDN_CFG_ALARM_BLOCK, MISDN_CTYPE_BOOL, "yes", NONE },
+	{ "block_on_alarm", MISDN_CFG_ALARM_BLOCK, MISDN_CTYPE_BOOL, "no", NONE },
 	{ "hdlc", MISDN_CFG_HDLC, MISDN_CTYPE_BOOL, "no", NONE },
 	{ "context", MISDN_CFG_CONTEXT, MISDN_CTYPE_STR, "default", NONE },
 	{ "language", MISDN_CFG_LANGUAGE, MISDN_CTYPE_STR, "en", NONE },

Modified: team/murf/AEL2-1.2/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/configs/sip.conf.sample?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/configs/sip.conf.sample (original)
+++ team/murf/AEL2-1.2/configs/sip.conf.sample Thu Nov 30 14:09:02 2006
@@ -32,6 +32,7 @@
 				; Realms MUST be globally unique according to RFC 3261
 				; Set this to your host name or domain name
 bindport=5060			; UDP Port to bind to (SIP standard port is 5060)
+				; bindport is the local UDP port that Asterisk will listen on
 bindaddr=0.0.0.0		; IP address to bind to (0.0.0.0 binds to all)
 srvlookup=yes			; Enable DNS SRV lookups on outbound calls
 				; Note: Asterisk only uses the first host 
@@ -327,6 +328,7 @@
 ;usereqphone=yes			; This provider requires ";user=phone" on URI
 ;call-limit=5				; permit only 5 simultaneous outgoing calls to this peer
 ;outboundproxy=proxy.provider.domain	; send outbound signaling to this proxy, not directly to the peer
+;port=80				; The port number we want to connect to on the remote side
 
 ;------------------------------------------------------------------------------
 ; Definitions of locally connected SIP phones

Modified: team/murf/AEL2-1.2/pbx/pbx_spool.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/pbx/pbx_spool.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/pbx/pbx_spool.c (original)
+++ team/murf/AEL2-1.2/pbx/pbx_spool.c Thu Nov 30 14:09:02 2006
@@ -315,8 +315,8 @@
 					now += o->retrytime;
 					if (o->callingpid && (o->callingpid == ast_mainpid)) {
 						safe_append(o, time(NULL), "DelayedRetry");
+						ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn);
 						free_outgoing(o);
-						ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn);
 					} else {
 						/* Increment retries */
 						o->retries++;

Modified: team/murf/AEL2-1.2/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/res/res_features.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/res/res_features.c (original)
+++ team/murf/AEL2-1.2/res/res_features.c Thu Nov 30 14:09:02 2006
@@ -1774,12 +1774,6 @@
 			ast_verbose(VERBOSE_PREFIX_3 "Channel %s connected to parked call %d\n", chan->name, park);
 
 		memset(&config, 0, sizeof(struct ast_bridge_config));
-		ast_set_flag(&(config.features_callee), AST_FEATURE_REDIRECT);
-		ast_set_flag(&(config.features_caller), AST_FEATURE_REDIRECT);
-		config.timelimit = 0;
-		config.play_warning = 0;
-		config.warning_freq = 0;
-		config.warning_sound=NULL;
 		res = ast_bridge_call(chan, peer, &config);
 
 		/* Simulate the PBX hanging up */
@@ -2058,7 +2052,8 @@
 		ast_unregister_features();
 		var = ast_variable_browse(cfg, "applicationmap");
 		while(var) {
-			char *tmp_val=strdup(var->value);
+			char *tmp_val_orig=strdup(var->value);
+			char *tmp_val = tmp_val_orig;
 			char *exten, *party=NULL, *app=NULL, *app_args=NULL; 
 
 			if (!tmp_val) { 
@@ -2075,7 +2070,7 @@
 
 			if (!(app && strlen(app)) || !(exten && strlen(exten)) || !(party && strlen(party)) || !(var->name && strlen(var->name))) {
 				ast_log(LOG_NOTICE, "Please check the feature Mapping Syntax, either extension, name, or app aren't provided %s %s %s %s\n",app,exten,party,var->name);
-				free(tmp_val);
+				free(tmp_val_orig);
 				var = var->next;
 				continue;
 			}
@@ -2090,7 +2085,7 @@
 				}
 				if (!feature) {
 					ast_log(LOG_NOTICE, "Malloc failed at feature mapping\n");
-					free(tmp_val);
+					free(tmp_val_orig);
 					var = var->next;
 					continue;
 				}
@@ -2099,7 +2094,6 @@
 				ast_copy_string(feature->sname,var->name,FEATURE_SNAME_LEN);
 				ast_copy_string(feature->app,app,FEATURE_APP_LEN);
 				ast_copy_string(feature->exten, exten,FEATURE_EXTEN_LEN);
-				free(tmp_val);
 				
 				if (app_args) 
 					ast_copy_string(feature->app_args,app_args,FEATURE_APP_ARGS_LEN);
@@ -2114,6 +2108,7 @@
 					ast_set_flag(feature,AST_FEATURE_FLAG_CALLEE);
 				else {
 					ast_log(LOG_NOTICE, "Invalid party specification for feature '%s', must be caller, or callee\n", var->name);
+					free(tmp_val_orig);
 					var = var->next;
 					continue;
 				}
@@ -2121,6 +2116,7 @@
 				ast_register_feature(feature);
 				
 				if (option_verbose >=1) ast_verbose(VERBOSE_PREFIX_2 "Mapping Feature '%s' to app '%s' with code '%s'\n", var->name, app, exten);  
+				free(tmp_val_orig);
 			}
 			var = var->next;
 		}	 

Modified: team/murf/AEL2-1.2/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/res/res_musiconhold.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/res/res_musiconhold.c (original)
+++ team/murf/AEL2-1.2/res/res_musiconhold.c Thu Nov 30 14:09:02 2006
@@ -190,7 +190,7 @@
 		if (state->origwfmt && ast_set_write_format(chan, state->origwfmt)) {
 			ast_log(LOG_WARNING, "Unable to restore channel '%s' to format '%d'\n", chan->name, state->origwfmt);
 		}
-		state->save_pos = state->pos + 1;
+		state->save_pos = state->pos;
 	}
 }
 
@@ -201,32 +201,29 @@
 	int tries;
 
 	if (state->save_pos) {
-		state->pos = state->save_pos - 1;
+		state->pos = state->save_pos;
 		state->save_pos = 0;
-	} else {
+	}
+
+	state->samples = 0;
+	if (chan->stream) {
+		ast_closestream(chan->stream);
+		chan->stream = NULL;
+		state->pos++;
+		state->pos %= state->class->total_files;
+	}
+
+	if (ast_test_flag(state->class, MOH_RANDOMIZE)) {
 		/* Try 20 times to find something good */
-		for (tries=0;tries < 20;tries++) {
-			state->samples = 0;
-			if (chan->stream) {
-				ast_closestream(chan->stream);
-				chan->stream = NULL;
-				state->pos++;
-			}
-
-			if (ast_test_flag(state->class, MOH_RANDOMIZE))
-				state->pos = rand();
-
-			state->pos %= state->class->total_files;
+		for (tries = 0; tries < 20; tries++) {
+			state->pos = rand() % state->class->total_files;
 
 			/* check to see if this file's format can be opened */
 			if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) > 0)
 				break;
-
-		}
-	}
-
-	state->pos = state->pos % state->class->total_files;
-	
+		}
+	}
+
 	if (!ast_openstream_full(chan, state->class->filearray[state->pos], chan->language, 1)) {
 		ast_log(LOG_WARNING, "Unable to open file '%s': %s\n", state->class->filearray[state->pos], strerror(errno));
 		state->pos++;

Modified: team/murf/AEL2-1.2/rtp.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/rtp.c?view=diff&rev=48159&r1=48158&r2=48159
==============================================================================
--- team/murf/AEL2-1.2/rtp.c (original)
+++ team/murf/AEL2-1.2/rtp.c Thu Nov 30 14:09:02 2006
@@ -1463,6 +1463,8 @@
 			f = _f;
 		}
 		ast_rtp_raw_write(rtp, f, codec);
+		if (f != _f)
+			ast_frfree(f);
 	}
 		
 	return 0;



More information about the asterisk-commits mailing list