aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
Diffstat (limited to 'channels')
-rw-r--r--channels/Makefile34
-rw-r--r--channels/chan_agent.c56
-rw-r--r--channels/chan_alsa.c17
-rw-r--r--channels/chan_features.c16
-rw-r--r--channels/chan_h323.c17
-rw-r--r--channels/chan_iax2.c24
-rw-r--r--channels/chan_jingle.c25
-rw-r--r--channels/chan_local.c32
-rw-r--r--channels/chan_mgcp.c31
-rw-r--r--channels/chan_misdn.c33
-rw-r--r--channels/chan_nbs.c35
-rw-r--r--channels/chan_oss.c18
-rw-r--r--channels/chan_phone.c19
-rw-r--r--channels/chan_sip.c23
-rw-r--r--channels/chan_skinny.c23
-rw-r--r--channels/chan_zap.c24
-rw-r--r--channels/h323/Makefile1
-rw-r--r--channels/misdn/Makefile25
-rw-r--r--channels/misdn/ie.c96
-rw-r--r--channels/misdn/isdn_lib.c104
-rw-r--r--channels/misdn/isdn_lib.h1
-rw-r--r--channels/misdn/isdn_lib_intern.h8
-rw-r--r--channels/misdn/isdn_msg_parser.c147
23 files changed, 350 insertions, 459 deletions
diff --git a/channels/Makefile b/channels/Makefile
index 044f95237..ad898681a 100644
--- a/channels/Makefile
+++ b/channels/Makefile
@@ -9,7 +9,7 @@
# the GNU General Public License
#
-ifneq ($(wildcard ../menuselect.makeopts),)
+ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),)
include ../menuselect.makeopts
include ../menuselect.makedeps
endif
@@ -22,7 +22,7 @@ ifeq ($(OSARCH),OpenBSD)
H323LIB=-lh323_OpenBSD_x86_r
endif
-ifeq ($(OSARCH),Linux)
+ifeq ($(OSARCH),linux-gnu)
PTLIB=-lpt_linux_x86_r
H323LIB=-lh323_linux_x86_r
CHANH323LIB=-ldl
@@ -43,10 +43,6 @@ ifeq ($(wildcard h323/libchanh323.a),)
CC_MODS:=$(filter-out chan_h323,$(CC_MODS))
endif
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/mISDNuser/mISDNlib.h),)
- C_MODS:=$(filter-out chan_misdn,$(C_MODS))
-endif
-
ifndef OPENH323DIR
OPENH323DIR=$(HOME)/openh323
endif
@@ -55,7 +51,12 @@ ifndef PWLIBDIR
PWLIBDIR=$(HOME)/pwlib
endif
-SELECTED_MODS:=$(C_MODS) $(CC_MODS)
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring channels,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
all: _all
@@ -63,6 +64,7 @@ include $(ASTTOPDIR)/Makefile.moddir_rules
clean::
rm -f busy.h ringtone.h gentone
+ make -C misdn clean
ifneq ($(wildcard $(PWD)/Makefile.ast),)
include $(PWD)/Makefile.ast
@@ -79,24 +81,20 @@ ringtone.h: gentone
chan_oss.o: busy.h ringtone.h
-chan_iax2.so: iax2-parser.o iax2-provision.o
+$(chan_iax2): iax2-parser.o iax2-provision.o
chan_alsa.o: busy.h ringtone.h
-ifeq ($(OSARCH),Linux)
-chan_h323.so: chan_h323.o h323/libchanh323.a $(PWD)/Makefile.ast
- $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
+ifeq ($(OSARCH),linux-gnu)
+chan_h323.so: chan_h323.o h323_module_interface.so h323/libchanh323.a h323/Makefile.ast
+ $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $^ h323/libchanh323.a $(H323LDLIBS) -lstdc++
else
-chan_h323.so: chan_h323.o h323/libchanh323.a
- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
+chan_h323.so: chan_h323.o h323_module_interface.so h323/libchanh323.a
+ $(CC) $(SOLINK) -o $@ $^ h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
endif
-misdn/chan_misdn_lib.a:
- make -C misdn
-
chan_misdn.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\"
misdn_config.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\"
-chan_misdn.so: chan_misdn.o misdn_config.o misdn/chan_misdn_lib.a
-chan_misdn.so: LIBS+=-lisdnnet -lmISDN -lsuppserv
+$(chan_misdn): chan_misdn.o misdn_config.o misdn/isdn_lib.o misdn/isdn_msg_parser.o
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index b8a54e74b..0a9b8906a 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -189,14 +189,15 @@ struct agent_pvt {
char agent[AST_MAX_AGENT]; /*!< Agent ID */
char password[AST_MAX_AGENT]; /*!< Password for Agent login */
char name[AST_MAX_AGENT];
- ast_mutex_t app_lock; /*!< Synchronization between owning applications */
- volatile pthread_t owning_app; /*!< Owning application thread id */
- volatile int app_sleep_cond; /*!< Sleep condition for the login app */
- struct ast_channel *owner; /*!< Agent */
- char loginchan[80]; /*!< channel they logged in from */
- char logincallerid[80]; /*!< Caller ID they had when they logged in */
- struct ast_channel *chan; /*!< Channel we use */
- AST_LIST_ENTRY(agent_pvt) list; /*!< Next Agent in the linked list. */
+ ast_mutex_t app_lock; /**< Synchronization between owning applications */
+ volatile pthread_t owning_app; /**< Owning application thread id */
+ volatile int app_sleep_cond; /**< Sleep condition for the login app */
+ struct ast_channel *owner; /**< Agent */
+ char loginchan[80]; /**< channel they logged in from */
+ char logincallerid[80]; /**< Caller ID they had when they logged in */
+ struct ast_channel *chan; /**< Channel we use */
+ struct ast_module_user *u; /*! reference to keep our module in memory while in use */
+ AST_LIST_ENTRY(agent_pvt) list; /**< Next Agent in the linked list. */
};
static AST_LIST_HEAD_STATIC(agents, agent_pvt); /*!< Holds the list of agents (loaded form agents.conf). */
@@ -727,8 +728,7 @@ static int agent_hangup(struct ast_channel *ast)
* as in apps/app_chanisavail.c:chanavail_exec()
*/
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1);
- /* XXX do we need ast_update_use_count(); */
+ ast_module_user_remove(p->u);
if (option_debug)
ast_log(LOG_DEBUG, "Hangup called for state %s\n", ast_state2str(ast->_state));
@@ -932,7 +932,10 @@ static struct ast_channel *agent_new(struct agent_pvt *p, int state)
ast_setstate(tmp, state);
tmp->tech_pvt = p;
p->owner = tmp;
+ /* XXX: this needs fixing */
+#if 0
ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1);
+#endif
ast_update_use_count();
tmp->priority = 1;
/* Wake up and wait for other applications (by definition the login app)
@@ -1707,7 +1710,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
int tries = 0;
int max_login_tries = maxlogintries;
struct agent_pvt *p;
- struct localuser *u;
+ struct ast_module_user *u;
int login_state = 0;
char user[AST_MAX_AGENT] = "";
char pass[AST_MAX_AGENT];
@@ -1728,7 +1731,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
char *filename = "agent-loginok";
char tmpchan[AST_MAX_BUF] = "";
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
parse = ast_strdupa(data);
@@ -2088,7 +2091,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
/* AgentLogin() exit */
if (!callbackmode) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return -1;
} else { /* AgentCallbackLogin() exit*/
/* Set variables */
@@ -2103,7 +2106,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
pbx_builtin_setvar_helper(chan, "AGENTSTATUS", "fail");
}
if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 1, chan->cid.cid_num)) {
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
return 0;
}
/* Do we need to play agent-goodbye now that we will be hanging up? */
@@ -2118,7 +2121,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
}
}
- LOCAL_USER_REMOVE(u);
+ ast_module_user_remove(u);
/* We should never get here if next priority exists when in callbackmode */
return -1;
@@ -2525,9 +2528,8 @@ struct ast_custom_function agent_function = {
*
* \returns int Always 0.
*/
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
/* Make sure we can register our agent channel type */
if (ast_channel_register(&agent_tech)) {
ast_log(LOG_ERROR, "Unable to register channel class 'Agent'\n");
@@ -2558,7 +2560,7 @@ static int load_module(void *mod)
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
read_agent_config();
if (persistent_agents)
@@ -2566,7 +2568,7 @@ static int reload(void *mod)
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct agent_pvt *p;
/* First, take us out of the channel loop */
@@ -2598,14 +2600,8 @@ static int unload_module(void *mod)
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return "Agent Proxy Channel";
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Agent Proxy Channel",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c
index 2702621f7..5a4d6276f 100644
--- a/channels/chan_alsa.c
+++ b/channels/chan_alsa.c
@@ -121,7 +121,6 @@ static int silencethreshold = 1000;
AST_MUTEX_DEFINE_STATIC(usecnt_lock);
AST_MUTEX_DEFINE_STATIC(alsalock);
-static const char desc[] = "ALSA Console Channel Driver";
static const char tdesc[] = "ALSA Console Channel Driver";
static const char config[] = "alsa.conf";
@@ -1070,7 +1069,7 @@ static struct ast_cli_entry myclis[] = {
{ { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete }
};
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
int x;
@@ -1140,7 +1139,7 @@ static int load_module(void *mod)
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int x;
@@ -1162,14 +1161,4 @@ static int unload_module(void *mod)
return 0;
}
-static const char *description(void)
-{
- return (char *) desc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "ALSA Console Channel Driver");
diff --git a/channels/chan_features.c b/channels/chan_features.c
index 8b1fe4f86..d1feadbea 100644
--- a/channels/chan_features.c
+++ b/channels/chan_features.c
@@ -519,7 +519,7 @@ static struct ast_cli_entry cli_show_features = {
{ "feature", "show", "channels", NULL }, features_show,
"Show status of feature channels", show_features_usage, NULL };
-static int load_module(void *mod)
+static int load_module(void)
{
/* Make sure we can register our sip channel type */
if (ast_channel_register(&features_tech)) {
@@ -530,7 +530,7 @@ static int load_module(void *mod)
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct feature_pvt *p;
@@ -553,15 +553,5 @@ static int unload_module(void *mod)
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return "Feature Proxy Channel";
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Feature Proxy Channel");
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index 1ce5b345e..6b956e517 100644
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -129,7 +129,6 @@ static struct ast_jb_conf global_jbconf;
/** Variables required by Asterisk */
static const char desc[] = "The NuFone Network's Open H.323 Channel Driver";
-static const char tdesc[] = "The NuFone Network's Open H.323 Channel Driver";
static const char config[] = "h323.conf";
static char default_context[AST_MAX_CONTEXT] = "default";
static struct sockaddr_in bindaddr;
@@ -2508,14 +2507,8 @@ static int unload_module(void *mod)
return 0;
}
-static const char *description(void)
-{
- return desc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "The NuFone Network's OpenH323 Channel Driver",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 2809003e6..97e8b6cfa 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -98,7 +98,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "iax2.h"
#include "iax2-parser.h"
#include "iax2-provision.h"
-#include "../jitterbuf.h"
+#include "jitterbuf.h"
/* Define SCHED_MULTITHREADED to run the scheduler in a special
multithreaded mode. */
@@ -9050,7 +9050,7 @@ static int iax2_reload(int fd, int argc, char *argv[])
return reload_config();
}
-static int reload(void *mod)
+static int reload(void)
{
return reload_config();
}
@@ -9747,7 +9747,7 @@ static int __unload_module(void)
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
ast_mutex_destroy(&iaxq.lock);
ast_mutex_destroy(&waresl.lock);
@@ -9757,7 +9757,7 @@ static int unload_module(void *mod)
/*! \brief Load IAX2 module, load configuraiton ---*/
-static int load_module(void *mod)
+static int load_module(void)
{
char *config = "iax.conf";
int res = 0;
@@ -9845,14 +9845,8 @@ static int load_module(void *mod)
return res;
}
-static const char *description(void)
-{
- return "Inter Asterisk eXchange (Ver 2)";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Inter Asterisk eXchange (Ver 2)",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
diff --git a/channels/chan_jingle.c b/channels/chan_jingle.c
index bfa79e454..b296334ed 100644
--- a/channels/chan_jingle.c
+++ b/channels/chan_jingle.c
@@ -161,7 +161,6 @@ struct jingle_container {
static const char desc[] = "Jingle Channel";
static const char type[] = "Jingle";
-static const char tdesc[] = "Jingle Channel Driver";
static int usecnt = 0;
AST_MUTEX_DEFINE_STATIC(usecnt_lock);
@@ -192,7 +191,7 @@ static int jingle_get_codec(struct ast_channel *chan);
/*! \brief PBX interface structure for channel registration */
static const struct ast_channel_tech jingle_tech = {
.type = type,
- .description = tdesc,
+ .description = "Jingle Channel Driver",
.capabilities = ((AST_FORMAT_MAX_AUDIO << 1) - 1),
.requester = jingle_request,
.send_digit = jingle_digit,
@@ -1652,7 +1651,7 @@ static int jingle_load_config(void)
}
/*! \brief Load module into PBX, register channel */
-static int load_module(void *mod)
+static int load_module(void)
{
ASTOBJ_CONTAINER_INIT(&jingles);
if (!jingle_load_config()) {
@@ -1684,13 +1683,13 @@ static int load_module(void *mod)
}
/*! \brief Reload module */
-static int reload(void *mod)
+static int reload(void)
{
return 0;
}
/*! \brief Unload the jingle channel from Asterisk */
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct jingle_pvt *privates = NULL;
@@ -1721,14 +1720,8 @@ static int unload_module(void *mod)
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return desc;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Jingle Channel Driver",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 29f5d8afe..815f9cc1a 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -112,6 +112,8 @@ struct local_pvt {
int nooptimization; /* Don't leave masq state */
struct ast_channel *owner; /* Master Channel */
struct ast_channel *chan; /* Outbound channel */
+ struct ast_module_user *u_owner; /*! reference to keep the module loaded while in use */
+ struct ast_module_user *u_chan; /*! reference to keep the module loaded while in use */
AST_LIST_ENTRY(local_pvt) list; /* Next entity */
};
@@ -451,11 +453,13 @@ static int local_hangup(struct ast_channel *ast)
pbx_builtin_setvar_helper(p->owner, "CHANLOCALSTATUS", status);
p->chan = NULL;
p->launchedpbx = 0;
- } else
+ ast_module_user_remove(p->u_chan);
+ } else {
p->owner = NULL;
- ast->tech_pvt = NULL;
+ ast_module_user_remove(p->u_owner);
+ }
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1);
+ ast->tech_pvt = NULL;
if (!p->owner && !p->chan) {
/* Okay, done with the private part now, too. */
@@ -564,8 +568,8 @@ static struct ast_channel *local_new(struct local_pvt *p, int state)
tmp2->tech_pvt = p;
p->owner = tmp;
p->chan = tmp2;
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, +2); /* we allocate 2 new channels */
- ast_update_use_count();
+ p->u_owner = ast_module_user_add(p->owner);
+ p->u_chan = ast_module_user_add(p->chan);
ast_copy_string(tmp->context, p->context, sizeof(tmp->context));
ast_copy_string(tmp2->context, p->context, sizeof(tmp2->context));
ast_copy_string(tmp2->exten, p->exten, sizeof(tmp->exten));
@@ -616,10 +620,8 @@ static struct ast_cli_entry cli_show_locals = {
"Show status of local channels", show_locals_usage, NULL };
/*! \brief Load module into PBX, register channel */
-static int load_module(void *mod)
+static int load_module(void)
{
- __mod_desc = mod;
-
/* Make sure we can register our channel type */
if (ast_channel_register(&local_tech)) {
ast_log(LOG_ERROR, "Unable to register channel class 'Local'\n");
@@ -630,7 +632,7 @@ static int load_module(void *mod)
}
/*! \brief Unload the local proxy channel from Asterisk */
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct local_pvt *p;
@@ -652,14 +654,4 @@ static int unload_module(void *mod)
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return "Local Proxy Channel";
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Local Proxy Channel");
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 434d2ece0..94cb20f02 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -981,10 +981,7 @@ static int mgcp_hangup(struct ast_channel *ast)
sub->rtp = NULL;
}
- /* Decrement use count */
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1);
- ast_update_use_count();
- /* Decrement use count */
+ ast_module_unref(ast_module_info->self);
if ((p->hookstate == MGCP_ONHOOK) && (!sub->next->rtp)) {
p->hidecallerid = 0;
@@ -1408,8 +1405,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
if (i->amaflags)
tmp->amaflags = i->amaflags;
sub->owner = tmp;
- ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1);
- ast_update_use_count();
+ ast_module_ref(ast_module_info->self);
tmp->callgroup = i->callgroup;
tmp->pickupgroup = i->pickupgroup;
ast_string_field_set(tmp, call_forward, i->call_forward);
@@ -4222,11 +4218,10 @@ static int reload_config(void)
}
/*! \brief load_module: PBX load module - initialization ---*/
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
- __mod_desc = mod;
sched = sched_context_create();
if (!sched) {
ast_log(LOG_WARNING, "Unable to create schedule context\n");
@@ -4277,13 +4272,13 @@ static int mgcp_reload(int fd, int argc, char *argv[])
return 0;
}
-static int reload(void *mod)
+static int reload(void)
{
mgcp_reload(0, 0, NULL);
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct mgcp_endpoint *e;
struct mgcp_gateway *g;
@@ -4350,14 +4345,8 @@ static int unload_module(void *mod)
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return "Media Gateway Control Protocol (MGCP)";
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Media Gateway Control Protocol (MGCP)",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 54ac7bec8..9631a8cb5 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -26,6 +26,11 @@
* \ingroup channel_drivers
*/
+/*** MODULEINFO
+ <depend>isdnnet</depend>
+ <depend>misdn</depend>
+ <depend>suppserv</depend>
+ ***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -283,7 +288,6 @@ static int pbx_start_chan(struct chan_list *ch);
/* #define MISDN_DEBUG 1 */
-static char *desc = "Channel driver for mISDN Support (Bri/Pri)";
static const char misdn_type[] = "mISDN";
static int tracing = 0 ;
@@ -4441,7 +4445,7 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
static int g_config_initialized=0;
-static int unload_module(void *mod)
+static int unload_module(void)
{
/* First, take us out of the channel loop */
ast_log(LOG_VERBOSE, "-- Unregistering mISDN Channel Driver --\n");
@@ -4472,7 +4476,7 @@ static int unload_module(void *mod)
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int i, port;
@@ -4547,7 +4551,7 @@ static int load_module(void *mod)
{
if (ast_channel_register(&misdn_tech)) {
ast_log(LOG_ERROR, "Unable to register channel class %s\n", misdn_type);
- unload_module(mod);
+ unload_module();
return -1;
}
}
@@ -4601,26 +4605,13 @@ static int load_module(void *mod)
-static int reload(void *mod)
+static int reload(void)
{
reload_config();
return 0;
}
-static const char *description(void)
-{
- return desc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-
-
-
/*** SOME APPS ;)***/
static int misdn_facility_exec(struct ast_channel *chan, void *data)
@@ -5099,4 +5090,8 @@ void chan_misdn_log(int level, int port, char *tmpl, ...)
}
}
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Channel driver for mISDN Support (BRI/PRI)",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
diff --git a/channels/chan_nbs.c b/channels/chan_nbs.c
index 10e1d1fb2..30ee32346 100644
--- a/channels/chan_nbs.c
+++ b/channels/chan_nbs.c
@@ -54,16 +54,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/options.h"
#include "asterisk/utils.h"
-static const char desc[] = "Network Broadcast Sound Support";
static const char tdesc[] = "Network Broadcast Sound Driver";
-static int usecnt =0;
-
/* Only linear is allowed */
static int prefformat = AST_FORMAT_SLINEAR;
-AST_MUTEX_DEFINE_STATIC(usecnt_lock);
-
static char context[AST_MAX_EXTENSION] = "default";
static char type[] = "NBS";
@@ -75,6 +70,7 @@ struct nbs_pvt {
char app[16]; /* Our app */
char stream[80]; /* Our stream */
struct ast_frame fr; /* "null" frame */
+ struct ast_module_user *u; /*! for holding a reference to this module */
};
static struct ast_channel *nbs_request(const char *type, int format, void *data, int *cause);
@@ -125,6 +121,7 @@ static void nbs_destroy(struct nbs_pvt *p)
{
if (p->nbs)
nbs_delstream(p->nbs);
+ ast_module_user_remove(p->u);
free(p);
}
@@ -134,6 +131,7 @@ static struct nbs_pvt *nbs_alloc(void *data)
int flags = 0;
char stream[256] = "";
char *opts;
+
strncpy(stream, data, sizeof(stream) - 1);
if ((opts = strchr(stream, ':'))) {
*opts = '\0';
@@ -252,10 +250,7 @@ static struct ast_channel *nbs_new(struct nbs_pvt *i, int state)
strncpy(tmp->exten, "s", sizeof(tmp->exten) - 1);
ast_string_field_set(tmp, language, "");
i->owner = tmp;
- ast_mutex_lock(&usecnt_lock);
- usecnt++;
- ast_mutex_unlock(&usecnt_lock);
- ast_update_use_count();
+ i->u = ast_module_user_add(tmp);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
@@ -289,37 +284,21 @@ static struct ast_channel *nbs_request(const char *type, int format, void *data,
return tmp;
}
-static int __unload_module(void)
+static int unload_module(void)
{
/* First, take us out of the channel loop */
ast_channel_unregister(&nbs_tech);
return 0;
}
-static int unload_module(void *mod)
-{
- return __unload_module();
-}
-
-static int load_module(void *mod)
+static int load_module(void)
{
/* Make sure we can register our channel type */
if (ast_channel_register(&nbs_tech)) {
ast_log(LOG_ERROR, "Unable to register channel class %s\n", type);
- __unload_module();
return -1;
}
return 0;
}
-static const char *description(void)
-{
- return (char *) desc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Network Broadcast Sound Support");
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 99ad26046..b2981463c 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -1525,7 +1525,7 @@ error:
return NULL;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int i;
struct ast_config *cfg;
@@ -1563,7 +1563,7 @@ static int load_module(void *mod)
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct chan_oss_pvt *o;
@@ -1587,16 +1587,4 @@ static int unload_module(void *mod)
return 0;
}
-static const char *description(void)
-{
- return (char *)oss_tech.description;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
-
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "OSS Console Channel Driver");
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index c6455111f..87e971abb 100644
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -88,7 +88,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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";
@@ -1328,12 +1327,12 @@ static int __unload_module(void)
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;
@@ -1442,16 +1441,4 @@ static int load_module(void *mod)
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");
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b512cd974..a2647b3fc 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -215,7 +215,6 @@ static struct ast_jb_conf default_jbconf =
};
static struct ast_jb_conf global_jbconf;
-static const char tdesc[] = "Session Initiation Protocol (SIP)";
static const char config[] = "sip.conf";
static const char notify_config[] = "sip_notify.conf";
static int usecnt = 0;
@@ -16408,7 +16407,7 @@ static int sip_reload(int fd, int argc, char *argv[])
}
/*! \brief reload: Part of Asterisk module interface */
-static int reload(void *mod)
+static int reload(void)
{
return sip_reload(0, 0, NULL);
}
@@ -16444,7 +16443,7 @@ static struct ast_cli_entry my_clis[] = {
};
/*! \brief load_module: PBX load module - initialization */
-static int load_module(void *mod)
+static int load_module(void)
{
ASTOBJ_CONTAINER_INIT(&userl); /* User object list */
ASTOBJ_CONTAINER_INIT(&peerl); /* Peer object list */
@@ -16502,7 +16501,7 @@ static int load_module(void *mod)
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
struct sip_pvt *p, *pl;
@@ -16578,14 +16577,8 @@ static int unload_module(void *mod)
return 0;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return (char *) tdesc;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Session Initiation Protocol (SIP)",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 3edd4463f..4d31969dc 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -4342,7 +4342,7 @@ static void delete_devices(void)
ast_mutex_unlock(&devicelock);
}
-static int reload(void *mod)
+static int reload(void)
{
delete_devices();
reload_config();
@@ -4350,8 +4350,7 @@ static int reload(void *mod)
return 0;
}
-
-static int load_module(void *mod)
+static int load_module(void)
{
int res = 0;
@@ -4389,7 +4388,7 @@ static int load_module(void *mod)
return res;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
#if 0
struct skinnysession *s;
@@ -4443,14 +4442,8 @@ static int unload_module(void *mod)
return -1;
}
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-static const char *description(void)
-{
- return "Skinny Client Control Protocol (Skinny)";
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Skinny Client Control Protocol (Skinny)",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index f8a81e931..27714f9c5 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -10212,7 +10212,7 @@ static int __unload_module(void)
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
#ifdef HAVE_PRI
int y;
@@ -11064,7 +11064,7 @@ static int setup_zap(int reload)
return 0;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
@@ -11210,7 +11210,7 @@ static int zt_sendtext(struct ast_channel *c, const char *text)
}
-static int reload(void *mod)
+static int reload(void)
{
int res = 0;
@@ -11222,20 +11222,14 @@ static int reload(void *mod)
return 0;
}
-static const char *description(void)
-{
- return "Zapata Telephony"
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Zapata Telephony"
#ifdef ZAPATA_PRI
" w/PRI"
#endif
- ;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+ ,
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
diff --git a/channels/h323/Makefile b/channels/h323/Makefile
index 35023177e..2b9fb4d4c 100644
--- a/channels/h323/Makefile
+++ b/channels/h323/Makefile
@@ -10,7 +10,6 @@
STDCCFLAGS += -DNDEBUG
STDCCFLAGS += $(shell grep ^DEBUG_THREADS ../../Makefile | sed -e "s/^DEBUG_THREADS[ ]*=//" -e "s/\([^\#]*\)\#.*/\1/")
STDCCFLAGS += -I../../include -include autoconfig.h
-STDCCFLAGS += -fPIC
#OPTCCFLAGS +=
CFLAGS += -pipe
TARGET += libchanh323.a
diff --git a/channels/misdn/Makefile b/channels/misdn/Makefile
index f1838d13e..895dc9dee 100644
--- a/channels/misdn/Makefile
+++ b/channels/misdn/Makefile
@@ -1,30 +1,13 @@
#
-# Makefile
+# Makefile for chan_misdn support
#
-# Make file for chan_misdn support
-#
-
-# Verify those options with main Makefile
-CFLAGS = -pipe -c -Wall -ggdb
-ifeq ($(shell uname -m),x86_64)
-CFLAGS += -fPIC
-endif
-SOURCES = isdn_lib.c isdn_msg_parser.c
-OBJDIR = .
-OBJS = isdn_lib.o isdn_msg_parser.o
-
-all: chan_misdn_lib.a
+all:
%.o: %.c
- $(CC) $(CFLAGS) -o $@ $<
-
-chan_misdn_lib.a: $(OBJS)
- ar crv $@ $(OBJS)
-
+ $(CC) $(CFLAGS) -c -o $@ $<
portinfo: portinfo.o
- $(CC) -L/usr/lib -o $@ $^ -lisdnnet -lmISDN -lpthread
-
+ $(CC) -o $@ $^ -lisdnnet -lmISDN -lpthread
clean:
rm -rf *.a *.o *.so portinfo
diff --git a/channels/misdn/ie.c b/channels/misdn/ie.c
index 712f8132b..892daa7c5 100644
--- a/channels/misdn/ie.c
+++ b/channels/misdn/ie.c
@@ -43,7 +43,8 @@ static void strnncpy(char *dest, char *src, int len, int dst_len)
/* IE_COMPLETE */
-void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -69,8 +70,9 @@ void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete, int nt, s
p[0] = IE_COMPLETE;
}
}
+#endif
-void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete, int nt, struct misdn_bchannel *bc)
+static void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete, int nt, struct misdn_bchannel *bc)
{
*complete = 0;
if (!nt)
@@ -87,7 +89,7 @@ void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete, int nt, s
/* IE_BEARER */
-void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capability, int mode, int rate, int multi, int user, int nt, struct misdn_bchannel *bc)
+static void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capability, int mode, int rate, int multi, int user, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -147,7 +149,7 @@ void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capabilit
p[4+(multi>=0)] = 0xa0 + user;
}
-void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capability, int *mode, int *rate, int *multi, int *user,
+static void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capability, int *mode, int *rate, int *multi, int *user,
int *async, int *urate, int *stopbits, int *dbits, int *parity, int nt, struct misdn_bchannel *bc)
{
int octet;
@@ -260,7 +262,8 @@ void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capabili
/* IE_CALL_ID */
-void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid_len, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -298,8 +301,10 @@ void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid
p[1] = l;
memcpy(p+2, callid, callid_len);
}
+#endif
-void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid_len, int nt, struct misdn_bchannel *bc)
{
char debug[25];
int i;
@@ -332,10 +337,10 @@ void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid
if (MISDN_IE_DEBG) printf(" callid%s\n", debug);
}
-
+#endif
/* IE_CALLED_PN */
-void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, char *number, int nt, struct misdn_bchannel *bc)
+static void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, char *number, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -371,7 +376,7 @@ void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, ch
strncpy((char *)p+3, (char *)number, strlen((char *)number));
}
-void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, char *number, int number_len, int nt, struct misdn_bchannel *bc)
+static void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, char *number, int number_len, int nt, struct misdn_bchannel *bc)
{
*type = -1;
*plan = -1;
@@ -400,7 +405,7 @@ void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, c
/* IE_CALLING_PN */
-void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc)
+static void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -455,7 +460,7 @@ void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, i
}
}
-void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc)
+static void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc)
{
*type = -1;
*plan = -1;
@@ -502,7 +507,7 @@ void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan,
/* IE_CONNECTED_PN */
-void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc)
+static void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -557,7 +562,7 @@ void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan,
}
}
-void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc)
+static void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc)
{
*type = -1;
*plan = -1;
@@ -601,7 +606,7 @@ void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan
/* IE_CAUSE */
-void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc)
+static void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -631,7 +636,9 @@ void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause, i
p[2] = 0x80 + location;
p[3] = 0x80 + cause;
}
-void enc_ie_cause_standalone(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc)
+
+#if 0
+static void enc_ie_cause_standalone(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc)
{
unsigned char *p = msg_put(msg, 4);
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -644,9 +651,9 @@ void enc_ie_cause_standalone(unsigned char **ntmode, msg_t *msg, int location, i
p[2] = 0x80 + location;
p[3] = 0x80 + cause;
}
+#endif
-
-void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause, int nt, struct misdn_bchannel *bc)
+static void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause, int nt, struct misdn_bchannel *bc)
{
*location = -1;
*cause = -1;
@@ -673,7 +680,7 @@ void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause,
/* IE_CHANNEL_ID */
-void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int channel, int nt, struct misdn_bchannel *bc)
+static void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int channel, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -748,7 +755,7 @@ void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int ch
}
}
-void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *channel, int nt, struct misdn_bchannel *bc)
+static void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *channel, int nt, struct misdn_bchannel *bc)
{
struct misdn_stack *stack=get_stack_by_bc(bc);
int pri =stack->pri;
@@ -842,7 +849,7 @@ void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *c
/* IE_DATE */
-void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int nt, struct misdn_bchannel *bc)
+static void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -876,7 +883,7 @@ void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int nt, struct m
/* IE_DISPLAY */
-void enc_ie_display(unsigned char **ntmode, msg_t *msg, char *display, int nt, struct misdn_bchannel *bc)
+static void enc_ie_display(unsigned char **ntmode, msg_t *msg, char *display, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -907,7 +914,8 @@ void enc_ie_display(unsigned char **ntmode, msg_t *msg, char *display, int nt, s
strncpy((char *)p+2, (char *)display, strlen((char *)display));
}
-void dec_ie_display(unsigned char *p, Q931_info_t *qi, char *display, int display_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void dec_ie_display(unsigned char *p, Q931_info_t *qi, char *display, int display_len, int nt, struct misdn_bchannel *bc)
{
*display = '\0';
@@ -929,10 +937,11 @@ void dec_ie_display(unsigned char *p, Q931_info_t *qi, char *display, int displa
if (MISDN_IE_DEBG) printf(" display='%s'\n", display);
}
-
+#endif
/* IE_KEYPAD */
-void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, char *keypad, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, char *keypad, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -956,8 +965,9 @@ void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, char *keypad, int nt, str
p[1] = l;
strncpy((char *)p+2, (char *)keypad, strlen((char *)keypad));
}
+#endif
-void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, char *keypad, int keypad_len, int nt, struct misdn_bchannel *bc)
+static void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, char *keypad, int keypad_len, int nt, struct misdn_bchannel *bc)
{
*keypad = '\0';
@@ -982,7 +992,8 @@ void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, char *keypad, int keypad_l
/* IE_NOTIFY */
-void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -1006,8 +1017,10 @@ void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify, int nt, struc
p[1] = l;
p[2] = 0x80 + notify;
}
+#endif
-void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify, int nt, struct misdn_bchannel *bc)
+#if 0
+static void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify, int nt, struct misdn_bchannel *bc)
{
*notify = -1;
@@ -1029,10 +1042,11 @@ void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify, int nt, struc
if (MISDN_IE_DEBG) printf(" notify=%d\n", *notify);
}
+#endif
/* IE_PROGRESS */
-void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int location, int progress, int nt, struct misdn_bchannel *bc)
+static void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int location, int progress, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -1068,7 +1082,7 @@ void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int locatio
p[3] = 0x80 + progress;
}
-void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *location, int *progress, int nt, struct misdn_bchannel *bc)
+static void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *location, int *progress, int nt, struct misdn_bchannel *bc)
{
*coding = -1;
*location = -1;
@@ -1098,7 +1112,7 @@ void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *locati
/* IE_REDIR_NR (redirecting = during MT_SETUP) */
-void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, int reason, char *number, int nt, struct misdn_bchannel *bc)
+static void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, int reason, char *number, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -1172,7 +1186,7 @@ void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int
}
}
-void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, int *reason, char *number, int number_len, int nt, struct misdn_bchannel *bc)
+static void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, int *reason, char *number, int number_len, int nt, struct misdn_bchannel *bc)
{
*type = -1;
*plan = -1;
@@ -1219,7 +1233,8 @@ void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, in
/* IE_REDIR_DN (redirection = during MT_NOTIFY) */
-void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, char *number, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, char *number, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
/* Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); */
@@ -1269,8 +1284,10 @@ void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int
strncpy((char *)p+3, (char *)number, strlen((char *)number));
}
}
+#endif
-void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, char *number, int number_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, char *number, int number_len, int nt, struct misdn_bchannel *bc)
{
*type = -1;
*plan = -1;
@@ -1305,11 +1322,12 @@ void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, in
if (MISDN_IE_DEBG) printf(" type=%d plan=%d present=%d number='%s'\n", *type, *plan, *present, number);
}
-
+#endif
/* IE_USERUSER */
-void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *user, int user_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *user, int user_len, int nt, struct misdn_bchannel *bc)
{
unsigned char *p;
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
@@ -1348,8 +1366,10 @@ void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *use
p[2] = 0x80 + protocol;
memcpy(p+3, user, user_len);
}
+#endif
-void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *user, int *user_len, int nt, struct misdn_bchannel *bc)
+#if 0
+static void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *user, int *user_len, int nt, struct misdn_bchannel *bc)
{
char debug[768];
int i;
@@ -1382,7 +1402,5 @@ void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *use
if (MISDN_IE_DEBG) printf(" protocol=%d user-user%s\n", *protocol, debug);
}
-
-
-
+#endif
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c
index ea38592bd..b0d2fbe9d 100644
--- a/channels/misdn/isdn_lib.c
+++ b/channels/misdn/isdn_lib.c
@@ -13,9 +13,11 @@
#include <syslog.h>
-#include "isdn_lib_intern.h"
#include <mISDNuser/isdn_debug.h>
+#include "isdn_lib_intern.h"
+#include "isdn_lib.h"
+
void misdn_join_conf(struct misdn_bchannel *bc, int conf_id);
void misdn_split_conf(struct misdn_bchannel *bc, int conf_id);
@@ -232,11 +234,6 @@ void manager_clean_bc(struct misdn_bchannel *bc );
void manager_bchannel_setup (struct misdn_bchannel *bc);
void manager_bchannel_cleanup (struct misdn_bchannel *bc);
-int isdn_msg_get_index(struct isdn_msg msgs[], msg_t *frm, int nt);
-enum event_e isdn_msg_get_event(struct isdn_msg msgs[], msg_t *frm, int nt);
-int isdn_msg_parse_event(struct isdn_msg msgs[], msg_t *frm, struct misdn_bchannel *bc, int nt);
-char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt);
-msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, enum event_e event, int nt);
void ec_chunk( struct misdn_bchannel *bc, unsigned char *rxchunk, unsigned char *txchunk, int chunk_size);
/* end */
int bchdev_echocancel_activate(struct misdn_bchannel* dev);
@@ -275,7 +272,7 @@ static char *bearer2str(int cap) {
static char flip_table[256];
-void init_flip_bits(void)
+static void init_flip_bits(void)
{
int i,k;
@@ -288,7 +285,7 @@ void init_flip_bits(void)
}
}
-char * flip_buf_bits ( char * buf , int len)
+static char * flip_buf_bits ( char * buf , int len)
{
int i;
char * start = buf;
@@ -303,7 +300,7 @@ char * flip_buf_bits ( char * buf , int len)
-msg_t *create_l2msg(int prim, int dinfo, int size) /* NT only */
+static msg_t *create_l2msg(int prim, int dinfo, int size) /* NT only */
{
int i = 0;
msg_t *dmsg;
@@ -364,7 +361,7 @@ msg_t *create_l3msg(int prim, int mt, int dinfo, int size, int ntmode)
}
-int send_msg (int midev, struct misdn_bchannel *bc, msg_t *dmsg)
+static int send_msg (int midev, struct misdn_bchannel *bc, msg_t *dmsg)
{
iframe_t *frm;
frm = (iframe_t *)dmsg->data;
@@ -417,7 +414,7 @@ int misdn_inband_avail(struct misdn_bchannel *bc)
}
-void dump_chan_list(struct misdn_stack *stack)
+static void dump_chan_list(struct misdn_stack *stack)
{
int i;
@@ -460,7 +457,7 @@ static int find_free_chan_in_stack(struct misdn_stack *stack, struct misdn_bchan
return 0;
}
-int empty_chan_in_stack(struct misdn_stack *stack, int channel)
+static 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);
@@ -521,7 +518,7 @@ void bc_state_change(struct misdn_bchannel *bc, enum bchannel_state state)
}
}
-void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state state)
+static void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state state)
{
cb_log(5,bc->port,"BC_NEXT_STATE_CHANGE: from:%s to:%s\n",
bc_state2str(bc->next_bc_state),
@@ -531,7 +528,7 @@ void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state state)
}
-void empty_bc(struct misdn_bchannel *bc)
+static void empty_bc(struct misdn_bchannel *bc)
{
bc->bframe_len=0;
@@ -624,7 +621,7 @@ void empty_bc(struct misdn_bchannel *bc)
}
-int clean_up_bc(struct misdn_bchannel *bc)
+static int clean_up_bc(struct misdn_bchannel *bc)
{
int ret=0;
unsigned char buff[32];
@@ -667,7 +664,7 @@ int clean_up_bc(struct misdn_bchannel *bc)
-void clear_l3(struct misdn_stack *stack)
+static void clear_l3(struct misdn_stack *stack)
{
int i;
@@ -682,7 +679,7 @@ void clear_l3(struct misdn_stack *stack)
}
}
-int set_chan_in_stack(struct misdn_stack *stack, int channel)
+static int set_chan_in_stack(struct misdn_stack *stack, int channel)
{
cb_log(4,stack->port,"set_chan_in_stack: %d\n",channel);
@@ -695,21 +692,22 @@ int set_chan_in_stack(struct misdn_stack *stack, int channel)
return 0;
}
-int chan_in_stack_free(struct misdn_stack *stack, int channel)
+#if 0
+static int chan_in_stack_free(struct misdn_stack *stack, int channel)
{
if (stack->channels[channel-1])
return 0;
return 1;
}
-
+#endif
static int newteid=0;
#define MAXPROCS 0x100
-int misdn_lib_get_l1_down(struct misdn_stack *stack)
+static int misdn_lib_get_l1_down(struct misdn_stack *stack)
{
/* Pull Up L1 */
iframe_t act;
@@ -726,7 +724,7 @@ int misdn_lib_get_l1_down(struct misdn_stack *stack)
}
-int misdn_lib_get_l2_down(struct misdn_stack *stack)
+static int misdn_lib_get_l2_down(struct misdn_stack *stack)
{
if (stack->ptp && (stack->nt) ) {
@@ -752,7 +750,7 @@ int misdn_lib_get_l2_down(struct misdn_stack *stack)
}
-int misdn_lib_get_l1_up(struct misdn_stack *stack)
+static int misdn_lib_get_l1_up(struct misdn_stack *stack)
{
/* Pull Up L1 */
iframe_t act;
@@ -792,7 +790,8 @@ int misdn_lib_get_l2_up(struct misdn_stack *stack)
return 0;
}
-int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack)
+#if 0
+static int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack)
{
iframe_t act;
@@ -804,9 +803,9 @@ int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack)
return mISDN_write(stack->midev, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC);
return 0;
}
+#endif
-
-int misdn_lib_get_short_status(struct misdn_stack *stack)
+static int misdn_lib_get_short_status(struct misdn_stack *stack)
{
iframe_t act;
@@ -1342,7 +1341,7 @@ void stack_destroy(struct misdn_stack* stack)
}
-struct misdn_stack * find_stack_by_addr(int addr)
+static struct misdn_stack * find_stack_by_addr(int addr)
{
struct misdn_stack *stack;
@@ -1357,7 +1356,7 @@ struct misdn_stack * find_stack_by_addr(int addr)
}
-struct misdn_stack * find_stack_by_port(int port)
+static struct misdn_stack * find_stack_by_port(int port)
{
struct misdn_stack *stack;
@@ -1369,7 +1368,7 @@ struct misdn_stack * find_stack_by_port(int port)
return NULL;
}
-struct misdn_stack * find_stack_by_mgr(manager_t* mgr_nt)
+static struct misdn_stack * find_stack_by_mgr(manager_t* mgr_nt)
{
struct misdn_stack *stack;
@@ -1381,7 +1380,7 @@ struct misdn_stack * find_stack_by_mgr(manager_t* mgr_nt)
return NULL;
}
-struct misdn_bchannel *find_bc_by_masked_l3id(struct misdn_stack *stack, unsigned long l3id, unsigned long mask)
+static struct misdn_bchannel *find_bc_by_masked_l3id(struct misdn_stack *stack, unsigned long l3id, unsigned long mask)
{
int i;
for (i=0; i<stack->b_num; i++) {
@@ -1400,7 +1399,7 @@ struct misdn_bchannel *find_bc_by_l3id(struct misdn_stack *stack, unsigned long
return stack_holder_find(stack,l3id);
}
-struct misdn_bchannel *find_bc_holded(struct misdn_stack *stack)
+static struct misdn_bchannel *find_bc_holded(struct misdn_stack *stack)
{
int i;
for (i=0; i<stack->b_num; i++) {
@@ -1410,7 +1409,7 @@ struct misdn_bchannel *find_bc_holded(struct misdn_stack *stack)
}
-struct misdn_bchannel *find_bc_by_addr(unsigned long addr)
+static struct misdn_bchannel *find_bc_by_addr(unsigned long addr)
{
struct misdn_stack* stack;
int i;
@@ -1434,7 +1433,7 @@ struct misdn_bchannel *find_bc_by_addr(unsigned long addr)
}
-struct misdn_bchannel *find_bc_by_channel(int port, int channel)
+static struct misdn_bchannel *find_bc_by_channel(int port, int channel)
{
struct misdn_stack* stack=find_stack_by_port(port);
int i;
@@ -1454,7 +1453,7 @@ struct misdn_bchannel *find_bc_by_channel(int port, int channel)
-int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm)
+static int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm)
{
struct misdn_stack *stack=get_stack_by_bc(bc);
@@ -1528,7 +1527,7 @@ int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm)
return 0;
}
-int handle_new_process(struct misdn_stack *stack, iframe_t *frm)
+static int handle_new_process(struct misdn_stack *stack, iframe_t *frm)
{
struct misdn_bchannel* bc=misdn_lib_get_free_bc(stack->port, 0);
@@ -1544,7 +1543,7 @@ int handle_new_process(struct misdn_stack *stack, iframe_t *frm)
return 0;
}
-int handle_cr ( struct misdn_stack *stack, iframe_t *frm)
+static int handle_cr ( struct misdn_stack *stack, iframe_t *frm)
{
if (!stack) return -1;
@@ -2094,7 +2093,7 @@ handle_event_nt(void *dat, void *arg)
}
-int handle_timers(msg_t* msg)
+static int handle_timers(msg_t* msg)
{
iframe_t *frm= (iframe_t*)msg->data;
struct misdn_stack *stack;
@@ -2235,7 +2234,7 @@ void misdn_tx_jitter(struct misdn_bchannel *bc, int len)
}
}
-int handle_bchan(msg_t *msg)
+static int handle_bchan(msg_t *msg)
{
iframe_t *frm= (iframe_t*)msg->data;
@@ -2497,7 +2496,7 @@ int handle_bchan(msg_t *msg)
-int handle_frm_nt(msg_t *msg)
+static int handle_frm_nt(msg_t *msg)
{
iframe_t *frm= (iframe_t*)msg->data;
struct misdn_stack *stack;
@@ -2532,7 +2531,7 @@ int handle_frm_nt(msg_t *msg)
}
-int handle_frm(msg_t *msg)
+static int handle_frm(msg_t *msg)
{
iframe_t *frm = (iframe_t*) msg->data;
@@ -2630,7 +2629,7 @@ handle_frm_bc:
}
-int handle_l1(msg_t *msg)
+static int handle_l1(msg_t *msg)
{
iframe_t *frm = (iframe_t*) msg->data;
struct misdn_stack *stack = find_stack_by_addr(frm->addr);
@@ -2700,7 +2699,7 @@ int handle_l1(msg_t *msg)
return 0;
}
-int handle_l2(msg_t *msg)
+static int handle_l2(msg_t *msg)
{
iframe_t *frm = (iframe_t*) msg->data;
@@ -2747,7 +2746,7 @@ int handle_l2(msg_t *msg)
return 0;
}
-int handle_mgmt(msg_t *msg)
+static int handle_mgmt(msg_t *msg)
{
iframe_t *frm = (iframe_t*) msg->data;
@@ -2824,7 +2823,7 @@ int handle_mgmt(msg_t *msg)
}
-msg_t *fetch_msg(int midev)
+static msg_t *fetch_msg(int midev)
{
msg_t *msg=alloc_msg(MAX_MSG_SIZE);
int r;
@@ -3012,7 +3011,7 @@ struct misdn_bchannel *manager_find_bc_holded(struct misdn_bchannel* bc)
-void prepare_bc(struct misdn_bchannel*bc, int channel)
+static void prepare_bc(struct misdn_bchannel*bc, int channel)
{
bc->channel = channel;
bc->channel_preselected = channel?1:0;
@@ -3080,7 +3079,8 @@ struct misdn_bchannel* misdn_lib_get_free_bc(int port, int channel)
}
-char *fac2str (enum FacFunction func) {
+static char *fac2str (enum FacFunction func)
+{
struct arr_el {
enum FacFunction p;
char *s ;
@@ -3329,7 +3329,7 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
}
-int handle_err(msg_t *msg)
+static int handle_err(msg_t *msg)
{
iframe_t *frm = (iframe_t*) msg->data;
@@ -3412,8 +3412,9 @@ int handle_err(msg_t *msg)
return 0;
}
-
-int queue_l2l3(msg_t *msg) {
+#if 0
+static int queue_l2l3(msg_t *msg)
+{
iframe_t *frm= (iframe_t*)msg->data;
struct misdn_stack *stack;
stack=find_stack_by_addr( frm->addr );
@@ -3427,6 +3428,7 @@ int queue_l2l3(msg_t *msg) {
sem_post(&glob_mgr->new_msg);
return 1;
}
+#endif
int manager_isdn_handler(iframe_t *frm ,msg_t *msg)
{
@@ -3578,7 +3580,7 @@ int misdn_lib_port_restart(int port)
sem_t handler_started;
-void manager_event_handler(void *arg)
+static void manager_event_handler(void *arg)
{
sem_post(&handler_started);
while (1) {
@@ -4261,7 +4263,7 @@ void misdn_lib_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2)
};
struct misdn_bchannel **bc;
- for (bc=bc_list; *bc; *bc++) {
+ for (bc=bc_list; *bc; bc++) {
(*bc)->conf_id=conf_id;
cb_log(1, (*bc)->port, " --> bc_addr:%x\n",(*bc)->addr);
@@ -4284,7 +4286,7 @@ void misdn_lib_split_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel
};
struct misdn_bchannel **bc;
- for (bc=bc_list; *bc; *bc++) {
+ for (bc=bc_list; *bc; bc++) {
if ( (*bc)->bc_state == BCHAN_BRIDGED){
misdn_split_conf( *bc, (*bc)->conf_id);
} else {
diff --git a/channels/misdn/isdn_lib.h b/channels/misdn/isdn_lib.h
index 1d38bb4fa..d849a7ce8 100644
--- a/channels/misdn/isdn_lib.h
+++ b/channels/misdn/isdn_lib.h
@@ -458,5 +458,4 @@ char *bc_state2str(enum bchannel_state state);
void bc_state_change(struct misdn_bchannel *bc, enum bchannel_state state);
-
#endif
diff --git a/channels/misdn/isdn_lib_intern.h b/channels/misdn/isdn_lib_intern.h
index 6dbc3afb7..86d95a9fe 100644
--- a/channels/misdn/isdn_lib_intern.h
+++ b/channels/misdn/isdn_lib_intern.h
@@ -11,7 +11,6 @@
#include "isdn_lib.h"
-
#if !defined MISDNUSER_VERSION_CODE || (MISDNUSER_VERSION_CODE < MISDNUSER_VERSION(1, 0, 3))
#error "You need a newer version of mISDNuser ..."
#endif
@@ -104,6 +103,13 @@ struct misdn_stack {
struct misdn_stack* get_stack_by_bc(struct misdn_bchannel *bc);
+int isdn_msg_get_index(struct isdn_msg msgs[], msg_t *frm, int nt);
+enum event_e isdn_msg_get_event(struct isdn_msg msgs[], msg_t *frm, int nt);
+int isdn_msg_parse_event(struct isdn_msg msgs[], msg_t *frm, struct misdn_bchannel *bc, int nt);
+char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt);
+msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, enum event_e event, int nt);
+int isdn_msg_get_index_by_event(struct isdn_msg msgs[], enum event_e event, int nt);
+char * isdn_msg_get_info(struct isdn_msg msgs[], msg_t *msg, int nt);
#endif
diff --git a/channels/misdn/isdn_msg_parser.c b/channels/misdn/isdn_msg_parser.c
index a7fbf4e79..4179d8e60 100644
--- a/channels/misdn/isdn_msg_parser.c
+++ b/channels/misdn/isdn_msg_parser.c
@@ -20,7 +20,8 @@
#include "ie.c"
-void set_channel(struct misdn_bchannel *bc, int channel) {
+static void set_channel(struct misdn_bchannel *bc, int channel)
+{
cb_log(3,bc->port,"set_channel: bc->channel:%d channel:%d\n", bc->channel, channel);
@@ -47,7 +48,7 @@ void set_channel(struct misdn_bchannel *bc, int channel) {
}
}
-void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CALL_PROCEEDING_t *proceeding=(CALL_PROCEEDING_t*)((unsigned long)msg->data+ HEADER_LEN);
@@ -68,7 +69,7 @@ void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel
printf("Parsing PROCEEDING Msg\n");
#endif
}
-msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CALL_PROCEEDING_t *proceeding;
@@ -88,7 +89,7 @@ msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int
return msg;
}
-void parse_alerting (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_alerting (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
ALERTING_t *alerting=(ALERTING_t*)((unsigned long)(msg->data+HEADER_LEN));
@@ -102,7 +103,8 @@ void parse_alerting (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *
}
-msg_t *build_alerting (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_alerting (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
ALERTING_t *alerting;
@@ -121,7 +123,7 @@ msg_t *build_alerting (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt
}
-void parse_progress (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_progress (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
PROGRESS_t *progress=(PROGRESS_t*)((unsigned long)(msg->data+HEADER_LEN));
@@ -134,7 +136,7 @@ void parse_progress (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *
#endif
}
-msg_t *build_progress (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_progress (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
PROGRESS_t *progress;
@@ -148,7 +150,7 @@ msg_t *build_progress (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt
return msg;
}
-void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SETUP_t *setup= (SETUP_t*)((unsigned long)msg->data+HEADER_LEN);
@@ -256,7 +258,7 @@ void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc,
}
#define ANY_CHANNEL 0xff /* IE attribut for 'any channel' */
-msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SETUP_t *setup;
@@ -331,7 +333,7 @@ msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
return msg;
}
-void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CONNECT_t *connect=(CONNECT_t*)((unsigned long)(msg->data+HEADER_LEN));
@@ -353,7 +355,8 @@ void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b
printf("Parsing CONNECT Msg\n");
#endif
}
-msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CONNECT_t *connect;
@@ -380,7 +383,7 @@ msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
return msg;
}
-void parse_setup_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_setup_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SETUP_ACKNOWLEDGE_t *setup_acknowledge=(SETUP_ACKNOWLEDGE_t*)((unsigned long)(msg->data+HEADER_LEN));
@@ -400,7 +403,8 @@ void parse_setup_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_b
}
-msg_t *build_setup_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_setup_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SETUP_ACKNOWLEDGE_t *setup_acknowledge;
@@ -419,7 +423,7 @@ msg_t *build_setup_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *b
return msg;
}
-void parse_connect_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_connect_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing CONNECT_ACKNOWLEDGE Msg\n");
@@ -427,7 +431,8 @@ void parse_connect_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn
}
-msg_t *build_connect_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_connect_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
CONNECT_ACKNOWLEDGE_t *connect_acknowledge;
@@ -443,7 +448,7 @@ msg_t *build_connect_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel
return msg;
}
-void parse_user_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_user_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing USER_INFORMATION Msg\n");
@@ -451,7 +456,8 @@ void parse_user_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc
}
-msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
USER_INFORMATION_t *user_information;
@@ -465,7 +471,7 @@ msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc
return msg;
}
-void parse_suspend_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_suspend_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing SUSPEND_REJECT Msg\n");
@@ -473,7 +479,8 @@ void parse_suspend_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bcha
}
-msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SUSPEND_REJECT_t *suspend_reject;
@@ -487,7 +494,7 @@ msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc,
return msg;
}
-void parse_resume_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_resume_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RESUME_REJECT Msg\n");
@@ -495,7 +502,8 @@ void parse_resume_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchan
}
-msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RESUME_REJECT_t *resume_reject;
@@ -509,7 +517,7 @@ msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, i
return msg;
}
-void parse_hold (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_hold (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing HOLD Msg\n");
@@ -517,7 +525,8 @@ void parse_hold (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc,
}
-msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
HOLD_t *hold;
@@ -531,7 +540,7 @@ msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
return msg;
}
-void parse_suspend (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_suspend (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing SUSPEND Msg\n");
@@ -539,7 +548,8 @@ void parse_suspend (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b
}
-msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SUSPEND_t *suspend;
@@ -553,7 +563,7 @@ msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
return msg;
}
-void parse_resume (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_resume (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RESUME Msg\n");
@@ -561,7 +571,8 @@ void parse_resume (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc
}
-msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RESUME_t *resume;
@@ -575,7 +586,7 @@ msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
return msg;
}
-void parse_hold_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_hold_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing HOLD_ACKNOWLEDGE Msg\n");
@@ -583,7 +594,8 @@ void parse_hold_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc
}
-msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
HOLD_ACKNOWLEDGE_t *hold_acknowledge;
@@ -597,7 +609,7 @@ msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc
return msg;
}
-void parse_suspend_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_suspend_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing SUSPEND_ACKNOWLEDGE Msg\n");
@@ -605,7 +617,8 @@ void parse_suspend_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn
}
-msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
SUSPEND_ACKNOWLEDGE_t *suspend_acknowledge;
@@ -619,7 +632,7 @@ msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel
return msg;
}
-void parse_resume_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_resume_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RESUME_ACKNOWLEDGE Msg\n");
@@ -627,7 +640,8 @@ void parse_resume_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_
}
-msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RESUME_ACKNOWLEDGE_t *resume_acknowledge;
@@ -641,7 +655,7 @@ msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *
return msg;
}
-void parse_hold_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_hold_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing HOLD_REJECT Msg\n");
@@ -649,7 +663,8 @@ void parse_hold_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchanne
}
-msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
HOLD_REJECT_t *hold_reject;
@@ -663,7 +678,7 @@ msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int
return msg;
}
-void parse_retrieve (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_retrieve (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RETRIEVE Msg\n");
@@ -671,7 +686,8 @@ void parse_retrieve (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *
}
-msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RETRIEVE_t *retrieve;
@@ -685,7 +701,7 @@ msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt
return msg;
}
-void parse_retrieve_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_retrieve_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RETRIEVE_ACKNOWLEDGE Msg\n");
@@ -693,7 +709,8 @@ void parse_retrieve_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misd
}
-msg_t *build_retrieve_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_retrieve_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RETRIEVE_ACKNOWLEDGE_t *retrieve_acknowledge;
@@ -708,7 +725,7 @@ msg_t *build_retrieve_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel
return msg;
}
-void parse_retrieve_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_retrieve_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing RETRIEVE_REJECT Msg\n");
@@ -716,7 +733,8 @@ void parse_retrieve_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bch
}
-msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RETRIEVE_REJECT_t *retrieve_reject;
@@ -730,7 +748,7 @@ msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc,
return msg;
}
-void parse_disconnect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_disconnect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
DISCONNECT_t *disconnect=(DISCONNECT_t*)((unsigned long)(msg->data+HEADER_LEN));
@@ -745,7 +763,8 @@ void parse_disconnect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel
}
-msg_t *build_disconnect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_disconnect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
DISCONNECT_t *disconnect;
@@ -762,7 +781,7 @@ msg_t *build_disconnect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int
return msg;
}
-void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RESTART_t *restart=(RESTART_t*)((unsigned long)(msg->data+HEADER_LEN));
@@ -774,8 +793,9 @@ void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b
#endif
{
- int exclusive, channel;
+ int exclusive, channel = 0;
dec_ie_channel_id(restart->CHANNEL_ID, (Q931_info_t *)restart, &exclusive, &bc->restart_channel, nt,bc);
+ /* XXX: this is broken... channel is not used */
if (channel==0xff) /* any channel */
channel=-1;
cb_log(3, stack->port, "CC_RESTART Request on channel:%d on this port.\n");
@@ -783,7 +803,8 @@ void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b
}
-msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RESTART_t *restart;
@@ -797,7 +818,7 @@ msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
return msg;
}
-void parse_release (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_release (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RELEASE_t *release=(RELEASE_t*)((unsigned long)(msg->data+HEADER_LEN));
@@ -810,7 +831,8 @@ void parse_release (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b
}
-msg_t *build_release (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+
+static msg_t *build_release (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RELEASE_t *release;
@@ -827,7 +849,7 @@ msg_t *build_release (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
return msg;
}
-void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RELEASE_COMPLETE_t *release_complete=(RELEASE_COMPLETE_t*)((unsigned long)(msg->data+HEADER_LEN));
@@ -859,7 +881,7 @@ void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc
#endif
}
-msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
RELEASE_COMPLETE_t *release_complete;
@@ -875,7 +897,7 @@ msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc
return msg;
}
-void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt ? mISDNUSER_HEAD_SIZE : mISDN_HEADER_LEN;
FACILITY_t *facility = (FACILITY_t*)(msg->data+HEADER_LEN);
@@ -902,7 +924,7 @@ void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *
}
}
-msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int len,
HEADER_LEN = nt ? mISDNUSER_HEAD_SIZE : mISDN_HEADER_LEN;
@@ -938,14 +960,14 @@ msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt
return msg;
}
-void parse_notify (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_notify (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing NOTIFY Msg\n");
#endif
}
-msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
NOTIFY_t *notify;
@@ -959,14 +981,14 @@ msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
return msg;
}
-void parse_status_enquiry (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_status_enquiry (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing STATUS_ENQUIRY Msg\n");
#endif
}
-msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
STATUS_ENQUIRY_t *status_enquiry;
@@ -980,7 +1002,7 @@ msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc,
return msg;
}
-void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
INFORMATION_t *information=(INFORMATION_t*)((unsigned long)(msg->data+HEADER_LEN));
@@ -998,7 +1020,7 @@ void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchanne
#endif
}
-msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
INFORMATION_t *information;
@@ -1023,7 +1045,7 @@ msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int
return msg;
}
-void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
STATUS_t *status=(STATUS_t*)((unsigned long)(msg->data+HEADER_LEN));
@@ -1037,7 +1059,7 @@ void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc
#endif
}
-msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
STATUS_t *status;
@@ -1051,14 +1073,14 @@ msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
return msg;
}
-void parse_timeout (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
+static void parse_timeout (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt)
{
#if DEBUG
printf("Parsing STATUS Msg\n");
#endif
}
-msg_t *build_timeout (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
+static msg_t *build_timeout (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
{
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
STATUS_t *status;
@@ -1269,4 +1291,3 @@ msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc,
return msgs[i].msg_builder(msgs, bc, nt);
}
-