[asterisk-commits] branch group/new_loader_completion r23558 - in
/team/group/new_loader_complet...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sun Apr 30 02:27:15 MST 2006
Author: kpfleming
Date: Sun Apr 30 04:27:14 2006
New Revision: 23558
URL: http://svn.digium.com/view/asterisk?rev=23558&view=rev
Log:
fix merge conflicts, reset automerge
fix chan_phone since it builds on this box :-)
Removed:
team/group/new_loader_completion/mxml/.cvsignore
team/group/new_loader_completion/mxml/configure.in
Modified:
team/group/new_loader_completion/ (props changed)
team/group/new_loader_completion/Makefile
team/group/new_loader_completion/acinclude.m4
team/group/new_loader_completion/app.c
team/group/new_loader_completion/apps/Makefile
team/group/new_loader_completion/asterisk.c
team/group/new_loader_completion/build_tools/cflags.xml
team/group/new_loader_completion/channel.c
team/group/new_loader_completion/channels/chan_h323.c
team/group/new_loader_completion/channels/chan_misdn.c
team/group/new_loader_completion/channels/chan_phone.c
team/group/new_loader_completion/channels/misdn/isdn_lib.c
team/group/new_loader_completion/channels/misdn/isdn_lib_intern.h
team/group/new_loader_completion/cli.c
team/group/new_loader_completion/devicestate.c
team/group/new_loader_completion/include/asterisk/frame.h
team/group/new_loader_completion/manager.c
team/group/new_loader_completion/mxml/Makefile.in
team/group/new_loader_completion/pbx.c
team/group/new_loader_completion/pbx/ael/ael.flex
team/group/new_loader_completion/pbx/ael/ael.tab.c
team/group/new_loader_completion/pbx/ael/ael.y
team/group/new_loader_completion/pbx/ael/ael_lex.c
team/group/new_loader_completion/pbx/pbx_dundi.c
team/group/new_loader_completion/res/res_agi.c
team/group/new_loader_completion/res/res_clioriginate.c
team/group/new_loader_completion/res/res_features.c
team/group/new_loader_completion/res/res_monitor.c
team/group/new_loader_completion/res/res_musiconhold.c
team/group/new_loader_completion/res/snmp/agent.c
team/group/new_loader_completion/udptl.c
team/group/new_loader_completion/utils/ (props changed)
team/group/new_loader_completion/utils/Makefile
Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
automerge = *
Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/group/new_loader_completion/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun Apr 30 04:27:14 2006
@@ -1,1 +1,1 @@
-/trunk:1-23250
+/trunk:1-23556
Modified: team/group/new_loader_completion/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/Makefile?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/Makefile (original)
+++ team/group/new_loader_completion/Makefile Sun Apr 30 04:27:14 2006
@@ -252,7 +252,7 @@
ID=/usr/xpg4/bin/id
endif
-INCLUDE+=-Iinclude -I../include
+INCLUDE+=-Iinclude -I../include -I..
ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) #-DMAKE_VALGRIND_HAPPY
ASTCFLAGS+=$(OPTIMIZE)
@@ -580,7 +580,7 @@
# improved a lot. I'll put it here for now.
mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http
for x in static-http/*; do \
- install -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
done
mkdir -p $(DESTDIR)$(ASTDATADIR)/sounds/digits
mkdir -p $(DESTDIR)$(ASTDATADIR)/sounds/priv-callerintros
@@ -683,7 +683,6 @@
cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
fi
- for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
$(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
if [ -n "$(OLDHEADERS)" ]; then \
@@ -708,28 +707,9 @@
echo "You need to do cvs update -d not just cvs update" ; \
fi
if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
- @echo " +---- Asterisk Installation Complete -------+"
- @echo " + +"
- @echo " + YOU MUST READ THE SECURITY DOCUMENT +"
- @echo " + +"
- @echo " + Asterisk has successfully been installed. +"
- @echo " + If you would like to install the sample +"
- @echo " + configuration files (overwriting any +"
- @echo " + existing config files), run: +"
- @echo " + +"
- @echo " + $(MAKE) samples +"
- @echo " + +"
- @echo " +----------------- or ---------------------+"
- @echo " + +"
- @echo " + You can go ahead and install the asterisk +"
- @echo " + program documentation now or later run: +"
- @echo " + +"
- @echo " + $(MAKE) progdocs +"
- @echo " + +"
- @echo " + **Note** This requires that you have +"
- @echo " + doxygen installed on your local system +"
- @echo " +-------------------------------------------+"
- @$(MAKE) -s oldmodcheck
+
+install-subdirs:
+ for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
NEWMODS=$(notdir $(wildcard */*.so))
OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
@@ -752,10 +732,32 @@
echo " WARNING WARNING WARNING" ;\
fi
-install: all datafiles bininstall
+install: all datafiles bininstall install-subdirs
@if [ -x /usr/sbin/asterisk-post-install ]; then \
/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
fi
+ @echo " +---- Asterisk Installation Complete -------+"
+ @echo " + +"
+ @echo " + YOU MUST READ THE SECURITY DOCUMENT +"
+ @echo " + +"
+ @echo " + Asterisk has successfully been installed. +"
+ @echo " + If you would like to install the sample +"
+ @echo " + configuration files (overwriting any +"
+ @echo " + existing config files), run: +"
+ @echo " + +"
+ @echo " + $(MAKE) samples +"
+ @echo " + +"
+ @echo " +----------------- or ---------------------+"
+ @echo " + +"
+ @echo " + You can go ahead and install the asterisk +"
+ @echo " + program documentation now or later run: +"
+ @echo " + +"
+ @echo " + $(MAKE) progdocs +"
+ @echo " + +"
+ @echo " + **Note** This requires that you have +"
+ @echo " + doxygen installed on your local system +"
+ @echo " +-------------------------------------------+"
+ @$(MAKE) -s oldmodcheck
upgrade: all bininstall
Modified: team/group/new_loader_completion/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/acinclude.m4?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/acinclude.m4 (original)
+++ team/group/new_loader_completion/acinclude.m4 Sun Apr 30 04:27:14 2006
@@ -20,7 +20,7 @@
PBX_LIB$1=0
if test "${USE_$1}" != "no"; then
- AC_CHECK_LIB([$1], [$2], [], [], -L${$1_DIR}/lib $6)
+ AC_CHECK_LIB([$1], [$2], [:], [], -L${$1_DIR}/lib $6)
if test "${ac_cv_lib_$1_$2}" = "yes"; then
$1_LIB="-l$1 $6"
@@ -68,7 +68,7 @@
AC_DEFUN(
-[AST_CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make, GNU_MAKE,
+[AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK(for GNU make, GNU_MAKE,
GNU_MAKE='Not Found' ;
for a in make gmake gnumake ; do
if test -z "$a" ; then continue ; fi ;
@@ -83,4 +83,4 @@
exit 1
fi
AC_SUBST([GNU_MAKE])
-] )
+])
Modified: team/group/new_loader_completion/app.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/app.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/app.c (original)
+++ team/group/new_loader_completion/app.c Sun Apr 30 04:27:14 2006
@@ -1042,7 +1042,7 @@
test = pbx_builtin_getvar_helper(chan, cat);
if (test && !strcasecmp(test, group))
count++;
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
}
return count;
@@ -1072,7 +1072,7 @@
test = pbx_builtin_getvar_helper(chan, cat);
if (test && !regexec(®exbuf, test, 0, NULL, 0))
count++;
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
}
regfree(®exbuf);
Modified: team/group/new_loader_completion/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/apps/Makefile?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/apps/Makefile (original)
+++ team/group/new_loader_completion/apps/Makefile Sun Apr 30 04:27:14 2006
@@ -41,7 +41,7 @@
$(CC) $(SOLINK) -o $@ $< $(ZAPTEL_LIB)
app_rpt.o: app_rpt.c
- $(CC) $(SOLINK) -o $@ $< $(ZAPTEL_INCLUDE)
+ $(CC) $(SOLINK) -o $@ $< $(ZAPTEL_INCLUDE)
install: all
for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
Modified: team/group/new_loader_completion/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/asterisk.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/asterisk.c (original)
+++ team/group/new_loader_completion/asterisk.c Sun Apr 30 04:27:14 2006
@@ -111,9 +111,7 @@
#include "asterisk/enum.h"
#include "asterisk/rtp.h"
#include "asterisk/http.h"
-#if defined(T38_SUPPORT)
#include "asterisk/udptl.h"
-#endif
#include "asterisk/app.h"
#include "asterisk/lock.h"
#include "asterisk/utils.h"
@@ -2582,9 +2580,7 @@
exit(1);
}
ast_rtp_init();
-#if defined(T38_SUPPORT)
ast_udptl_init();
-#endif
if (ast_image_init()) {
printf(term_quit());
exit(1);
Modified: team/group/new_loader_completion/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/build_tools/cflags.xml?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/build_tools/cflags.xml (original)
+++ team/group/new_loader_completion/build_tools/cflags.xml Sun Apr 30 04:27:14 2006
@@ -17,7 +17,4 @@
</member>
<member name="-DMTX_PROFILE">
</member>
- <member name="-DT38_SUPPORT">
- <defaultenabled>yes</defaultenabled>
- </member>
</category>
Modified: team/group/new_loader_completion/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channel.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/channel.c (original)
+++ team/group/new_loader_completion/channel.c Sun Apr 30 04:27:14 2006
@@ -3330,9 +3330,7 @@
(f->frametype == AST_FRAME_VIDEO) ||
(f->frametype == AST_FRAME_IMAGE) ||
(f->frametype == AST_FRAME_HTML) ||
-#if defined(T38_SUPPORT)
(f->frametype == AST_FRAME_MODEM) ||
-#endif
(f->frametype == AST_FRAME_TEXT)) {
/* monitored dtmf causes exit from bridge */
int monitored_source = (who == c0) ? watch_c0_dtmf : watch_c1_dtmf;
Modified: team/group/new_loader_completion/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_h323.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_h323.c (original)
+++ team/group/new_loader_completion/channels/chan_h323.c Sun Apr 30 04:27:14 2006
@@ -180,10 +180,6 @@
/** Protect the interface list (oh323_pvt) */
AST_MUTEX_DEFINE_STATIC(iflock);
-/** Usage counter and associated lock */
-static int usecnt = 0;
-AST_MUTEX_DEFINE_STATIC(usecnt_lock);
-
/* Protect the monitoring thread, so only one process can kill or start it, and not
when it's doing something critical. */
AST_MUTEX_DEFINE_STATIC(monlock);
@@ -534,13 +530,8 @@
pvt->needdestroy = 1;
/* Update usage counter */
- ast_mutex_lock(&usecnt_lock);
- usecnt--;
- if (usecnt < 0) {
- ast_log(LOG_WARNING, "Usecnt < 0\n");
- }
- ast_mutex_unlock(&usecnt_lock);
ast_mutex_unlock(&pvt->lock);
+ ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1);
ast_update_use_count();
return 0;
}
@@ -734,9 +725,7 @@
ast_mutex_unlock(&pvt->lock);
ch = ast_channel_alloc(1);
/* Update usage counter */
- ast_mutex_lock(&usecnt_lock);
- usecnt++;
- ast_mutex_unlock(&usecnt_lock);
+ ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1);
ast_update_use_count();
ast_mutex_lock(&pvt->lock);
if (ch) {
@@ -2237,7 +2226,7 @@
return 0;
}
-int reload(void)
+static int reload(void *mod)
{
return h323_reload(0, 0, NULL);
}
@@ -2317,7 +2306,7 @@
.set_rtp_peer= oh323_set_rtp_peer,
};
-int load_module()
+static int load_module(void *mod)
{
int res;
ast_mutex_init(&userl.lock);
@@ -2385,7 +2374,7 @@
return res;
}
-int unload_module()
+static int unload_module(void *mod)
{
struct oh323_pvt *p, *pl;
@@ -2459,18 +2448,14 @@
return 0;
}
-int usecount()
-{
- return usecnt;
-}
-
-const char *description()
-{
- return (char *) desc;
-}
-
-const char *key()
+static const char *description(void)
+{
+ return desc;
+}
+
+static const char *key(void)
{
return ASTERISK_GPL_KEY;
}
+STD_MOD(MOD_1, reload, NULL, NULL);
Modified: team/group/new_loader_completion/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_misdn.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_misdn.c (original)
+++ team/group/new_loader_completion/channels/chan_misdn.c Sun Apr 30 04:27:14 2006
@@ -182,6 +182,9 @@
int addr;
char context[BUFFERSIZE];
+
+ int zero_read_cnt;
+ int dropped_frame_cnt;
const struct tone_zone_sound *ts;
@@ -748,7 +751,7 @@
static int misdn_show_stacks (int fd, int argc, char *argv[])
{
int port;
-
+
ast_cli(fd, "BEGIN STACK_LIST:\n");
for (port=misdn_cfg_get_next_port(0); port > 0;
@@ -926,7 +929,7 @@
c = ast_channel_walk_locked(c);
}
if (c) {
- ret = strdup(c->name);
+ ret = ast_strdupa(c->name);
ast_mutex_unlock(&c->lock);
} else
ret = NULL;
@@ -945,12 +948,12 @@
switch (pos) {
case 4: if (*word == 'p')
- return strdup("port");
+ return ast_strdupa("port");
else if (*word == 'o')
- return strdup("only");
+ return ast_strdupa("only");
break;
case 6: if (*word == 'o')
- return strdup("only");
+ return ast_strdupa("only");
break;
}
return NULL;
@@ -1503,17 +1506,13 @@
if ( strcmp(bc->dad,ast->exten)) {
ast_copy_string(ast->exten, bc->dad, sizeof(ast->exten));
}
- if ( ast->cid.cid_num && strcmp(ast->cid.cid_num, bc->oad)) {
- free(ast->cid.cid_num);
- ast->cid.cid_num=NULL;
-
- }
+
if ( !ast->cid.cid_num) {
- ast->cid.cid_num=strdup(bc->oad);
+ ast_set_callerid(ast, bc->oad, NULL, bc->oad);
}
if ( !ast_strlen_zero(bc->rad) )
- ast->cid.cid_rdnis=strdup(bc->rad);
+ ast->cid.cid_rdnis=ast_strdupa(bc->rad);
}
return 0;
}
@@ -2061,10 +2060,20 @@
len = misdn_ibuf_usedcount(tmp->bc->astbuf);
if (!len) {
- chan_misdn_log(4,tmp->bc->port,"misdn_read: ZERO READ\n");
+ struct ast_frame *frame;
+ if(!tmp->zero_read_cnt)
+ chan_misdn_log(4,tmp->bc->port,"misdn_read: ZERO READ\n");
+ tmp->zero_read_cnt++;
+
+ if (tmp->zero_read_cnt > 5000) {
+ chan_misdn_log(4,tmp->bc->port,"misdn_read: ZERO READ counted > 5000 times\n");
+ tmp->zero_read_cnt=0;
+
+ }
tmp->frame.frametype = AST_FRAME_NULL;
tmp->frame.subclass = 0;
- return &tmp->frame;
+ frame=ast_frisolate(&tmp->frame);
+ return frame;
}
/*shrinken len if necessary, we transmit at maximum 4k*/
@@ -2153,7 +2162,16 @@
case BCHAN_BRIDGED:
break;
default:
- chan_misdn_log(5, ch->bc->port, "BC not active (nor bridged) droping: %d frames addr:%x exten:%s cid:%s ch->state:%s\n",frame->samples,ch->bc->addr, ast->exten, ast->cid.cid_num,misdn_get_ch_state( ch));
+ if (!ch->dropped_frame_cnt)
+ chan_misdn_log(5, ch->bc->port, "BC not active (nor bridged) droping: %d frames addr:%x exten:%s cid:%s ch->state:%s bc_state:%d\n",frame->samples,ch->bc->addr, ast->exten, ast->cid.cid_num,misdn_get_ch_state( ch), ch->bc->bc_state);
+
+ ch->dropped_frame_cnt++;
+ if (ch->dropped_frame_cnt > 100) {
+ ch->dropped_frame_cnt=0;
+ chan_misdn_log(5, ch->bc->port, "BC not active (nor bridged) droping: %d frames addr:%x dropped > 100 frames!\n",frame->samples,ch->bc->addr);
+
+ }
+
return 0;
}
@@ -2261,10 +2279,6 @@
ast_write(c0,f);
}
- }
-
- if (bridging) {
- misdn_lib_split_bridge(ch1->bc,ch2->bc);
}
return 0;
@@ -2611,10 +2625,9 @@
char *cid_name, *cid_num;
ast_callerid_parse(callerid, &cid_name, &cid_num);
- if (cid_name)
- tmp->cid.cid_name=strdup(cid_name);
- if (cid_num)
- tmp->cid.cid_num=strdup(cid_num);
+ ast_set_callerid(tmp, cid_num,cid_name,cid_num);
+ } else {
+ ast_set_callerid(tmp, NULL,NULL,NULL);
}
{
Modified: team/group/new_loader_completion/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_phone.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_phone.c (original)
+++ team/group/new_loader_completion/channels/chan_phone.c Sun Apr 30 04:27:14 2006
@@ -87,7 +87,6 @@
#define PHONE_MAX_BUF 480
#define DEFAULT_GAIN 0x100
-static const char desc[] = "Linux Telephony API Support";
static const char tdesc[] = "Standard Linux Telephony API Driver";
static const char config[] = "phone.conf";
@@ -1307,12 +1306,12 @@
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
return __unload_module();
}
-static int load_module(void *mod)
+static int load_module(void)
{
struct ast_config *cfg;
struct ast_variable *v;
@@ -1419,16 +1418,4 @@
return 0;
}
-static const char *description(void)
-{
- return (char *) desc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
-
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Linux Telephony API Support");
Modified: team/group/new_loader_completion/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/misdn/isdn_lib.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/misdn/isdn_lib.c (original)
+++ team/group/new_loader_completion/channels/misdn/isdn_lib.c Sun Apr 30 04:27:14 2006
@@ -802,6 +802,8 @@
free_chan = find_free_chan_in_stack(stack, bc->channel_preselected?bc->channel:0);
if (!free_chan) return -1;
bc->channel=free_chan;
+
+ cb_log(0,stack->port, " --> found channel: %d\n",free_chan);
for (i=0; i <= MAXPROCS; i++)
if (stack->procids[i]==0) break;
@@ -833,6 +835,7 @@
free_chan = find_free_chan_in_stack(stack, bc->channel_preselected?bc->channel:0);
if (!free_chan) return -1;
bc->channel=free_chan;
+ cb_log(0,stack->port, " --> found channel: %d\n",free_chan);
} else {
/* other phones could have made a call also on this port (ptmp) */
bc->channel=0xff;
@@ -1107,6 +1110,7 @@
stack->pri=0;
msg_queue_init(&stack->downqueue);
+ msg_queue_init(&stack->upqueue);
/* query port's requirements */
ret = mISDN_get_stack_info(midev, port, buff, sizeof(buff));
@@ -2072,11 +2076,18 @@
case MGR_SETSTACK| INDICATION:
cb_log(2, stack->port, "BCHAN: MGR_SETSTACK|IND \n");
-
+
+ AGAIN:
bc->addr = mISDN_get_layerid(stack->midev, bc->b_stid, bc->layer);
if (!bc->addr) {
+
+ if (errno == EAGAIN) {
+ usleep(1000);
+ goto AGAIN;
+ }
+
cb_log(0,stack->port,"$$$ Get Layer (%d) Id Error: %s\n",bc->layer,strerror(errno));
-
+
/* we kill the channel later, when we received some
data. */
bc->addr= frm->addr;
@@ -2587,16 +2598,29 @@
FD_SET(midev,&rdfs);
mISDN_select(FD_SETSIZE, &rdfs, NULL, NULL, NULL);
+ //select(FD_SETSIZE, &rdfs, NULL, NULL, NULL);
if (FD_ISSET(midev, &rdfs)) {
-
- r=mISDN_read(midev,msg->data,MAX_MSG_SIZE,0);
+
+ AGAIN:
+ r=mISDN_read(midev,msg->data,MAX_MSG_SIZE, 5000);
msg->len=r;
if (r==0) {
free_msg(msg); /* danger, cauz usualy freeing in main_loop */
printf ("Got empty Msg?\n");
return NULL;
+ }
+
+ if (r<0) {
+ if (errno == EAGAIN) {
+ /*we wait for mISDN here*/
+ cb_log(-1,0,"mISDN_read wants us to wait\n");
+ usleep(5000);
+ goto AGAIN;
+ }
+
+ cb_log(-1,0,"mISDN_read returned :%d error:%s (%d)\n",r,strerror(errno),errno);
}
return msg;
@@ -2976,6 +3000,22 @@
int handle_err(msg_t *msg)
{
iframe_t *frm = (iframe_t*) msg->data;
+
+
+ if (!frm->addr) {
+ static int cnt=0;
+ if (!cnt)
+ cb_log(0,0,"mISDN Msg without Address pr:%x dinfo:%x\n",frm->prim,frm->dinfo);
+ cnt++;
+ if (cnt>100) {
+ cb_log(0,0,"mISDN Msg without Address pr:%x dinfo:%x (already more than 100 of them)\n",frm->prim,frm->dinfo);
+ cnt=0;
+ }
+
+ free_msg(msg);
+ return 1;
+
+ }
switch (frm->prim) {
case DL_DATA|INDICATION:
@@ -2983,7 +3023,13 @@
int port=(frm->addr&MASTER_ID_MASK) >> 8;
int channel=(frm->addr&CHILD_ID_MASK) >> 16;
- cb_log(3,0,"BCHAN DATA without BC: addr:%x port:%d channel:%d\n",frm->addr, port,channel);
+ /*we flush the read buffer here*/
+
+ cb_log(9,0,"BCHAN DATA without BC: addr:%x port:%d channel:%d\n",frm->addr, port,channel);
+
+ free_msg(msg) ;
+ return 1;
+
struct misdn_bchannel *bc=find_bc_by_channel( port , channel);
@@ -3015,11 +3061,28 @@
}
+int queue_l2l3(msg_t *msg) {
+ iframe_t *frm= (iframe_t*)msg->data;
+ struct misdn_stack *stack;
+ int err=0;
+
+ stack=find_stack_by_addr( frm->addr );
+
+
+ if (!stack) {
+ return 0;
+ }
+
+ msg_queue_tail(&stack->upqueue, msg);
+ sem_post(&glob_mgr->new_msg);
+ return 1;
+}
+
int manager_isdn_handler(iframe_t *frm ,msg_t *msg)
{
if (frm->dinfo==(signed long)0xffffffff && frm->prim==(PH_DATA|CONFIRM)) {
- printf("SERIOUS BUG, dinfo == 0xffffffff, prim == PH_DATA | CONFIRM !!!!\n");
+ cb_log(0,0,"SERIOUS BUG, dinfo == 0xffffffff, prim == PH_DATA | CONFIRM !!!!\n");
}
if ( ((frm->addr | ISDN_PID_BCHANNEL_BIT )>> 28 ) == 0x5) {
@@ -3039,21 +3102,17 @@
/* Its important to handle l1 AFTER l2 */
if (handle_l1(msg))
return 0 ;
-
-
- /** Handle L2/3 Signalling after bchans **/
- if (handle_frm_nt(msg))
- return 0 ;
-
- if (handle_frm(msg))
- return 0 ;
+
+ /* The L2/L3 will be queued */
+ if (queue_l2l3(msg))
+ return 0;
if (handle_err(msg))
return 0 ;
-
+
cb_log(-1, 0, "Unhandled Message: prim %x len %d from addr %x, dinfo %x on this port.\n",frm->prim, frm->len, frm->addr, frm->dinfo);
-
free_msg(msg);
+
return 0;
}
@@ -3200,6 +3259,24 @@
for (stack=glob_mgr->stack_list;
stack;
stack=stack->next ) {
+
+ while ( (msg=msg_dequeue(&stack->upqueue)) ) {
+ int res=0;
+ /** Handle L2/3 Signalling after bchans **/
+ if (!handle_frm_nt(msg)) {
+ /* Maybe it's TE */
+ if (!handle_frm(msg)) {
+ /* wow none! */
+ cb_log(-1,stack->port,"Wow we've got a strange issue while dequeueing a Frame\n");
+ }
+ }
+ }
+
+ /* Here we should check if we really want to
+ send all the messages we've queued, lets
+ assume we've queued a Disconnect, but
+ received it already from the other side!*/
+
while ( (msg=msg_dequeue(&stack->downqueue)) ) {
if (stack->nt ) {
if (stack->nst.manager_l3(&stack->nst, msg))
@@ -3208,6 +3285,7 @@
} else {
iframe_t *frm = (iframe_t *)msg->data;
struct misdn_bchannel *bc = find_bc_by_l3id(stack, frm->dinfo);
+ cb_log(0,stack->port,"Sending msg, prim:%x addr:%x dinfo:%x\n",frm->prim,frm->addr,frm->dinfo);
if (bc) send_msg(glob_mgr->midev, bc, msg);
}
}
Modified: team/group/new_loader_completion/channels/misdn/isdn_lib_intern.h
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/misdn/isdn_lib_intern.h?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/misdn/isdn_lib_intern.h (original)
+++ team/group/new_loader_completion/channels/misdn/isdn_lib_intern.h Sun Apr 30 04:27:14 2006
@@ -74,6 +74,7 @@
int procids[0x100+1];
msg_queue_t downqueue;
+ msg_queue_t upqueue;
int busy;
int port;
Modified: team/group/new_loader_completion/cli.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/cli.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/cli.c (original)
+++ team/group/new_loader_completion/cli.c Sun Apr 30 04:27:14 2006
@@ -443,7 +443,7 @@
ast_cli(fd, FORMAT_STRING, c->name, locbuf, ast_state2str(c->_state), appdata);
}
numchans++;
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
}
if (!concise) {
ast_cli(fd, "%d active channel%s\n", numchans, ESS(numchans));
@@ -504,7 +504,7 @@
if (c) {
ast_cli(fd, "Requested Hangup on channel '%s'\n", c->name);
ast_softhangup(c, AST_SOFTHANGUP_EXPLICIT);
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
} else
ast_cli(fd, "%s is not a known channel\n", argv[2]);
return RESULT_SUCCESS;
@@ -629,7 +629,7 @@
c->fout |= DEBUGCHAN_FLAG;
ast_cli(fd, "Debugging enabled on channel %s\n", c->name);
}
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
if (!is_all)
break;
c = ast_channel_walk_locked(c);
@@ -661,7 +661,7 @@
c->fout &= ~DEBUGCHAN_FLAG;
ast_cli(fd, "Debugging disabled on channel %s\n", c->name);
}
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
if (!is_all)
break;
c = ast_channel_walk_locked(c);
@@ -746,7 +746,7 @@
if(c->cdr && ast_cdr_serialize_variables(c->cdr,buf, sizeof(buf), '=', '\n', 1))
ast_cli(fd," CDR Variables:\n%s\n",buf);
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
return RESULT_SUCCESS;
}
@@ -789,7 +789,7 @@
while (ret == ¬found && (c = ast_channel_walk_locked(c))) {
if (!strncasecmp(word, c->name, wordlen) && ++which > state)
ret = ast_strdup(c->name);
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
}
return ret == ¬found ? NULL : ret;
}
@@ -873,7 +873,7 @@
}
}
numchans++;
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
}
if (havepattern)
Modified: team/group/new_loader_completion/devicestate.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/devicestate.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/devicestate.c (original)
+++ team/group/new_loader_completion/devicestate.c Sun Apr 30 04:27:14 2006
@@ -101,7 +101,7 @@
else
res = AST_DEVICE_INUSE;
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
return res;
}
Modified: team/group/new_loader_completion/include/asterisk/frame.h
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/include/asterisk/frame.h?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/include/asterisk/frame.h (original)
+++ team/group/new_loader_completion/include/asterisk/frame.h Sun Apr 30 04:27:14 2006
@@ -164,22 +164,18 @@
/*! Comfort Noise frame (subclass is level of CNG in -dBov),
body may include zero or more 8-bit quantization coefficients */
#define AST_FRAME_CNG 10
-#if defined(T38_SUPPORT)
/*! Modem-over-IP data streams */
#define AST_FRAME_MODEM 11
-#endif /* T38_SUPPORT */
/*! DTMF begin event, subclass is the digit */
#define AST_FRAME_DTMF_BEGIN 12
/*! DTMF end event, subclass is the digit */
#define AST_FRAME_DTMF_END 13
-#if defined(T38_SUPPORT)
/* MODEM subclasses */
/*! T.38 Fax-over-IP */
#define AST_MODEM_T38 1
/*! V.150 Modem-over-IP */
#define AST_MODEM_V150 2
-#endif /* T38_SUPPORT */
/* HTML subclasses */
/*! Sending a URL */
Modified: team/group/new_loader_completion/manager.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/manager.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/manager.c (original)
+++ team/group/new_loader_completion/manager.c Sun Apr 30 04:27:14 2006
@@ -1053,7 +1053,7 @@
return 0;
}
ast_softhangup(c, AST_SOFTHANGUP_EXPLICIT);
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
astman_send_ack(s, m, "Channel Hungup");
return 0;
}
@@ -1093,7 +1093,7 @@
pbx_builtin_setvar_helper(c, varname, varval);
if (c)
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
astman_send_ack(s, m, "Variable Set");
@@ -1136,7 +1136,7 @@
}
if (c)
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
astman_append(s, "Response: Success\r\n"
"Variable: %s\r\nValue: %s\r\n", varname, varval);
if (!ast_strlen_zero(id))
@@ -1227,7 +1227,7 @@
c->accountcode,
ast_state2str(c->_state), bridge, c->uniqueid, idText);
}
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
if (!all)
break;
c = ast_channel_walk_locked(c);
@@ -1297,9 +1297,9 @@
} else
astman_send_error(s, m, "Redirect failed");
if (chan)
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
if (chan2)
- ast_mutex_unlock(&chan2->lock);
+ ast_channel_unlock(chan2);
return 0;
}
@@ -1363,7 +1363,7 @@
/* Locked by ast_pbx_outgoing_exten or ast_pbx_outgoing_app */
if (chan)
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
free(in);
return NULL;
}
@@ -1626,7 +1626,7 @@
return 0;
}
ast_channel_setwhentohangup(c, timeout);
- ast_mutex_unlock(&c->lock);
+ ast_channel_unlock(c);
astman_send_ack(s, m, "Timeout Set");
return 0;
}
Modified: team/group/new_loader_completion/mxml/Makefile.in
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/mxml/Makefile.in?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/mxml/Makefile.in (original)
+++ team/group/new_loader_completion/mxml/Makefile.in Sun Apr 30 04:27:14 2006
@@ -213,18 +213,7 @@
# autoconf stuff...
#
-Makefile: configure Makefile.in
- if test -f config.status; then \
- ./config.status --recheck; \
- ./config.status; \
- else \
- ./configure; \
- fi
- touch config.h
-
-
-configure: configure.in
- autoconf
+Makefile: Makefile.in
if test -f config.status; then \
./config.status --recheck; \
./config.status; \
Modified: team/group/new_loader_completion/pbx.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/pbx.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/pbx.c (original)
+++ team/group/new_loader_completion/pbx.c Sun Apr 30 04:27:14 2006
@@ -4147,7 +4147,7 @@
{
int res = 0;
- ast_mutex_lock(&chan->lock);
+ ast_channel_lock(chan);
if (chan->pbx) {
/* This channel is currently in the PBX */
@@ -4174,9 +4174,9 @@
ast_channel_masquerade(tmpchan, chan);
/* Grab the locks and get going */
- ast_mutex_lock(&tmpchan->lock);
+ ast_channel_lock(tmpchan);
ast_do_masquerade(tmpchan);
- ast_mutex_unlock(&tmpchan->lock);
+ ast_channel_unlock(tmpchan);
/* Start the PBX going on our stolen channel */
if (ast_pbx_start(tmpchan)) {
ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmpchan->name);
@@ -4185,7 +4185,7 @@
}
}
}
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
return res;
}
@@ -4197,7 +4197,7 @@
chan = ast_get_channel_by_name_locked(channame);
if (chan) {
res = ast_async_goto(chan, context, exten, priority);
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
}
return res;
}
@@ -4576,7 +4576,7 @@
if (channel) {
*channel = chan;
if (chan)
- ast_mutex_lock(&chan->lock);
+ ast_channel_lock(chan);
}
if (chan) {
if (chan->cdr) { /* check if the channel already has a cdr record, if not give it one */
@@ -4600,7 +4600,7 @@
if (sync > 1) {
if (channel)
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
if (ast_pbx_run(chan)) {
ast_log(LOG_ERROR, "Unable to run PBX on %s\n", chan->name);
if (channel)
@@ -4613,7 +4613,7 @@
ast_log(LOG_ERROR, "Unable to start PBX on %s\n", chan->name);
if (channel) {
*channel = NULL;
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
}
ast_hangup(chan);
res = -1;
@@ -4632,7 +4632,7 @@
if (channel) {
*channel = NULL;
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
}
ast_hangup(chan);
}
@@ -4673,7 +4673,7 @@
if (channel) {
*channel = chan;
if (chan)
- ast_mutex_lock(&chan->lock);
+ ast_channel_lock(chan);
}
if (!chan) {
free(as);
@@ -4694,7 +4694,7 @@
free(as);
if (channel) {
*channel = NULL;
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
}
ast_hangup(chan);
res = -1;
@@ -4783,18 +4783,18 @@
tmp->chan = chan;
if (sync > 1) {
if (locked_channel)
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
ast_pbx_run_app(tmp);
} else {
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (locked_channel)
- ast_mutex_lock(&chan->lock);
+ ast_channel_lock(chan);
if (ast_pthread_create(&tmp->t, &attr, ast_pbx_run_app, tmp)) {
ast_log(LOG_WARNING, "Unable to spawn execute thread on %s: %s\n", chan->name, strerror(errno));
free(tmp);
if (locked_channel)
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
ast_hangup(chan);
res = -1;
} else {
@@ -4851,12 +4851,12 @@
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (locked_channel)
- ast_mutex_lock(&chan->lock);
+ ast_channel_lock(chan);
if (ast_pthread_create(&as->p, &attr, async_wait, as)) {
ast_log(LOG_WARNING, "Failed to start async wait\n");
free(as);
if (locked_channel)
- ast_mutex_unlock(&chan->lock);
+ ast_channel_unlock(chan);
ast_hangup(chan);
res = -1;
goto outgoing_app_cleanup;
@@ -5505,7 +5505,7 @@
sprintf(s, "${%s}", value);
pbx_substitute_variables_helper(chan2, s, tmp, sizeof(tmp) - 1);
}
- ast_mutex_unlock(&chan2->lock);
+ ast_channel_unlock(chan2);
}
pbx_builtin_setvar_helper(chan, name, tmp);
}
Modified: team/group/new_loader_completion/pbx/ael/ael.flex
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/pbx/ael/ael.flex?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/pbx/ael/ael.flex (original)
+++ team/group/new_loader_completion/pbx/ael/ael.flex Sun Apr 30 04:27:14 2006
@@ -493,7 +493,19 @@
}
-/* used by the bison code */
+/*
+ * The following three functions, reset_*, are used in the bison
+ * code to switch context. As a consequence, we need to
+ * declare them global and add a prototype so that the
+ * compiler does not complain.
+ *
+ * NOTE: yyg is declared because it is used in the BEGIN macros,
+ * though that should be hidden as the macro changes
+ * depending on the flex options that we use - in particular,
+ * %reentrant changes the way the macro is declared;
+ * without %reentrant, BEGIN uses yystart instead of yyg
+ */
+
void reset_parencount(yyscan_t yyscanner );
void reset_parencount(yyscan_t yyscanner )
{
@@ -505,7 +517,6 @@
BEGIN(paren);
}
-/* used by the bison code */
void reset_semicount(yyscan_t yyscanner );
void reset_semicount(yyscan_t yyscanner )
{
@@ -514,7 +525,6 @@
BEGIN(semic);
}
-/* used by the bison code */
void reset_argcount(yyscan_t yyscanner );
void reset_argcount(yyscan_t yyscanner )
{
Modified: team/group/new_loader_completion/pbx/ael/ael.tab.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/pbx/ael/ael.tab.c?rev=23558&r1=23557&r2=23558&view=diff
==============================================================================
--- team/group/new_loader_completion/pbx/ael/ael.tab.c (original)
+++ team/group/new_loader_completion/pbx/ael/ael.tab.c Sun Apr 30 04:27:14 2006
@@ -412,18 +412,18 @@
#endif
/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 17
+#define YYFINAL 18
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 584
+#define YYLAST 505
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 42
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 52
+#define YYNNTS 55
/* YYNRULES -- Number of rules. */
-#define YYNRULES 151
+#define YYNRULES 149
/* YYNRULES -- Number of states. */
-#define YYNSTATES 354
+#define YYNSTATES 346
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
@@ -473,110 +473,105 @@
static const unsigned short int yyprhs[] =
{
0, 0, 3, 5, 7, 10, 13, 15, 17, 19,
- 21, 27, 32, 38, 43, 50, 56, 63, 69, 78,
- 86, 94, 101, 106, 110, 112, 115, 118, 119, 125,
- 127, 131, 134, 136, 138, 141, 144, 146, 148, 150,
- 152, 154, 155, 161, 164, 166, 171, 175, 180, 188,
- 197, 199, 202, 205, 206, 212, 213, 219, 234, 245,
- 247, 250, 252, 255, 259, 261, 264, 268, 269, 276,
- 280, 281, 287, 291, 295, 298, 299, 300, 301, 314,
- 315, 322, 325, 329, 333, 336, 339, 340, 346, 349,
- 352, 355, 358, 363, 366, 371, 374, 379, 381, 383,
- 387, 391, 397, 403, 409, 415, 417, 421, 427, 431,
- 437, 441, 442, 448, 452, 453, 457, 461, 464, 466,
- 467, 471, 474, 476, 479, 484, 488, 493, 497, 500,
- 504, 506, 509, 511, 517, 522, 526, 531, 535, 538,
- 542, 545, 548, 563, 574, 578, 594, 606, 609, 611,
- 613, 618
+ 21, 23, 25, 31, 36, 43, 49, 58, 66, 74,
+ 81, 86, 90, 92, 95, 98, 99, 105, 107, 111,
+ 114, 116, 118, 121, 124, 126, 128, 130, 132, 134,
[... 5208 lines stripped ...]
More information about the asterisk-commits
mailing list