[Pkg-voip-commits] r5229 - in /asterisk/trunk/debian/patches: misdn_FOP series

maniac-guest at alioth.debian.org maniac-guest at alioth.debian.org
Tue Feb 19 09:59:10 UTC 2008


Author: maniac-guest
Date: Tue Feb 19 09:59:10 2008
New Revision: 5229

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=5229
Log:
patch from bugs.digium.com. Better handling of temporary channel name. Fixes FOP. not applied by default

Added:
    asterisk/trunk/debian/patches/misdn_FOP
Modified:
    asterisk/trunk/debian/patches/series

Added: asterisk/trunk/debian/patches/misdn_FOP
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/misdn_FOP?rev=5229&op=file
==============================================================================
--- asterisk/trunk/debian/patches/misdn_FOP (added)
+++ asterisk/trunk/debian/patches/misdn_FOP Tue Feb 19 09:59:10 2008
@@ -1,0 +1,62 @@
+0011142: [PATCH] Better handling of temporary channel name. Fixes FOP. 
+Description:
+When dialing out a misdn channel, either by using a group (g:group), 
+or a port, asterisk creates the channel with a tmp channel number: mISDN/X-uY,
+with X being (port-1)*2. Y not important.
+ 
+Port 0: temporal channel name 0. BChannels 1 and 2
+Port 1: temporal channel name 2. BChannels 3 and 4
+Port 2: temporal channel name 4. BChannels 5 and 6
+ 
+As you can see, temporal channel for port 1 conflicts with real 
+channel 2 for port 0. This is not consistent.
+ 
+This patch forces temporal channels (those for which we have
+not a B channel yet), to be named mISDN/tmpX-uY.
+ 
+Also, it will rename the channel using the ast_change_name()
+function, which generates "rename" events, and can be followed by manager events.
+ 
+As a plus, it will make FOP work correctly with misdn channels.
+URL: http://bugs.digium.com/view.php?id=0011142 ( julianjm )
+
+ -- Victor Seva <linuxmaniac at torreviejawireless.org>
+--- a/channels/chan_misdn.c
++++ b/channels/chan_misdn.c
+@@ -3340,17 +3340,19 @@ static void update_name(struct ast_chann
+ {
+ 	int chan_offset=0;
+ 	int tmp_port = misdn_cfg_get_next_port(0);
++	char newname[255];
+ 	for (; tmp_port > 0; tmp_port=misdn_cfg_get_next_port(tmp_port)) {
+ 	if (tmp_port == port) break;
+ 		chan_offset+=misdn_lib_port_is_pri(tmp_port)?30:2;	
+ 	}
+ 	if (c<0) c=0;
+ 
+-	ast_string_field_build(tmp, name, "%s/%d-u%d",
+-				 misdn_type, chan_offset+c, glob_channel++);
+-
+-	chan_misdn_log(3,port," --> updating channel name to [%s]\n",tmp->name);
+-	
++	snprintf(newname,sizeof(newname),"%s/%d-",misdn_type,chan_offset+c);
++	if (strncmp(tmp->name,newname,strlen(newname))) {
++		snprintf(newname,sizeof(newname),"%s/%d-u%d", misdn_type, chan_offset+c, glob_channel++);
++		ast_change_name(tmp,newname);
++		chan_misdn_log(3,port," --> updating channel name to [%s]\n",tmp->name);
++	}
+ }
+ 
+ static struct ast_channel *misdn_new(struct chan_list *chlist, int state,  char *exten, char *callerid, int format, int port, int c)
+@@ -3370,7 +3372,10 @@ static struct ast_channel *misdn_new(str
+ 	if (callerid) 
+ 		ast_callerid_parse(callerid, &cid_name, &cid_num);
+ 
+-	tmp = ast_channel_alloc(1, state, cid_num, cid_name, "", exten, "", 0, "%s/%d-u%d", misdn_type, chan_offset + c, glob_channel++);
++	if (c)
++		tmp = ast_channel_alloc(1, state, cid_num, cid_name, "", exten, "", 0, "%s/%d-u%d", misdn_type, chan_offset + c, glob_channel++);
++	else
++		tmp = ast_channel_alloc(1, state, cid_num, cid_name, "", exten, "", 0, "%s/tmp%d-u%d", misdn_type, chan_offset + c, glob_channel++);
+ 	
+ 	if (tmp) {
+ 		int bridging;

Modified: asterisk/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/series?rev=5229&op=diff
==============================================================================
--- asterisk/trunk/debian/patches/series (original)
+++ asterisk/trunk/debian/patches/series Tue Feb 19 09:59:10 2008
@@ -84,3 +84,6 @@
 #bristuff/find-feature
 #bristuff/feature-parking_con
 
+# FOP fix on chan_misdn.c from bugs.digium.org
+# 0011142: [PATCH] Better handling of temporary channel name.
+#misdn_FOP




More information about the Pkg-voip-commits mailing list