[svn-commits] mogorman: branch anthonyl/voicemail-odbc r49349 - in /team/anthonyl/voicemail...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Jan 3 15:21:59 MST 2007


Author: mogorman
Date: Wed Jan  3 16:21:58 2007
New Revision: 49349

URL: http://svn.digium.com/view/asterisk?view=rev&rev=49349
Log:
Merged revisions 48467,48484,48552,48576,48584,48782,48939,48943,48955,48974,49045,49135,49303 via svnmerge from 
https://svn.digium.com/svn/asterisk/branches/1.2

........
r48467 | crichter | 2006-12-14 07:03:49 -0600 (Thu, 14 Dec 2006) | 1 line

removed FIXUP state. added check for channel allocation conflict when we create a setup while the other site creates a setup on the same channel, besides the check we resolve this conflict.
........
r48484 | oej | 2006-12-15 04:51:53 -0600 (Fri, 15 Dec 2006) | 2 lines

Issue #8592 - handle 504 as 503 - congestion

........
r48552 | crichter | 2006-12-18 04:19:39 -0600 (Mon, 18 Dec 2006) | 1 line

when our PTP Partner sends us a SETUP with a preselected channel we just accept it, even when we're NT. added some checks for segfaults.
........
r48576 | crichter | 2006-12-19 07:08:51 -0600 (Tue, 19 Dec 2006) | 1 line

when we reject a channel, because it's in use already, we shouldn't process the setup anymore. made the channel allocation a bit easier and more understandable, removed a few unused lines
........
r48584 | file | 2006-12-19 15:10:26 -0600 (Tue, 19 Dec 2006) | 2 lines

