[asterisk-commits] branch oej/peermatch r17370 - in
/team/oej/peermatch: ./ apps/ channels/ chan...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Apr 4 11:46:10 MST 2006
Author: oej
Date: Tue Apr 4 13:45:33 2006
New Revision: 17370
URL: http://svn.digium.com/view/asterisk?rev=17370&view=rev
Log:
Reset automerge - no conflict ???
Added:
team/oej/peermatch/doc/ajam.txt
- copied unchanged from r17369, trunk/doc/ajam.txt
team/oej/peermatch/static-http/
- copied from r17369, trunk/static-http/
team/oej/peermatch/static-http/ajamdemo.html
- copied unchanged from r17369, trunk/static-http/ajamdemo.html
team/oej/peermatch/static-http/astman.css
- copied unchanged from r17369, trunk/static-http/astman.css
team/oej/peermatch/static-http/astman.js
- copied unchanged from r17369, trunk/static-http/astman.js
team/oej/peermatch/static-http/prototype.js
- copied unchanged from r17369, trunk/static-http/prototype.js
Removed:
team/oej/peermatch/formats/format_au.c
team/oej/peermatch/formats/format_pcm_alaw.c
Modified:
team/oej/peermatch/ (props changed)
team/oej/peermatch/.cleancount
team/oej/peermatch/Makefile
team/oej/peermatch/README
team/oej/peermatch/apps/app_alarmreceiver.c
team/oej/peermatch/apps/app_queue.c
team/oej/peermatch/apps/app_rpt.c
team/oej/peermatch/apps/app_senddtmf.c
team/oej/peermatch/channel.c
team/oej/peermatch/channels/chan_h323.c
team/oej/peermatch/channels/chan_iax2.c
team/oej/peermatch/channels/chan_misdn.c
team/oej/peermatch/channels/chan_sip.c
team/oej/peermatch/channels/chan_zap.c
team/oej/peermatch/channels/h323/ast_h323.cpp
team/oej/peermatch/channels/misdn/isdn_lib.c
team/oej/peermatch/channels/misdn/isdn_lib.h
team/oej/peermatch/cli.c
team/oej/peermatch/configs/features.conf.sample
team/oej/peermatch/configs/http.conf.sample
team/oej/peermatch/configs/manager.conf.sample
team/oej/peermatch/configs/sip.conf.sample
team/oej/peermatch/devicestate.c
team/oej/peermatch/doc/00README.1st
team/oej/peermatch/doc/CODING-GUIDELINES
team/oej/peermatch/doc/manager.txt
team/oej/peermatch/file.c
team/oej/peermatch/formats/Makefile
team/oej/peermatch/formats/format_g723.c
team/oej/peermatch/formats/format_g726.c
team/oej/peermatch/formats/format_g729.c
team/oej/peermatch/formats/format_gsm.c
team/oej/peermatch/formats/format_h263.c
team/oej/peermatch/formats/format_h264.c
team/oej/peermatch/formats/format_ilbc.c
team/oej/peermatch/formats/format_ogg_vorbis.c
team/oej/peermatch/formats/format_pcm.c
team/oej/peermatch/formats/format_sln.c
team/oej/peermatch/formats/format_vox.c
team/oej/peermatch/formats/format_wav.c
team/oej/peermatch/formats/format_wav_gsm.c
team/oej/peermatch/http.c
team/oej/peermatch/include/asterisk/channel.h
team/oej/peermatch/include/asterisk/doxyref.h
team/oej/peermatch/include/asterisk/file.h
team/oej/peermatch/include/asterisk/http.h
team/oej/peermatch/include/asterisk/linkedlists.h
team/oej/peermatch/include/asterisk/manager.h
team/oej/peermatch/include/asterisk/pbx.h
team/oej/peermatch/loader.c
team/oej/peermatch/manager.c
team/oej/peermatch/pbx.c
team/oej/peermatch/rtp.c
Propchange: team/oej/peermatch/
------------------------------------------------------------------------------
automerge = http://edvina.net/training/
Propchange: team/oej/peermatch/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.
Propchange: team/oej/peermatch/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/oej/peermatch/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Apr 4 13:45:33 2006
@@ -1,1 +1,1 @@
-/trunk:1-16722
+/trunk:1-17369
Modified: team/oej/peermatch/.cleancount
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/.cleancount?rev=17370&r1=17369&r2=17370&view=diff
==============================================================================
--- team/oej/peermatch/.cleancount (original)
+++ team/oej/peermatch/.cleancount Tue Apr 4 13:45:33 2006
@@ -1,1 +1,1 @@
-12
+13
Modified: team/oej/peermatch/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/Makefile?rev=17370&r1=17369&r2=17370&view=diff
==============================================================================
--- team/oej/peermatch/Makefile (original)
+++ team/oej/peermatch/Makefile Tue Apr 4 13:45:33 2006
@@ -566,6 +566,13 @@
datafiles: all
if [ x`$(ID) -un` = xroot ]; then sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
+ # Should static HTTP be installed during make samples or even with its own target ala
+ # webvoicemail? There are portions here that *could* be customized but might also be
+ # improved a lot. I'll put it here for now.
+ mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/static-http
+ for x in static-http/*; do \
+ install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/static-http ; \
+ done
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
for x in sounds/digits/*.gsm; do \
Modified: team/oej/peermatch/README
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/README?rev=17370&r1=17369&r2=17370&view=diff
==============================================================================
--- team/oej/peermatch/README (original)
+++ team/oej/peermatch/README Tue Apr 4 13:45:33 2006
@@ -2,14 +2,14 @@
by Mark Spencer <markster at digium.com>
and the Asterisk.org developer community
-Copyright (C) 2001-2005 Digium, Inc.
+Copyright (C) 2001-2006 Digium, Inc.
and other copyright holders.
================================================================
* SECURITY
It is imperative that you read and fully understand the contents of
-the SECURITY file before you attempt to configure and run an Asterisk
-server.
+the security information file (doc/security.txt) before you attempt
+to configure and run an Asterisk server.
* WHAT IS ASTERISK ?
Asterisk is an Open Source PBX and telephony toolkit. It is, in a
@@ -84,11 +84,18 @@
So let's proceed:
-1) Run "make"
+1) Read the README files.
+ There are more README files than this one in the doc/ directory.
+ Start with doc/00README.1st
+ You may also want to check the configuration files that contain
+ examples and reference guides. They are all in the configs/
+ directory.
+
+2) Run "make"
Assuming the build completes successfully:
-2) Run "make install"
+3) Run "make install"
Each time you update or checkout from the repository, you are strongly
encouraged to ensure all previous object files are removed to avoid internal
@@ -99,7 +106,7 @@
If this is your first time working with Asterisk, you may wish to install
the sample PBX, with demonstration extensions, etc. If so, run:
-3) "make samples"
+4) "make samples"
Doing so will overwrite any existing config files you have.
Modified: team/oej/peermatch/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/apps/app_alarmreceiver.c?rev=17370&r1=17369&r2=17370&view=diff
==============================================================================
--- team/oej/peermatch/apps/app_alarmreceiver.c (original)
+++ team/oej/peermatch/apps/app_alarmreceiver.c Tue Apr 4 13:45:33 2006
@@ -551,13 +551,12 @@
checksum = checksum % 15;
- if(checksum){
+ if (checksum) {
database_increment("checksum-errors");
- if(option_verbose >= 2){
+ if (option_verbose >= 2)
ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Nonzero checksum\n");
ast_log(LOG_DEBUG, "AlarmReceiver: Nonzero checksum\n");
continue;
- }
}
/* Check the message type for correctness */
Modified: team/oej/peermatch/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/apps/app_queue.c?rev=17370&r1=17369&r2=17370&view=diff
==============================================================================
--- team/oej/peermatch/apps/app_queue.c (original)
+++ team/oej/peermatch/apps/app_queue.c Tue Apr 4 13:45:33 2006
@@ -1211,7 +1211,7 @@
ast_mutex_lock(&qe->parent->lock);
if (newvalue <= qe->parent->servicelevel)
- qe->parent->callscompletedinsl++;
+ qe->parent->callscompletedinsl++;
oldvalue = qe->parent->holdtime;
qe->parent->holdtime = (((oldvalue << 2) - oldvalue) + newvalue) >> 2;
ast_mutex_unlock(&qe->parent->lock);
@@ -1753,7 +1753,7 @@
if (f) {
if (f->frametype == AST_FRAME_CONTROL) {
switch(f->subclass) {
- case AST_CONTROL_ANSWER:
+ case AST_CONTROL_ANSWER:
/* This is our guy if someone answered. */
if (!peer) {
if (option_verbose > 2)
@@ -2193,7 +2193,7 @@
/* Agent must have hung up */
ast_log(LOG_WARNING, "Agent on %s hungup on the customer. They're going to be pissed.\n", peer->name);
ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "AGENTDUMP", "%s", "");
- record_abandoned(qe);
+ record_abandoned(qe);
if (qe->parent->eventwhencalled) {
manager_event(EVENT_FLAG_AGENT, "AgentDump",
"Queue: %s\r\n"
@@ -2223,7 +2223,7 @@
if (res < 0) {
ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "SYSCOMPAT", "%s", "");
ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", qe->chan->name, peer->name);
- record_abandoned(qe);
+ record_abandoned(qe);
ast_hangup(peer);
return -1;
}
@@ -2403,7 +2403,7 @@
free(last_member);
if (queue_persistent_members)
- dump_queue_members(q);
+ dump_queue_members(q);
res = RES_OKAY;
} else {
@@ -2440,17 +2440,17 @@
new_member->next = q->members;
q->members = new_member;
manager_event(EVENT_FLAG_AGENT, "QueueMemberAdded",
- "Queue: %s\r\n"
- "Location: %s\r\n"
- "Membership: %s\r\n"
- "Penalty: %d\r\n"
- "CallsTaken: %d\r\n"
- "LastCall: %d\r\n"
- "Status: %d\r\n"
- "Paused: %d\r\n",
- q->name, new_member->interface, new_member->dynamic ? "dynamic" : "static",
- new_member->penalty, new_member->calls, (int)new_member->lastcall, new_member->status, new_member->paused);
-
+ "Queue: %s\r\n"
+ "Location: %s\r\n"
+ "Membership: %s\r\n"
+ "Penalty: %d\r\n"
+ "CallsTaken: %d\r\n"
+ "LastCall: %d\r\n"
+ "Status: %d\r\n"
+ "Paused: %d\r\n",
+ q->name, new_member->interface, new_member->dynamic ? "dynamic" : "static",
+ new_member->penalty, new_member->calls, (int)new_member->lastcall, new_member->status, new_member->paused);
+
if (dump)
dump_queue_members(q);
@@ -2489,7 +2489,7 @@
mem->paused = paused;
if (queue_persistent_members)
- dump_queue_members(q);
+ dump_queue_members(q);
ast_queue_log(q->name, "NONE", interface, (paused ? "PAUSE" : "UNPAUSE"), "%s", "");
@@ -2944,7 +2944,7 @@
check_turns:
if (ringing) {
ast_indicate(chan, AST_CONTROL_RINGING);
- } else {
+ } else {
ast_moh_start(chan, qe.moh);
}
for (;;) {
@@ -2958,8 +2958,8 @@
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ABANDON", "%d|%d|%ld", qe.pos, qe.opos, (long)time(NULL) - qe.start);
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "User disconnected from queue %s while waiting their turn\n", args.queuename);
- res = -1;
}
+ res = -1;
break;
}
if (!res)
@@ -2981,7 +2981,7 @@
/* Leave if we have exceeded our queuetimeout */
if (qe.expire && (time(NULL) > qe.expire)) {
- record_abandoned(&qe);
+ record_abandoned(&qe);
reason = QUEUE_TIMEOUT;
res = 0;
ast_queue_log(args.queuename, chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
@@ -3057,8 +3057,8 @@
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "ABANDON", "%d|%d|%ld", qe.pos, qe.opos, (long)time(NULL) - qe.start);
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "User disconnected from queue %s when they almost made it\n", args.queuename);
- res = -1;
}
+ res = -1;
break;
}
if (res && valid_exit(&qe, res)) {
@@ -3067,12 +3067,10 @@
}
/* exit after 'timeout' cycle if 'n' option enabled */
if (go_on) {
- if (option_verbose > 2) {
+ if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Exiting on time-out cycle\n");
- res = -1;
- }
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
- record_abandoned(&qe);
+ record_abandoned(&qe);
reason = QUEUE_TIMEOUT;
res = 0;
break;
Modified: team/oej/peermatch/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/apps/app_rpt.c?rev=17370&r1=17369&r2=17370&view=diff
==============================================================================
--- team/oej/peermatch/apps/app_rpt.c (original)
+++ team/oej/peermatch/apps/app_rpt.c Tue Apr 4 13:45:33 2006
@@ -608,7 +608,6 @@
/* Debug mode */
static int rpt_do_debug(int fd, int argc, char *argv[]);
static int rpt_do_dump(int fd, int argc, char *argv[]);
-static int rpt_do_frog(int fd, int argc, char *argv[]);
static char debug_usage[] =
"Usage: rpt debug level {0-7}\n"
@@ -618,10 +617,6 @@
"Usage: rpt dump <nodename>\n"
" Dumps struct debug info to log\n";
-static char frog_usage[] =
-"Usage: frog [warp_factor]\n"
-" Performs frog-in-a-blender calculations (Jacobsen Corollary)\n";
-
static struct ast_cli_entry cli_debug =
{ { "rpt", "debug", "level" }, rpt_do_debug,
"Enable app_rpt debugging", debug_usage };
@@ -629,10 +624,6 @@
static struct ast_cli_entry cli_dump =
{ { "rpt", "dump" }, rpt_do_dump,
"Dump app_rpt structs for debugging", dump_usage };
-
-static struct ast_cli_entry cli_frog =
- { { "frog" }, rpt_do_frog,
- "Perform frog-in-a-blender calculations", frog_usage };
/*
* Telemetry defaults
@@ -777,26 +768,6 @@
return RESULT_SUCCESS;
}
}
- return RESULT_FAILURE;
-}
-
-/*
-* Perform frong-in-a-blender calculations (Jacobsen Corollary)
-*/
-
-static int rpt_do_frog(int fd, int argc, char *argv[])
-{
- double warpone = 75139293848.398696166028333356763;
- double warpfactor = 1.0;
-
- if (argc > 2) return RESULT_SHOWUSAGE;
- if ((argc > 1) && (sscanf(argv[1],"%lf",&warpfactor) != 1))
- return RESULT_SHOWUSAGE;
-
- ast_cli(fd, "A frog in a blender with a base diameter of 3 inches going\n");
- ast_cli(fd, "%lf RPM will be travelling at warp factor %lf,\n",
- warpfactor * warpfactor * warpfactor * warpone,warpfactor);
- ast_cli(fd,"based upon the Jacobsen Frog Corollary.\n");
return RESULT_FAILURE;
}
@@ -7066,7 +7037,6 @@
/* Unregister cli extensions */
ast_cli_unregister(&cli_debug);
ast_cli_unregister(&cli_dump);
- ast_cli_unregister(&cli_frog);
return i;
}
@@ -7078,7 +7048,6 @@
/* Register cli extensions */
ast_cli_register(&cli_debug);
ast_cli_register(&cli_dump);
- ast_cli_register(&cli_frog);
return ast_register_application(app, rpt_exec, synopsis, descrip);
}
Modified: team/oej/peermatch/apps/app_senddtmf.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/apps/app_senddtmf.c?rev=17370&r1=17369&r2=17370&view=diff
==============================================================================
--- team/oej/peermatch/apps/app_senddtmf.c (original)
+++ team/oej/peermatch/apps/app_senddtmf.c Tue Apr 4 13:45:33 2006
@@ -52,7 +52,7 @@
static char *descrip =
" SendDTMF(digits[|timeout_ms]): Sends DTMF digits on a channel. \n"
-" Accepted digits: 0-9, *#abcd\n"
+" Accepted digits: 0-9, *#abcd, w (.5s pause)\n"
" The application will either pass the assigned digits or terminate if it\n"
" encounters an error.\n";
Modified: team/oej/peermatch/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/channel.c?rev=17370&r1=17369&r2=17370&view=diff
==============================================================================
--- team/oej/peermatch/channel.c (original)
+++ team/oej/peermatch/channel.c Tue Apr 4 13:45:33 2006
@@ -333,7 +333,7 @@
shutting_down = 1;
if (hangup) {
AST_LIST_LOCK(&channels);
- AST_LIST_TRAVERSE(&channels, c, list)
+ AST_LIST_TRAVERSE(&channels, c, chan_list)
ast_softhangup(c, AST_SOFTHANGUP_SHUTDOWN);
AST_LIST_UNLOCK(&channels);
}
@@ -345,7 +345,7 @@
struct ast_channel *c;
int cnt = 0;
AST_LIST_LOCK(&channels);
- AST_LIST_TRAVERSE(&channels, c, list)
+ AST_LIST_TRAVERSE(&channels, c, chan_list)
cnt++;
AST_LIST_UNLOCK(&channels);
return cnt;
@@ -682,7 +682,7 @@
tmp->tech = &null_tech;
AST_LIST_LOCK(&channels);
- AST_LIST_INSERT_HEAD(&channels, tmp, list);
+ AST_LIST_INSERT_HEAD(&channels, tmp, chan_list);
AST_LIST_UNLOCK(&channels);
return tmp;
}
@@ -816,7 +816,7 @@
for (retries = 0; retries < 10; retries++) {
AST_LIST_LOCK(&channels);
- AST_LIST_TRAVERSE(&channels, c, list) {
+ AST_LIST_TRAVERSE(&channels, c, chan_list) {
if (!prev) {
/* want head of list */
if (!name && !exten)
@@ -845,7 +845,7 @@
break;
}
} else if (c == prev) { /* found, return c->next */
- c = AST_LIST_NEXT(c, list);
+ c = AST_LIST_NEXT(c, chan_list);
break;
}
}
@@ -952,7 +952,7 @@
headp=&chan->varshead;
AST_LIST_LOCK(&channels);
- AST_LIST_REMOVE(&channels, chan, list);
+ AST_LIST_REMOVE(&channels, chan, chan_list);
/* Lock and unlock the channel just to be sure nobody
has it locked still */
ast_mutex_lock(&chan->lock);
Modified: team/oej/peermatch/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/channels/chan_h323.c?rev=17370&r1=17369&r2=17370&view=diff
==============================================================================
--- team/oej/peermatch/channels/chan_h323.c (original)
+++ team/oej/peermatch/channels/chan_h323.c Tue Apr 4 13:45:33 2006
@@ -78,6 +78,7 @@
#include "asterisk/cli.h"
#include "asterisk/dsp.h"
#include "asterisk/causes.h"
+#include "asterisk/stringfields.h"
#ifdef __cplusplus
}
#endif
@@ -101,12 +102,13 @@
int h323debug;
/** Variables required by Asterisk */
-static const char type[] = "H323";
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;
+
+#define GLOBAL_CAPABILITY (AST_FORMAT_G723_1 | AST_FORMAT_GSM | AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_G729A | AST_FORMAT_H261)
/** H.323 configuration values */
static int h323_signalling_port = 1720;
@@ -206,9 +208,9 @@
static int oh323_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
static const struct ast_channel_tech oh323_tech = {
- .type = type,
+ .type = "H323",
.description = tdesc,
- .capabilities = AST_FORMAT_ULAW,
+ .capabilities = ((AST_FORMAT_MAX_AUDIO << 1) - 1),
.properties = AST_CHAN_TP_WANTSJITTER,
.requester = oh323_request,
.send_digit = oh323_digit,
@@ -496,7 +498,7 @@
if (c->hangupcause) {
q931cause = c->hangupcause;
} else {
- char *cause = pbx_builtin_getvar_helper(c, "DIALSTATUS");
+ const char *cause = pbx_builtin_getvar_helper(c, "DIALSTATUS");
if (cause) {
if (!strcmp(cause, "CONGESTION")) {
q931cause = AST_CAUSE_NORMAL_CIRCUIT_CONGESTION;
@@ -735,14 +737,13 @@
ast_mutex_lock(&pvt->lock);
if (ch) {
ch->tech = &oh323_tech;
- snprintf(ch->name, sizeof(ch->name), "H323/%s", host);
+ ast_string_field_build(ch, name, "H323/%s", host);
ch->nativeformats = pvt->options.capability;
if (!ch->nativeformats) {
ch->nativeformats = global_options.capability;
}
pvt->nativeformats = ch->nativeformats;
fmt = ast_best_codec(ch->nativeformats);
- ch->type = type;
ch->fds[0] = ast_rtp_fd(pvt->rtp);
if (state == AST_STATE_RING) {
ch->rings = 1;
@@ -765,7 +766,7 @@
strncpy(ch->exten, pvt->exten, sizeof(ch->exten) - 1);
ch->priority = 1;
if (!ast_strlen_zero(pvt->accountcode)) {
- strncpy(ch->accountcode, pvt->accountcode, sizeof(ch->accountcode) - 1);
+ ast_string_field_set(ch, accountcode, pvt->accountcode);
}
if (pvt->amaflags) {
ch->amaflags = pvt->amaflags;
@@ -1234,7 +1235,6 @@
*/
void connection_made(unsigned call_reference, const char *token)
{
- struct ast_channel *c = NULL;
struct oh323_pvt *pvt;
if (h323debug)
@@ -1436,7 +1436,6 @@
*/
void chan_ringing(unsigned call_reference, const char *token)
{
- struct ast_channel *c = NULL;
struct oh323_pvt *pvt;
if (h323debug)
@@ -1479,7 +1478,7 @@
break;
#if 1
#ifdef DEBUG_THREADS
- ast_log(LOG_NOTICE, "Avoiding H.323 destory deadlock on %s, locked at %ld/%d by %s (%s:%d)\n", call_token, pvt->owner->lock.thread, pvt->owner->lock.reentrancy, pvt->owner->lock.func, pvt->owner->lock.file, pvt->owner->lock.lineno);
+ ast_log(LOG_NOTICE, "Avoiding H.323 destory deadlock on %s, locked at %ld/%d by %s (%s:%d)\n", call_token, pvt->owner->lock.thread[0], pvt->owner->lock.reentrancy, pvt->owner->lock.func[0], pvt->owner->lock.file[0], pvt->owner->lock.lineno[0]);
#else
ast_log(LOG_NOTICE, "Avoiding H.323 destory deadlock on %s\n", call_token);
#endif
@@ -2026,7 +2025,7 @@
memset(&global_options, 0, sizeof(global_options));
global_options.dtmfcodec = 101;
global_options.dtmfmode = H323_DTMF_RFC2833;
- global_options.capability = ~0; /* All capabilities */
+ global_options.capability = GLOBAL_CAPABILITY;
global_options.bridge = 1; /* Do native bridging by default */
v = ast_variable_browse(cfg, "general");
while(v) {
@@ -2282,7 +2281,7 @@
}
}
-static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs)
+static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active)
{
/* XXX Deal with Video */
struct oh323_pvt *pvt;
@@ -2308,7 +2307,7 @@
}
static struct ast_rtp_protocol oh323_rtp = {
- .type = type,
+ .type = "H323",
.get_rtp_info = oh323_get_rtp_peer,
.get_vrtp_info = oh323_get_vrtp_peer,
.set_rtp_peer= oh323_set_rtp_peer,
@@ -2334,7 +2333,7 @@
} else {
/* Make sure we can register our channel type */
if (ast_channel_register(&oh323_tech)) {
- ast_log(LOG_ERROR, "Unable to register channel class %s\n", type);
+ ast_log(LOG_ERROR, "Unable to register channel class 'H323'\n");
h323_end_process();
return -1;
}
Modified: team/oej/peermatch/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/channels/chan_iax2.c?rev=17370&r1=17369&r2=17370&view=diff
==============================================================================
--- team/oej/peermatch/channels/chan_iax2.c (original)
+++ team/oej/peermatch/channels/chan_iax2.c Tue Apr 4 13:45:33 2006
@@ -778,6 +778,7 @@
static int send_command_immediate(struct chan_iax2_pvt *, char, int, unsigned int, const unsigned char *, int, int);
static int send_command_final(struct chan_iax2_pvt *, char, int, unsigned int, const unsigned char *, int, int);
static int send_command_transfer(struct chan_iax2_pvt *, char, int, unsigned int, const unsigned char *, int);
+static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, int temponly);
static struct iax2_user *build_user(const char *name, struct ast_variable *v, int temponly);
static void destroy_user(struct iax2_user *user);
static int expire_registry(void *data);
@@ -1609,19 +1610,14 @@
int res;
char iabuf[INET_ADDRSTRLEN];
int callno = f->callno;
+
+ /* Don't send if there was an error, but return error instead */
+ if (!callno || !iaxs[callno] || iaxs[callno]->error)
+ return -1;
/* Called with iaxsl held */
if (option_debug > 2 && iaxdebug)
ast_log(LOG_DEBUG, "Sending %d on %d/%d to %s:%d\n", f->ts, callno, iaxs[callno]->peercallno, ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[callno]->addr.sin_addr), ntohs(iaxs[callno]->addr.sin_port));
- /* Don't send if there was an error, but return error instead */
- if (!callno) {
- ast_log(LOG_WARNING, "Call number = %d\n", callno);
- return -1;
- }
- if (!iaxs[callno])
- return -1;
- if (iaxs[callno]->error)
- return -1;
if (f->transfer) {
if (iaxdebug)
iax_showframe(f, NULL, 0, &iaxs[callno]->transfer, f->datalen - sizeof(struct ast_iax2_full_hdr));
@@ -1642,6 +1638,30 @@
return res;
}
+static void iax2_destroy_helper(struct chan_iax2_pvt *pvt)
+{
+ /* No more pings or lagrq's */
+ if (pvt->pingid > -1)
+ ast_sched_del(sched, pvt->pingid);
+ pvt->pingid = -1;
+ if (pvt->lagid > -1)
+ ast_sched_del(sched, pvt->lagid);
+ pvt->lagid = -1;
+ if (pvt->autoid > -1)
+ ast_sched_del(sched, pvt->autoid);
+ pvt->autoid = -1;
+ if (pvt->authid > -1)
+ ast_sched_del(sched, pvt->authid);
+ pvt->authid = -1;
+ if (pvt->initid > -1)
+ ast_sched_del(sched, pvt->initid);
+ pvt->initid = -1;
+#ifdef NEWJB
+ if (pvt->jbid > -1)
+ ast_sched_del(sched, pvt->jbid);
+ pvt->jbid = -1;
+#endif
+}
static int iax2_predestroy(int callno)
{
@@ -1654,27 +1674,7 @@
return -1;
}
if (!ast_test_flag(pvt, IAX_ALREADYGONE)) {
- /* No more pings or lagrq's */
- if (pvt->pingid > -1)
- ast_sched_del(sched, pvt->pingid);
- if (pvt->lagid > -1)
- ast_sched_del(sched, pvt->lagid);
- if (pvt->autoid > -1)
- ast_sched_del(sched, pvt->autoid);
- if (pvt->authid > -1)
- ast_sched_del(sched, pvt->authid);
- if (pvt->initid > -1)
- ast_sched_del(sched, pvt->initid);
-#ifdef NEWJB
- if (pvt->jbid > -1)
- ast_sched_del(sched, pvt->jbid);
- pvt->jbid = -1;
-#endif
- pvt->pingid = -1;
- pvt->lagid = -1;
- pvt->autoid = -1;
- pvt->initid = -1;
- pvt->authid = -1;
+ iax2_destroy_helper(pvt);
ast_set_flag(pvt, IAX_ALREADYGONE);
}
c = pvt->owner;
@@ -1713,11 +1713,9 @@
ast_mutex_lock(&iaxsl[callno]);
pvt = iaxs[callno];
gettimeofday(&lastused[callno], NULL);
-
- if (pvt)
- owner = pvt->owner;
- else
- owner = NULL;
+
+ owner = pvt ? pvt->owner : NULL;
+
if (owner) {
if (ast_mutex_trylock(&owner->lock)) {
ast_log(LOG_NOTICE, "Avoiding IAX destroy deadlock\n");
@@ -1731,27 +1729,7 @@
if (pvt) {
if (!owner)
pvt->owner = NULL;
- /* No more pings or lagrq's */
- if (pvt->pingid > -1)
- ast_sched_del(sched, pvt->pingid);
- if (pvt->lagid > -1)
- ast_sched_del(sched, pvt->lagid);
- if (pvt->autoid > -1)
- ast_sched_del(sched, pvt->autoid);
- if (pvt->authid > -1)
- ast_sched_del(sched, pvt->authid);
- if (pvt->initid > -1)
- ast_sched_del(sched, pvt->initid);
-#ifdef NEWJB
- if (pvt->jbid > -1)
- ast_sched_del(sched, pvt->jbid);
- pvt->jbid = -1;
-#endif
- pvt->pingid = -1;
- pvt->lagid = -1;
- pvt->autoid = -1;
- pvt->authid = -1;
- pvt->initid = -1;
+ iax2_destroy_helper(pvt);
if (pvt->bridgetrans)
ast_translator_free_path(pvt->bridgetrans);
pvt->bridgetrans = NULL;
@@ -1770,9 +1748,8 @@
if (cur->callno == pvt->callno)
cur->retries = -1;
}
- if (pvt->reg) {
+ if (pvt->reg)
pvt->reg->callno = 0;
- }
if (!owner) {
if (pvt->vars) {
ast_variables_destroy(pvt->vars);
@@ -1828,37 +1805,37 @@
/* Make sure this call is still active */
if (callno)
ast_mutex_lock(&iaxsl[callno]);
- if ((f->callno) && iaxs[f->callno]) {
+ if (callno && iaxs[callno]) {
if ((f->retries < 0) /* Already ACK'd */ ||
(f->retries >= max_retries) /* Too many attempts */) {
/* Record an error if we've transmitted too many times */
if (f->retries >= max_retries) {
if (f->transfer) {
/* Transfer timeout */
- send_command(iaxs[f->callno], AST_FRAME_IAX, IAX_COMMAND_TXREJ, 0, NULL, 0, -1);
+ send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_TXREJ, 0, NULL, 0, -1);
} else if (f->final) {
if (f->final)
- iax2_destroy_nolock(f->callno);
+ iax2_destroy_nolock(callno);
} else {
- if (iaxs[f->callno]->owner)
+ if (iaxs[callno]->owner)
ast_log(LOG_WARNING, "Max retries exceeded to host %s on %s (type = %d, subclass = %d, ts=%d, seqno=%d)\n", ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[f->callno]->addr.sin_addr),iaxs[f->callno]->owner->name , f->af.frametype, f->af.subclass, f->ts, f->oseqno);
- iaxs[f->callno]->error = ETIMEDOUT;
- if (iaxs[f->callno]->owner) {
+ iaxs[callno]->error = ETIMEDOUT;
+ if (iaxs[callno]->owner) {
struct ast_frame fr = { 0, };
/* Hangup the fd */
fr.frametype = AST_FRAME_CONTROL;
fr.subclass = AST_CONTROL_HANGUP;
- iax2_queue_frame(f->callno, &fr);
+ iax2_queue_frame(callno, &fr);
/* Remember, owner could disappear */
- if (iaxs[f->callno]->owner)
- iaxs[f->callno]->owner->hangupcause = AST_CAUSE_DESTINATION_OUT_OF_ORDER;
+ if (iaxs[callno]->owner)
+ iaxs[callno]->owner->hangupcause = AST_CAUSE_DESTINATION_OUT_OF_ORDER;
} else {
- if (iaxs[f->callno]->reg) {
- memset(&iaxs[f->callno]->reg->us, 0, sizeof(iaxs[f->callno]->reg->us));
- iaxs[f->callno]->reg->regstate = REG_STATE_TIMEOUT;
- iaxs[f->callno]->reg->refresh = IAX_DEFAULT_REG_EXPIRE;
+ if (iaxs[callno]->reg) {
+ memset(&iaxs[callno]->reg->us, 0, sizeof(iaxs[callno]->reg->us));
+ iaxs[callno]->reg->regstate = REG_STATE_TIMEOUT;
+ iaxs[callno]->reg->refresh = IAX_DEFAULT_REG_EXPIRE;
}
- iax2_destroy_nolock(f->callno);
+ iax2_destroy_nolock(callno);
}
}
@@ -1929,15 +1906,16 @@
max_jitter_buffer = 0;
} else {
if (argc == 5) {
- if ((atoi(argv[3]) >= 0) && (atoi(argv[3]) < IAX_MAX_CALLS)) {
- if (iaxs[atoi(argv[3])]) {
- iaxs[atoi(argv[3])]->jitterbuffer = atoi(argv[4]);
- if (iaxs[atoi(argv[3])]->jitterbuffer < 0)
- iaxs[atoi(argv[3])]->jitterbuffer = 0;
+ int callno = atoi(argv[3]);
+ if ((callno >= 0) && (callno < IAX_MAX_CALLS)) {
+ if (iaxs[callno]) {
+ iaxs[callno]->jitterbuffer = atoi(argv[4]);
+ if (iaxs[callno]->jitterbuffer < 0)
+ iaxs[callno]->jitterbuffer = 0;
} else
- ast_cli(fd, "No such call '%d'\n", atoi(argv[3]));
+ ast_cli(fd, "No such call '%d'\n", callno);
} else
- ast_cli(fd, "%d is not a valid call number\n", atoi(argv[3]));
+ ast_cli(fd, "%d is not a valid call number\n", callno);
}
}
return RESULT_SUCCESS;
@@ -2707,12 +2685,6 @@
ast_mutex_unlock(&iaxsl[callno]);
return 0;
}
-
-static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, int temponly);
-static struct iax2_user *build_user(const char *name, struct ast_variable *v, int temponly);
-
-static void destroy_user(struct iax2_user *user);
-static int expire_registry(void *data);
static struct iax2_peer *realtime_peer(const char *peername, struct sockaddr_in *sin)
{
@@ -5722,17 +5694,19 @@
if (reg->expire > -1)
ast_sched_del(sched, reg->expire);
reg->expire = ast_sched_add(sched, (5 * reg->refresh / 6) * 1000, iax2_do_register_s, reg);
- if ((inaddrcmp(&oldus, ®->us) || (reg->messages != oldmsgs)) && (option_verbose > 2)) {
- if (reg->messages > 65534)
- snprintf(msgstatus, sizeof(msgstatus), " with message(s) waiting\n");
- else if (reg->messages > 1)
- snprintf(msgstatus, sizeof(msgstatus), " with %d messages waiting\n", reg->messages);
- else if (reg->messages > 0)
- snprintf(msgstatus, sizeof(msgstatus), " with 1 message waiting\n");
- else
- snprintf(msgstatus, sizeof(msgstatus), " with no messages waiting\n");
- snprintf(ourip, sizeof(ourip), "%s:%d", ast_inet_ntoa(iabuf, sizeof(iabuf), reg->us.sin_addr), ntohs(reg->us.sin_port));
- ast_verbose(VERBOSE_PREFIX_3 "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr), ourip, msgstatus);
+ if (inaddrcmp(&oldus, ®->us) || (reg->messages != oldmsgs)) {
+ if (option_verbose > 2) {
+ if (reg->messages > 65534)
+ snprintf(msgstatus, sizeof(msgstatus), " with message(s) waiting\n");
+ else if (reg->messages > 1)
+ snprintf(msgstatus, sizeof(msgstatus), " with %d messages waiting\n", reg->messages);
+ else if (reg->messages > 0)
+ snprintf(msgstatus, sizeof(msgstatus), " with 1 message waiting\n");
+ else
+ snprintf(msgstatus, sizeof(msgstatus), " with no messages waiting\n");
+ snprintf(ourip, sizeof(ourip), "%s:%d", ast_inet_ntoa(iabuf, sizeof(iabuf), reg->us.sin_addr), ntohs(reg->us.sin_port));
+ ast_verbose(VERBOSE_PREFIX_3 "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr), ourip, msgstatus);
+ }
manager_event(EVENT_FLAG_SYSTEM, "Registry", "Channel: IAX2\r\nDomain: %s\r\nStatus: Registered\r\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr));
}
reg->regstate = REG_STATE_REGISTERED;
@@ -5815,6 +5789,7 @@
struct iax2_peer *p = data;
ast_log(LOG_DEBUG, "Expiring registration for peer '%s'\n", p->name);
+ manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Unregistered\r\nCause: Expired\r\n", p->name);
/* Reset the address */
memset(&p->addr, 0, sizeof(p->addr));
/* Reset expiry value */
@@ -6052,29 +6027,9 @@
return -1;
}
-static int stop_stuff(int callno)
-{
- if (iaxs[callno]->lagid > -1)
- ast_sched_del(sched, iaxs[callno]->lagid);
- iaxs[callno]->lagid = -1;
- if (iaxs[callno]->pingid > -1)
- ast_sched_del(sched, iaxs[callno]->pingid);
- iaxs[callno]->pingid = -1;
- if (iaxs[callno]->autoid > -1)
- ast_sched_del(sched, iaxs[callno]->autoid);
- iaxs[callno]->autoid = -1;
- if (iaxs[callno]->initid > -1)
- ast_sched_del(sched, iaxs[callno]->initid);
- iaxs[callno]->initid = -1;
- if (iaxs[callno]->authid > -1)
- ast_sched_del(sched, iaxs[callno]->authid);
- iaxs[callno]->authid = -1;
-#ifdef NEWJB
- if (iaxs[callno]->jbid > -1)
- ast_sched_del(sched, iaxs[callno]->jbid);
- iaxs[callno]->jbid = -1;
-#endif
- return 0;
+static void stop_stuff(int callno)
+{
+ iax2_destroy_helper(iaxs[callno]);
}
static void __auth_reject(void *nothing)
@@ -6101,9 +6056,8 @@
{
int callno = (int)(long)(data);
ast_mutex_lock(&iaxsl[callno]);
- if (iaxs[callno]) {
+ if (iaxs[callno])
iaxs[callno]->authid = -1;
- }
ast_mutex_unlock(&iaxsl[callno]);
#ifdef SCHED_MULTITHREADED
if (schedule_action(__auth_reject, data))
@@ -9208,6 +9162,18 @@
/* ast_log(LOG_WARNING, "Ignoring %s\n", v->name); */
v = v->next;
}
+
+ if (defaultsockfd < 0) {
+ if (!(ns = ast_netsock_bind(netsock, io, "0.0.0.0", portno, tos, socket_read, NULL))) {
+ ast_log(LOG_ERROR, "Unable to create network socket: %s\n", strerror(errno));
+ } else {
+ if (option_verbose > 1)
+ ast_verbose(VERBOSE_PREFIX_2 "Binding IAX2 to default address 0.0.0.0:%d\n", portno);
+ defaultsockfd = ast_netsock_sockfd(ns);
+ ast_netsock_unref(ns);
+ }
+ }
+
if (min_reg_expire > max_reg_expire) {
ast_log(LOG_WARNING, "Minimum registration interval of %d is more than maximum of %d, resetting minimum to %d\n",
min_reg_expire, max_reg_expire, max_reg_expire);
@@ -9988,9 +9954,6 @@
struct iax2_registry *reg;
struct iax2_peer *peer;
- struct ast_netsock *ns;
- struct sockaddr_in sin;
-
ast_custom_function_register(&iaxpeer_function);
iax_set_output(iax_debug_output);
@@ -9999,10 +9962,6 @@
jb_setoutput(jb_error_output, jb_warning_output, NULL);
#endif
- sin.sin_family = AF_INET;
- sin.sin_port = htons(IAX_DEFAULT_PORTNO);
- sin.sin_addr.s_addr = INADDR_ANY;
-
#ifdef IAX_TRUNKING
#ifdef ZT_TIMERACK
timingfd = open("/dev/zap/timer", O_RDWR);
@@ -10055,19 +10014,7 @@
if (ast_register_switch(&iax2_switch))
ast_log(LOG_ERROR, "Unable to register IAX switch\n");
-
- if (defaultsockfd < 0) {
- if (!(ns = ast_netsock_bindaddr(netsock, io, &sin, tos, socket_read, NULL))) {
- ast_log(LOG_ERROR, "Unable to create network socket: %s\n", strerror(errno));
- return -1;
- } else {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Binding IAX2 to default address 0.0.0.0:%d\n", IAX_DEFAULT_PORTNO);
- defaultsockfd = ast_netsock_sockfd(ns);
- ast_netsock_unref(ns);
- }
- }
-
+
res = start_network_thread();
if (!res) {
if (option_verbose > 1)
Modified: team/oej/peermatch/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/channels/chan_misdn.c?rev=17370&r1=17369&r2=17370&view=diff
==============================================================================
--- team/oej/peermatch/channels/chan_misdn.c (original)
+++ team/oej/peermatch/channels/chan_misdn.c Tue Apr 4 13:45:33 2006
@@ -668,6 +668,7 @@
" --> bc_l3id: %x\n"
" --> display: %s\n"
" --> activated: %d\n"
+ " --> state: %s\n"
" --> capability: %s\n"
" --> echo_cancel: %d\n"
" --> notone : rx %d tx:%d\n"
@@ -680,6 +681,7 @@
bc->display,
bc->active,
+ bc_state2str(bc->bc_state),
bearer2str(bc->capability),
bc->ec_enable,
help->norxtone,help->notxtone,
@@ -2032,6 +2034,14 @@
len = misdn_ibuf_usedcount(tmp->bc->astbuf);
+ if (!len) {
+ chan_misdn_log(4,tmp->bc->port,"misdn_read: ZERO READ\n");
+
+ tmp->frame.frametype = AST_FRAME_NULL;
+ tmp->frame.subclass = 0;
+ return &tmp->frame;
+ }
+
/*shrinken len if necessary, we transmit at maximum 4k*/
len = len<=sizeof(tmp->ast_rd_buf)?len:sizeof(tmp->ast_rd_buf);
@@ -2080,7 +2090,7 @@
if ( !frame->subclass) {
- chan_misdn_log(2, ch->bc->port, "misdn_write: * prods us\n");
+ chan_misdn_log(4, ch->bc->port, "misdn_write: * prods us\n");
return 0;
}
@@ -2090,6 +2100,16 @@
return -1;
}
+
+ if ( !frame->samples ) {
+ chan_misdn_log(4, ch->bc->port, "misdn_write: zero write\n");
+ return 0;
+ }
+
+ if ( ! ch->bc->addr ) {
+ chan_misdn_log(4, ch->bc->port, "misdn_write: no addr for bc dropping:%d\n", frame->samples);
+ return 0;
+ }
#if MISDN_DEBUG
{
@@ -2102,9 +2122,13 @@
}
#endif
-
- if (!ch->bc->active) {
- chan_misdn_log(5, ch->bc->port, "BC not active droping: %d frames\n",frame->samples);
+
+ switch (ch->bc->bc_state) {
+ case BCHAN_ACTIVATED:
+ case BCHAN_BRIDGED:
+ break;
+ default:
+ chan_misdn_log(5, ch->bc->port, "BC not active (nor bridged) droping: %d frames addr:%x\n",frame->samples,ch->bc->addr);
return 0;
}
@@ -2166,13 +2190,13 @@
if ( !ecwb ) {
chan_misdn_log(2, ch1->bc->port, "Disabling Echo Cancellor when Bridged\n");
ch1->bc->ec_enable=0;
- manager_ec_disable(ch1->bc);
+ /* manager_ec_disable(ch1->bc); */
}
misdn_cfg_get( ch2->bc->port, MISDN_CFG_ECHOCANCELWHENBRIDGED, &ecwb, sizeof(int));
if ( !ecwb ) {
chan_misdn_log(2, ch2->bc->port, "Disabling Echo Cancellor when Bridged\n");
ch2->bc->ec_enable=0;
- manager_ec_disable(ch2->bc);
+ /* manager_ec_disable(ch2->bc); */
}
/* trying to make a mISDN_dsp conference */
@@ -2707,7 +2731,7 @@
if (help->l3id == l3id ) return help;
}
- chan_misdn_log(4, list? (list->bc? list->bc->port : 0) : 0, "$$$ find_chan: No channel found with l3id:%x\n",l3id);
+ chan_misdn_log(6, list? (list->bc? list->bc->port : 0) : 0, "$$$ find_chan: No channel found with l3id:%x\n",l3id);
return NULL;
}
@@ -2719,7 +2743,7 @@
if (help->bc == bc) return help;
}
- chan_misdn_log(4, bc->port, "$$$ find_chan: No channel found for oad:%s dad:%s\n",bc->oad,bc->dad);
+ chan_misdn_log(6, bc->port, "$$$ find_chan: No channel found for oad:%s dad:%s\n",bc->oad,bc->dad);
return NULL;
}
@@ -2729,14 +2753,14 @@
{
struct chan_list *help=list;
[... 9473 lines stripped ...]
More information about the asterisk-commits
mailing list