Free localuser structure when we fail to dial (issue #8612 reported by rizzo)

........
r48782 | file | 2006-12-21 14:25:01 -0600 (Thu, 21 Dec 2006) | 2 lines

Add new silence sound files to the spec for Redhat. (issue #8652 reported by alvaro_palma_aste)

........
r48939 | russell | 2006-12-24 00:47:29 -0600 (Sun, 24 Dec 2006) | 3 lines

Remove a couple of misplaced dots in log messages.  This was reported by
Andrea Spadaccini on the asterisk-dev mailing list.

........
r48943 | russell | 2006-12-24 01:23:07 -0600 (Sun, 24 Dec 2006) | 3 lines

Check for the proper return value on an error in a call to mmap().
This was reported by Andy Wang on the asterisk-dev list.  Thanks!

........
r48955 | russell | 2006-12-24 23:19:48 -0600 (Sun, 24 Dec 2006) | 6 lines

Fix an error introduced by copying and pasting the handling of the >= operator
for the MATH function.  If a single equal sign was used as an operator, the
function would treat it is as if it were the >= operator.  Now, it properly
handles it as an invalid operator.
(issue #8665, patch by tempest1)

........
r48974 | oej | 2006-12-27 09:43:52 -0600 (Wed, 27 Dec 2006) | 2 lines

Issue 8596: Set CAN_BYE flag for 100 trying too

........
r49045 | kpfleming | 2006-12-28 18:32:32 -0600 (Thu, 28 Dec 2006) | 2 lines

location of the bug posting guidelines has changed

........
r49135 | crichter | 2007-01-02 04:07:22 -0600 (Tue, 02 Jan 2007) | 1 line

added check for channel ranges in the set/empty channel functions. set pmp_l1_check default to no. added misdn restart pid cli command. added cleaning of channel when we send a RELEASE_COMPLETE. 
........
r49303 | crichter | 2007-01-03 02:24:00 -0600 (Wed, 03 Jan 2007) | 9 lines

* Added check for bridging in misdn_call to avoid setting echocancellation
  when 2 mISDN channels are involved and when bridging is set. That lead
  to a kernel panic before under different situations, because we switched 
  about 2 times between hardware bridging and echocancelation
* readded MISDN_URATE variable which got lost before, this should make app_v110
  work again
* fixed typo


........

Modified:
    team/anthonyl/voicemail-odbc/   (props changed)
    team/anthonyl/voicemail-odbc/BUGS
    team/anthonyl/voicemail-odbc/apps/app_dial.c
    team/anthonyl/voicemail-odbc/channels/chan_iax2.c
    team/anthonyl/voicemail-odbc/channels/chan_misdn.c
    team/anthonyl/voicemail-odbc/channels/chan_sip.c
    team/anthonyl/voicemail-odbc/channels/misdn/isdn_lib.c
    team/anthonyl/voicemail-odbc/channels/misdn/isdn_lib.h
    team/anthonyl/voicemail-odbc/channels/misdn_config.c
    team/anthonyl/voicemail-odbc/configs/misdn.conf.sample
    team/anthonyl/voicemail-odbc/funcs/func_math.c
    team/anthonyl/voicemail-odbc/redhat/asterisk.spec

Propchange: team/anthonyl/voicemail-odbc/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jan  3 16:21:58 2007
@@ -1,1 +1,1 @@
-/branches/1.2:1-48455
+/branches/1.2:1-49346

Modified: team/anthonyl/voicemail-odbc/BUGS
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/BUGS?view=diff&rev=49349&r1=49348&r2=49349
==============================================================================
--- team/anthonyl/voicemail-odbc/BUGS (original)
+++ team/anthonyl/voicemail-odbc/BUGS Wed Jan  3 16:21:58 2007
@@ -10,7 +10,7 @@
 learn how you can contribute by acting as a bug marshall
 please see:
 
-	http://www.digium.com/index.php?menu=bugguidelines
+	http://www.asterisk.org/developers/bug-guidelines
 
 If you would like to submit a feature request, please
 resist the temptation to post it to the bug tracker.

Modified: team/anthonyl/voicemail-odbc/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/apps/app_dial.c?view=diff&rev=49349&r1=49348&r2=49349
==============================================================================
--- team/anthonyl/voicemail-odbc/apps/app_dial.c (original)
+++ team/anthonyl/voicemail-odbc/apps/app_dial.c Wed Jan  3 16:21:58 2007
@@ -1058,6 +1058,7 @@
 			cur = rest;
 			if (!cur)
 				chan->hangupcause = cause;
+			free(tmp);
 			continue;
 		}
 		pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
@@ -1096,6 +1097,7 @@
 			if (!tmp->chan) {
 				HANDLE_CAUSE(cause, chan);
 				cur = rest;
+				free(tmp);
 				continue;
 			}
 		}
@@ -1163,6 +1165,7 @@
 			ast_hangup(tmp->chan);
 			tmp->chan = NULL;
 			cur = rest;
+			free(tmp);
 			continue;
 		} else {
 			senddialevent(chan, tmp->chan);

Modified: team/anthonyl/voicemail-odbc/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/channels/chan_iax2.c?view=diff&rev=49349&r1=49348&r2=49349
==============================================================================
--- team/anthonyl/voicemail-odbc/channels/chan_iax2.c (original)
+++ team/anthonyl/voicemail-odbc/channels/chan_iax2.c Wed Jan  3 16:21:58 2007
@@ -1260,7 +1260,7 @@
 		return -1;
 	}
 	fwh = mmap(NULL, stbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0); 
-	if (!fwh) {
+	if (fwh == (void *) -1) {
 		ast_log(LOG_WARNING, "mmap failed: %s\n", strerror(errno));
 		close(fd);
 		return -1;

Modified: team/anthonyl/voicemail-odbc/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/channels/chan_misdn.c?view=diff&rev=49349&r1=49348&r2=49349
==============================================================================
--- team/anthonyl/voicemail-odbc/channels/chan_misdn.c (original)
+++ team/anthonyl/voicemail-odbc/channels/chan_misdn.c Wed Jan  3 16:21:58 2007
@@ -124,7 +124,6 @@
 	/* misdn_hangup */
 	MISDN_HOLDED, /*!< if this chan is holded */
 	MISDN_HOLD_DISCONNECT, /*!< if this chan is holded */
-	MISDN_FIXUP/*!< if this chan is holded */
   
 };
 
@@ -579,6 +578,20 @@
 	return 0;
 }
 
+static int misdn_restart_pid (int fd, int argc, char *argv[])
+{
+	int pid;
+  
+	if (argc != 4)
+		return RESULT_SHOWUSAGE;
+  
+	pid = atoi(argv[3]);
+
+	misdn_lib_pid_restart(pid);
+
+	return 0;
+}
+
 static int misdn_port_up (int fd, int argc, char *argv[])
 {
 	int port;
@@ -684,7 +697,6 @@
 	{MISDN_HUNGUP_FROM_MISDN,"HUNGUP_FROM_MISDN"}, /* when DISCONNECT/RELEASE/REL_COMP  cam from misdn */
 	{MISDN_HOLDED,"HOLDED"}, /* when DISCONNECT/RELEASE/REL_COMP  cam from misdn */
 	{MISDN_HOLD_DISCONNECT,"HOLD_DISCONNECT"}, /* when DISCONNECT/RELEASE/REL_COMP  cam from misdn */
-	{MISDN_FIXUP,"FIXUP"}, /**/
 	{MISDN_HUNGUP_FROM_AST,"HUNGUP_FROM_AST"} /* when DISCONNECT/RELEASE/REL_COMP came out of */
 	/* misdn_hangup */
 };
@@ -1157,6 +1169,13 @@
   "Usage: misdn restart port\n"
 };
 
+static struct ast_cli_entry cli_restart_pid =
+{ {"misdn","restart","pid", NULL},
+  misdn_restart_pid,
+  "Restarts the given pid", 
+  "Usage: misdn restart pid\n"
+};
+
 static struct ast_cli_entry cli_port_up =
 { {"misdn","port","up", NULL},
   misdn_port_up,
@@ -1675,6 +1694,15 @@
 			misdn_set_opt_exec(ast,opts);
 		else
 			chan_misdn_log(2,port,"NO OPTS GIVEN\n");
+
+		/*check for bridging*/
+		int bridging;
+		misdn_cfg_get( 0, MISDN_GEN_BRIDGING, &bridging, sizeof(int));
+		if (bridging && ch->other_ch) {
+			chan_misdn_log(0, port, "Disabling EC on both Sides\n");	
+			ch->bc->ec_enable=0;
+			ch->other_ch->bc->ec_enable=0;
+		}
 		
 		r=misdn_lib_send_event( newbc, EVENT_SETUP );
 		
@@ -1750,7 +1778,6 @@
 	}
 	
 	p->state = MISDN_CONNECTED;
-	misdn_lib_echo(p->bc,0);
 	stop_indicate(p);
 
 	if ( ast_strlen_zero(p->bc->cad) ) {
@@ -1831,7 +1858,6 @@
 	chan_misdn_log(1, p->bc?p->bc->port:0, "* IND: Got Fixup State:%s L3id:%x\n", misdn_get_ch_state(p), p->l3id);
 	
 	p->ast = ast ;
-	p->state=MISDN_FIXUP;
   
 	return 0;
 }
@@ -1998,7 +2024,6 @@
 	if (ast->_state == AST_STATE_RESERVED || 
 		p->state == MISDN_NOTHING || 
 		p->state == MISDN_HOLDED || 
-		p->state == MISDN_FIXUP || 
 		p->state == MISDN_HOLD_DISCONNECT ) {
 
 		CLEAN_CH:
@@ -2299,27 +2324,12 @@
 	if (ch1 && ch2 ) ;
 	else
 		return -1;
-  
 
 	int bridging;
 	misdn_cfg_get( 0, MISDN_GEN_BRIDGING, &bridging, sizeof(int));
 	if (bridging) {
-		int ec;
-		misdn_cfg_get( ch1->bc->port, MISDN_CFG_ECHOCANCEL, &ec, sizeof(int));
-		if ( ec ) {
-			chan_misdn_log(2, ch1->bc->port, "Disabling Echo Cancellor when Bridged\n");
-			ch1->bc->ec_enable=0;
-			manager_ec_disable(ch1->bc);
-		}
-		misdn_cfg_get( ch2->bc->port, MISDN_CFG_ECHOCANCEL, &ec, sizeof(int));
-		if ( ec ) {
-			chan_misdn_log(2, ch2->bc->port, "Disabling Echo Cancellor when Bridged\n");
-			ch2->bc->ec_enable=0;
-			manager_ec_disable(ch2->bc); 
-		}
 		/* trying to make a mISDN_dsp conference */
 		chan_misdn_log(1, ch1->bc->port, "I SEND: Making conference with Number:%d\n", ch1->bc->pid +1);
-
 		misdn_lib_bridge(ch1->bc,ch2->bc);
 	}
 	
@@ -2397,6 +2407,10 @@
 	const struct tone_zone_sound *ts= NULL;
 	struct ast_channel *ast=cl->ast;
 
+	if (!ast) {
+		chan_misdn_log(0,cl->bc->port,"No Ast in dialtone_indicate\n");
+		return -1;
+	}
 
 	int nd=0;
 	misdn_cfg_get( cl->bc->port, MISDN_CFG_NODIALTONE, &nd, sizeof(nd));
@@ -2430,6 +2444,12 @@
 static int stop_indicate(struct chan_list *cl)
 {
 	struct ast_channel *ast=cl->ast;
+
+	if (!ast) {
+		chan_misdn_log(0,cl->bc->port,"No Ast in stop_indicate\n");
+		return -1;
+	}
+
 	chan_misdn_log(3,cl->bc->port," --> None\n");
 	misdn_lib_tone_generator_stop(cl->bc);
 	ast_playtones_stop(ast);
@@ -3202,6 +3222,11 @@
 		sprintf(tmp,"%d",bc->sending_complete);
 		pbx_builtin_setvar_helper(chan,"MISDN_ADDRESS_COMPLETE",tmp);
 	}
+
+	if (bc->urate) {
+		sprintf(tmp,"%d",bc->urate);
+		pbx_builtin_setvar_helper(chan,"MISDN_URATE",tmp);
+	}
 }
 
 
@@ -3216,7 +3241,6 @@
 	
 	if (event != EVENT_BCHAN_DATA && event != EVENT_TONE_GENERATE) { /*  Debug Only Non-Bchan */
 		int debuglevel=1;
-	
 		if ( event==EVENT_CLEANUP && !user_data)
 			debuglevel=5;
 
@@ -3760,8 +3784,6 @@
 		misdn_lib_send_event(bc,EVENT_CONNECT_ACKNOWLEDGE);
 	
 		struct ast_channel *bridged=AST_BRIDGED_P(ch->ast);
-		
-		misdn_lib_echo(bc,0);
 		stop_indicate(ch);
 
 		if (bridged && !strcasecmp(bridged->tech->type,"mISDN")) {
@@ -4209,6 +4231,7 @@
 	ast_cli_register(&cli_port_block);
 	ast_cli_register(&cli_port_unblock);
 	ast_cli_register(&cli_restart_port);
+	ast_cli_register(&cli_restart_pid);
 	ast_cli_register(&cli_port_up);
 	ast_cli_register(&cli_port_down);
 	ast_cli_register(&cli_set_debug);
@@ -4274,7 +4297,7 @@
 	ast_cli_unregister(&cli_show_stacks);
 	ast_cli_unregister(&cli_port_block);
 	ast_cli_unregister(&cli_port_unblock);
-	ast_cli_unregister(&cli_restart_port);
+	ast_cli_unregister(&cli_restart_pid);
 	ast_cli_unregister(&cli_port_up);
 	ast_cli_unregister(&cli_port_down);
 	ast_cli_unregister(&cli_set_debug);

Modified: team/anthonyl/voicemail-odbc/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/channels/chan_sip.c?view=diff&rev=49349&r1=49348&r2=49349
==============================================================================
--- team/anthonyl/voicemail-odbc/channels/chan_sip.c (original)
+++ team/anthonyl/voicemail-odbc/channels/chan_sip.c Wed Jan  3 16:21:58 2007
@@ -2325,6 +2325,7 @@
 		case 502:	
 			return AST_CAUSE_DESTINATION_OUT_OF_ORDER;
 		case 503:	/* Service unavailable */
+		case 504:	/* Server timeout */
 			return AST_CAUSE_CONGESTION;
 		default:
 			return AST_CAUSE_NORMAL;
@@ -9713,6 +9714,7 @@
 		if (!ignore)
 			sip_cancel_destroy(p);
 		check_pendings(p);
+		ast_set_flag(p, SIP_CAN_BYE);
 		break;
 	case 180:	/* 180 Ringing */
 		if (!ignore)
@@ -10206,6 +10208,7 @@
 				case 400: /* Bad Request */
 				case 500: /* Server error */
 				case 503: /* Service Unavailable */
+				case 504: /* Server Timeout */
 					if (owner)
 						ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
 					break;
@@ -10299,6 +10302,7 @@
 				case 603: /* Decline */
 				case 500: /* Server error */
 				case 503: /* Service Unavailable */
+				case 504: /* Server timeout */
 
 					if (sipmethod == SIP_INVITE && !ignore) {	/* re-invite failed */
 						sip_cancel_destroy(p);
@@ -10918,11 +10922,11 @@
 	} else if (p->owner) {
 		ast_queue_hangup(p->owner);
 		if (option_debug > 2)
-			ast_log(LOG_DEBUG, "Received bye, issuing owner hangup\n.");
+			ast_log(LOG_DEBUG, "Received bye, issuing owner hangup\n");
 	} else {
 		ast_set_flag(p, SIP_NEEDDESTROY);	
 		if (option_debug > 2)
-			ast_log(LOG_DEBUG, "Received bye, no owner, selfdestruct soon.\n.");
+			ast_log(LOG_DEBUG, "Received bye, no owner, selfdestruct soon.\n");
 	}
 	transmit_response(p, "200 OK", req);
 

Modified: team/anthonyl/voicemail-odbc/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/channels/misdn/isdn_lib.c?view=diff&rev=49349&r1=49348&r2=49349
==============================================================================
--- team/anthonyl/voicemail-odbc/channels/misdn/isdn_lib.c (original)
+++ team/anthonyl/voicemail-odbc/channels/misdn/isdn_lib.c Wed Jan  3 16:21:58 2007
@@ -174,6 +174,7 @@
 int manager_isdn_handler(iframe_t *frm ,msg_t *msg);
 
 int misdn_lib_port_restart(int port);
+int misdn_lib_pid_restart(int pid);
 
 extern struct isdn_msg msgs_g[]; 
 
@@ -433,7 +434,6 @@
 		if (i != 15 && (channel < 0 || i == channel)) { /* skip E1 Dchannel ;) and work with chan preselection */
 			if (!stack->channels[i]) {
 				cb_log (3, stack->port, " --> found chan%s: %d\n", channel>=0?" (preselected)":"", i+1);
-				stack->channels[i] = 1;
 				return i+1;
 			}
 		}
@@ -447,8 +447,8 @@
 
 int empty_chan_in_stack(struct misdn_stack *stack, int channel)
 {
-	if (channel<=0) {
-		cb_log(0,stack?stack->port:0, "empty_chan_inst_stack: cannot empty channel %d\n",channel);
+	if (channel<=0 || channel>=MAX_BCHANS) {
+		cb_log(0,stack?stack->port:0, "empty_chan_in_stack: cannot empty channel %d\n",channel);
 		return -1;
 	}
 	
@@ -666,10 +666,17 @@
 {
 
 	cb_log(4,stack->port,"set_chan_in_stack: %d\n",channel);
-	if (channel >=1 ) {
-		stack->channels[channel-1] = 1;
+	dump_chan_list(stack);
+	if (channel >=1 && channel <= MAX_BCHANS) {
+		if (!stack->channels[channel-1])
+			stack->channels[channel-1] = 1;
+		else {
+			cb_log(0,stack->port,"channel already in use:%d\n", channel );
+			return -1;
+		}
 	} else {
 		cb_log(0,stack->port,"couldn't set channel %d in\n", channel );
+		return -1;
 	}
   
 	return 0;
@@ -814,6 +821,8 @@
 		free_chan = find_free_chan_in_stack(stack, bc->channel_preselected?bc->channel:0);
 		if (!free_chan) return -1;
 		bc->channel=free_chan;
+
+		if (set_chan_in_stack(stack ,bc->channel)<0) return -1;
 		
 		cb_log(4,stack->port, " -->  found channel: %d\n",free_chan);
     
@@ -845,6 +854,7 @@
 			if (!free_chan) return -1;
 			bc->channel=free_chan;
 			cb_log(2,stack->port, " -->  found channel: %d\n",free_chan);
+			if (set_chan_in_stack(stack ,bc->channel)<0) return -1;
 		} else {
 			/* other phones could have made a call also on this port (ptmp) */
 			bc->channel=0xff;
@@ -1468,27 +1478,27 @@
 		setup_bc(bc);
 
 		case EVENT_SETUP:
-			
 		{
 			if (bc->channel == 0xff) {
 				bc->channel=find_free_chan_in_stack(stack, 0);
 				if (!bc->channel) {
 					cb_log(0, stack->port, "Any Channel Requested, but we have no more!!\n");
-					break;
+					bc->out_cause=34;
+					misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
+					return -1;
 				}
-			}  
+			} 
 
 			if (bc->channel >0 && bc->channel<255) {
-				set_chan_in_stack(stack ,bc->channel);
-			}
-
-#if 0
-			int ret=setup_bc(bc);
-			if (ret == -EINVAL){
-				cb_log(0,bc->port,"handle_event: setup_bc failed\n");
-				misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
-			}
-#endif
+				int ret=set_chan_in_stack(stack ,bc->channel);
+				if (event == EVENT_SETUP && ret<0){
+					/* empty bchannel */
+					bc->channel=0;
+					bc->out_cause=44;
+					misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
+					return -1;
+				}
+			}
 		}
 		break;
 
@@ -1790,12 +1800,6 @@
 			cb_log(7, stack->port, " --> new_process: New L3Id: %x\n",hh->dinfo);
 			bc->l3_id=hh->dinfo;
 
-			if (bc->channel<=0) {
-				bc->channel=find_free_chan_in_stack(stack,0);
-
-				if (bc->channel<=0)
-					goto ERR_NO_CHANNEL;
-			}
 		}
 		break;
 
@@ -2023,32 +2027,22 @@
 
 			switch (event) {
 				case EVENT_SETUP:
-					if (bc->channel>0 && bc->channel<255) {
-
-						if (stack->ptp) 
-							set_chan_in_stack(stack, bc->channel);
-						else 
-							cb_log(3,stack->port," --> PTMP but channel requested\n");
-
-					} else {
-
-						bc->channel = find_free_chan_in_stack(stack, 0);
-						if (!bc->channel) {
-							cb_log(0, stack->port, " No free channel at the moment\n");
-					
-							msg_t *dmsg;
-				
-							cb_log(0, stack->port, "Releaseing call %x (No free Chan for you..)\n", hh->dinfo);
-								dmsg = create_l3msg(CC_RELEASE_COMPLETE | REQUEST,MT_RELEASE_COMPLETE, hh->dinfo,sizeof(RELEASE_COMPLETE_t), 1);
-							stack->nst.manager_l3(&stack->nst, dmsg);
-							free_msg(msg);
-							return 0;
-						}
-						
+					if (bc->channel<=0 || bc->channel==0xff) {
+						bc->channel=find_free_chan_in_stack(stack,0);
+		
+						if (bc->channel<=0)
+							goto ERR_NO_CHANNEL;
+					} else if (!stack->ptp) 
+						cb_log(3,stack->port," --> PTMP but channel requested\n"); 
+
+					int ret=set_chan_in_stack(stack, bc->channel);
+					if (event==EVENT_SETUP && ret<0){
+						/* empty bchannel */
+						bc->channel=0;
+						bc->out_cause=44;
+
+						goto ERR_NO_CHANNEL;
 					}
-#if 0
-					setup_bc(bc);
-#endif
 
 					break;
 				case EVENT_RELEASE:
@@ -2592,7 +2586,12 @@
 			isdn_msg_parse_event(msgs_g,msg,bc, 0);
 			
 			/** Preprocess some Events **/
-			handle_event(bc, event, frm);
+			int ret=handle_event(bc, event, frm);
+			if (ret<0) {
+				cb_log(0,stack->port,"couldn't handle event\n");
+				free_msg(msg);
+				return 1;
+			}
 			/*  shoot up event to App: */
 			cb_log(5, stack->port, "lib Got Prim: Addr %x prim %x dinfo %x\n",frm->addr, frm->prim, frm->dinfo);
       
@@ -2809,7 +2808,6 @@
 				stack->l1link=0;
 
 			clear_l3(stack);
-			
 			break;
 
 		case SSTATUS_L2_ESTABLISHED:
@@ -3206,7 +3204,13 @@
 				bc->channel = find_free_chan_in_stack(stack, 0);
 				if (!bc->channel) {
 					cb_log(0, stack->port, " No free channel at the moment\n");
-					
+					/*FIXME: add disconnect*/
+					err=-ENOCHAN;
+					goto ERR;
+				}
+				
+				if (set_chan_in_stack(stack ,bc->channel)<0) {
+					/*FIXME: add disconnect*/
 					err=-ENOCHAN;
 					goto ERR;
 				}
@@ -3303,6 +3307,16 @@
 		bc->need_disconnect=0;
 		bc->need_release=0;
 		bc->need_release_complete=0;
+
+		if (!stack->nt) {
+			/*create clenaup in TE*/
+			if (bc->channel>0)
+				empty_chan_in_stack(stack,bc->channel);
+			int tmpcause=bc->cause;	
+			empty_bc(bc);
+			bc->cause=tmpcause;
+			clean_up_bc(bc);
+		}
 		break;
     
 	case EVENT_CONNECT_ACKNOWLEDGE:
@@ -3552,6 +3566,16 @@
 
 	return 0; 
 
+}
+
+int misdn_lib_pid_restart(int pid) 
+{
+	struct misdn_bchannel *bc=manager_find_bc_by_pid(pid);
+
+	if (bc) {
+		manager_clean_bc(bc);
+	}
+	return 0;
 }
 
 int misdn_lib_port_restart(int port)
@@ -4038,7 +4062,7 @@
 		empty_chan_in_stack(stack, bc->channel);
 	empty_bc(bc);
   
-	misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
+	cb_event(EVENT_CLEANUP, bc, NULL); 
 }
 
 

Modified: team/anthonyl/voicemail-odbc/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/channels/misdn/isdn_lib.h?view=diff&rev=49349&r1=49348&r2=49349
==============================================================================
--- team/anthonyl/voicemail-odbc/channels/misdn/isdn_lib.h (original)
+++ team/anthonyl/voicemail-odbc/channels/misdn/isdn_lib.h Wed Jan  3 16:21:58 2007
@@ -413,6 +413,8 @@
 
 
 int misdn_lib_port_restart(int port);
+int misdn_lib_pid_restart(int pid);
+
 int misdn_lib_get_port_info(int port);
 
 int misdn_lib_is_port_blocked(int port);

Modified: team/anthonyl/voicemail-odbc/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/channels/misdn_config.c?view=diff&rev=49349&r1=49348&r2=49349
==============================================================================
--- team/anthonyl/voicemail-odbc/channels/misdn_config.c (original)
+++ team/anthonyl/voicemail-odbc/channels/misdn_config.c Wed Jan  3 16:21:58 2007
@@ -89,7 +89,7 @@
 	{ "txgain", MISDN_CFG_TXGAIN, MISDN_CTYPE_INT, "0", NONE },
 	{ "te_choose_channel", MISDN_CFG_TE_CHOOSE_CHANNEL, MISDN_CTYPE_BOOL, "no", NONE },
 	{ "far_alerting", MISDN_CFG_FAR_ALERTING, MISDN_CTYPE_BOOL, "no", NONE },
-	{ "pmp_l1_check", MISDN_CFG_PMP_L1_CHECK, MISDN_CTYPE_BOOL, "yes", NONE },
+	{ "pmp_l1_check", MISDN_CFG_PMP_L1_CHECK, MISDN_CTYPE_BOOL, "no", NONE },
 	{ "reject_cause", MISDN_CFG_REJECT_CAUSE, MISDN_CTYPE_INT, "21", NONE },
 	{ "block_on_alarm", MISDN_CFG_ALARM_BLOCK, MISDN_CTYPE_BOOL, "no", NONE },
 	{ "hdlc", MISDN_CFG_HDLC, MISDN_CTYPE_BOOL, "no", NONE },

Modified: team/anthonyl/voicemail-odbc/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/configs/misdn.conf.sample?view=diff&rev=49349&r1=49348&r2=49349
==============================================================================
--- team/anthonyl/voicemail-odbc/configs/misdn.conf.sample (original)
+++ team/anthonyl/voicemail-odbc/configs/misdn.conf.sample Wed Jan  3 16:21:58 2007
@@ -183,9 +183,9 @@
 ; as well, since chan_misdn has no chance to distinguish if the L1 is down
 ; because of a lost Link or because the Provider shut it down...
 ;
-; default: yes
-;
-pmp_l1_check=yes
+; default: no
+;
+pmp_l1_check=no
 
 
 

Modified: team/anthonyl/voicemail-odbc/funcs/func_math.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/funcs/func_math.c?view=diff&rev=49349&r1=49348&r2=49349
==============================================================================
--- team/anthonyl/voicemail-odbc/funcs/func_math.c (original)
+++ team/anthonyl/voicemail-odbc/funcs/func_math.c Wed Jan  3 16:21:58 2007
@@ -124,7 +124,6 @@
 			iaction = LTEFUNCTION;
 		}
 	} else if ((op = strchr(mvalue1, '='))) {
-		iaction = GTFUNCTION;
 		*op = '\0';
 		if (*(op+1) == '=') {
 			*++op = '\0';

Modified: team/anthonyl/voicemail-odbc/redhat/asterisk.spec
URL: http://svn.digium.com/view/asterisk/team/anthonyl/voicemail-odbc/redhat/asterisk.spec?view=diff&rev=49349&r1=49348&r2=49349
==============================================================================
--- team/anthonyl/voicemail-odbc/redhat/asterisk.spec (original)
+++ team/anthonyl/voicemail-odbc/redhat/asterisk.spec Wed Jan  3 16:21:58 2007
@@ -88,6 +88,8 @@
 %attr(0644,root,root)      /var/lib/asterisk/sounds/letters/*.gsm
 %attr(0755,root,root) %dir /var/lib/asterisk/sounds/phonetic
 %attr(0644,root,root)      /var/lib/asterisk/sounds/phonetic/*.gsm
+%attr(0755,root,root) %dir /var/lib/asterisk/sounds/silence
+%attr(0644,root,root)      /var/lib/asterisk/sounds/silence/*.gsm
 %attr(0755,root,root) %dir /var/lib/asterisk/mohmp3
 %attr(0644,root,root)      /var/lib/asterisk/mohmp3/*
 %attr(0755,root,root) %dir /var/lib/asterisk/images



More information about the svn-commits mailing list