[asterisk-commits] oej: branch oej/cancel_elsewhere_1.4 r168640 - in /team/oej/cancel_elsewhere_...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jan 15 08:01:25 CST 2009
Author: oej
Date: Thu Jan 15 08:01:25 2009
New Revision: 168640
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168640
Log:
Update manually since automerge seems to be on holiday or depressed by the current financial climate has taken a leave to a monestary outside Tibet...
Modified:
team/oej/cancel_elsewhere_1.4/ (props changed)
team/oej/cancel_elsewhere_1.4/apps/app_disa.c
team/oej/cancel_elsewhere_1.4/apps/app_page.c
team/oej/cancel_elsewhere_1.4/apps/app_queue.c
team/oej/cancel_elsewhere_1.4/apps/app_read.c
team/oej/cancel_elsewhere_1.4/channels/chan_agent.c
team/oej/cancel_elsewhere_1.4/channels/chan_misdn.c
team/oej/cancel_elsewhere_1.4/channels/chan_sip.c
team/oej/cancel_elsewhere_1.4/channels/misdn/isdn_lib.c
team/oej/cancel_elsewhere_1.4/configs/indications.conf.sample
team/oej/cancel_elsewhere_1.4/contrib/scripts/autosupport
team/oej/cancel_elsewhere_1.4/funcs/func_channel.c
team/oej/cancel_elsewhere_1.4/funcs/func_logic.c
team/oej/cancel_elsewhere_1.4/include/asterisk/channel.h
team/oej/cancel_elsewhere_1.4/include/asterisk/indications.h
team/oej/cancel_elsewhere_1.4/main/app.c
team/oej/cancel_elsewhere_1.4/main/channel.c
team/oej/cancel_elsewhere_1.4/main/indications.c
team/oej/cancel_elsewhere_1.4/main/udptl.c
team/oej/cancel_elsewhere_1.4/res/res_agi.c
team/oej/cancel_elsewhere_1.4/res/res_indications.c
team/oej/cancel_elsewhere_1.4/res/snmp/agent.c
Propchange: team/oej/cancel_elsewhere_1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.
Propchange: team/oej/cancel_elsewhere_1.4/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 15 08:01:25 2009
@@ -1,1 +1,1 @@
-/branches/1.4:1-168472
+/branches/1.4:1-168637
Modified: team/oej/cancel_elsewhere_1.4/apps/app_disa.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/apps/app_disa.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/apps/app_disa.c (original)
+++ team/oej/cancel_elsewhere_1.4/apps/app_disa.c Thu Jan 15 08:01:25 2009
@@ -98,7 +98,7 @@
static void play_dialtone(struct ast_channel *chan, char *mailbox)
{
- const struct ind_tone_zone_sound *ts = NULL;
+ const struct tone_zone_sound *ts = NULL;
if(ast_app_has_voicemail(mailbox, NULL))
ts = ast_get_indication_tone(chan->zone, "dialrecall");
else
Modified: team/oej/cancel_elsewhere_1.4/apps/app_page.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/apps/app_page.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/apps/app_page.c (original)
+++ team/oej/cancel_elsewhere_1.4/apps/app_page.c Thu Jan 15 08:01:25 2009
@@ -78,18 +78,18 @@
AST_APP_OPTION('r', PAGE_RECORD),
});
-#define MAX_DIALS 128
static int page_exec(struct ast_channel *chan, void *data)
{
struct ast_module_user *u;
- char *options, *tech, *resource, *tmp;
+ char *options, *tech, *resource, *tmp, *tmp2;
char meetmeopts[88], originator[AST_CHANNEL_NAME];
struct ast_flags flags = { 0 };
unsigned int confid = ast_random();
struct ast_app *app;
int res = 0, pos = 0, i = 0;
- struct ast_dial *dials[MAX_DIALS];
+ struct ast_dial **dial_list;
+ unsigned int num_dials;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "This application requires at least one argument (destination(s) to page)\n");
@@ -117,6 +117,19 @@
snprintf(meetmeopts, sizeof(meetmeopts), "MeetMe|%ud|%s%sqxdw(5)", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"),
(ast_test_flag(&flags, PAGE_RECORD) ? "r" : "") );
+ /* Count number of extensions in list by number of ampersands + 1 */
+ num_dials = 1;
+ tmp2 = tmp;
+ while (*tmp2 && *tmp2++ == '&') {
+ num_dials++;
+ }
+
+ if (!(dial_list = ast_calloc(num_dials, sizeof(void *)))) {
+ ast_log(LOG_ERROR, "Can't allocate %ld bytes for dial list\n", (long)(sizeof(void *) * num_dials));
+ ast_module_user_remove(u);
+ return -1;
+ }
+
/* Go through parsing/calling each device */
while ((tech = strsep(&tmp, "&"))) {
struct ast_dial *dial = NULL;
@@ -149,7 +162,7 @@
ast_dial_run(dial, chan, 1);
/* Put in our dialing array */
- dials[pos++] = dial;
+ dial_list[pos++] = dial;
}
if (!ast_test_flag(&flags, PAGE_QUIET)) {
@@ -166,7 +179,7 @@
/* Go through each dial attempt cancelling, joining, and destroying */
for (i = 0; i < pos; i++) {
- struct ast_dial *dial = dials[i];
+ struct ast_dial *dial = dial_list[i];
/* We have to wait for the async thread to exit as it's possible Meetme won't throw them out immediately */
ast_dial_join(dial);
@@ -178,6 +191,7 @@
ast_dial_destroy(dial);
}
+ ast_free(dial_list);
ast_module_user_remove(u);
return -1;
Modified: team/oej/cancel_elsewhere_1.4/apps/app_queue.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/apps/app_queue.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/apps/app_queue.c (original)
+++ team/oej/cancel_elsewhere_1.4/apps/app_queue.c Thu Jan 15 08:01:25 2009
@@ -2624,8 +2624,9 @@
update_queue(qe->parent, member, callcompletedinsl);
- if ((datastore = ast_channel_datastore_find(new_chan, &queue_transfer_info, NULL))) {
- ast_channel_datastore_remove(new_chan, datastore);
+ /* No need to lock the channels because they are already locked in ast_do_masquerade */
+ if ((datastore = ast_channel_datastore_find(old_chan, &queue_transfer_info, NULL))) {
+ ast_channel_datastore_remove(old_chan, datastore);
} else {
ast_log(LOG_WARNING, "Can't find the queue_transfer datastore.\n");
}
@@ -2636,6 +2637,8 @@
* When a caller is atxferred, then the queue_transfer_info datastore
* is removed from the channel. If it's still there after the bridge is
* broken, then the caller was not atxferred.
+ *
+ * \note Only call this with chan locked
*/
static int attended_transfer_occurred(struct ast_channel *chan)
{
@@ -2910,9 +2913,11 @@
* to which the datastore was moved hangs up, it will attempt to free this
* datastore again, causing a crash
*/
+ ast_channel_lock(qe->chan);
if (datastore && !ast_channel_datastore_remove(qe->chan, datastore)) {
ast_channel_datastore_free(datastore);
}
+ ast_channel_unlock(qe->chan);
ast_mutex_lock(&qe->parent->lock);
if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY) {
store_next(qe, outgoing);
@@ -3159,6 +3164,7 @@
transfer_ds = setup_transfer_datastore(qe, member, callstart, callcompletedinsl);
bridge = ast_bridge_call(qe->chan,peer, &bridge_config);
+ ast_channel_lock(qe->chan);
if (!attended_transfer_occurred(qe->chan)) {
struct ast_datastore *tds;
if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {
@@ -3199,17 +3205,16 @@
(long)(time(NULL) - callstart),
qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
}
- ast_channel_lock(qe->chan);
- if ((tds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL))) {
+ if ((tds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL))) {
ast_channel_datastore_remove(qe->chan, tds);
}
- ast_channel_unlock(qe->chan);
update_queue(qe->parent, member, callcompletedinsl);
}
if (transfer_ds) {
ast_channel_datastore_free(transfer_ds);
}
+ ast_channel_unlock(qe->chan);
ast_hangup(peer);
res = bridge ? bridge : 1;
ao2_ref(member, -1);
Modified: team/oej/cancel_elsewhere_1.4/apps/app_read.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/apps/app_read.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/apps/app_read.c (original)
+++ team/oej/cancel_elsewhere_1.4/apps/app_read.c Thu Jan 15 08:01:25 2009
@@ -92,7 +92,7 @@
int maxdigits = 255;
int tries = 1, to = 0, x = 0;
char *argcopy = NULL;
- struct ind_tone_zone_sound *ts;
+ struct tone_zone_sound *ts;
struct ast_flags flags = {0};
AST_DECLARE_APP_ARGS(arglist,
Modified: team/oej/cancel_elsewhere_1.4/channels/chan_agent.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/channels/chan_agent.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/channels/chan_agent.c (original)
+++ team/oej/cancel_elsewhere_1.4/channels/chan_agent.c Thu Jan 15 08:01:25 2009
@@ -195,7 +195,8 @@
char name[AST_MAX_AGENT];
int inherited_devicestate; /*!< Does the underlying channel have a devicestate to pass? */
ast_mutex_t app_lock; /**< Synchronization between owning applications */
- volatile pthread_t owning_app; /**< Owning application thread id */
+ int app_lock_flag;
+ ast_cond_t app_complete_cond;
volatile int app_sleep_cond; /**< Sleep condition for the login app */
struct ast_channel *owner; /**< Agent */
char loginchan[80]; /**< channel they logged in from */
@@ -380,7 +381,8 @@
ast_copy_string(p->agent, agt, sizeof(p->agent));
ast_mutex_init(&p->lock);
ast_mutex_init(&p->app_lock);
- p->owning_app = (pthread_t) -1;
+ ast_cond_init(&p->app_complete_cond, NULL);
+ p->app_lock_flag = 0;
p->app_sleep_cond = 1;
p->group = group;
p->pending = pending;
@@ -428,12 +430,14 @@
chan->tech_pvt = NULL;
p->app_sleep_cond = 1;
/* Release ownership of the agent to other threads (presumably running the login app). */
- ast_mutex_unlock(&p->app_lock);
+ p->app_lock_flag = 0;
+ ast_cond_signal(&p->app_complete_cond);
if (chan)
ast_channel_free(chan);
if (p->dead) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
+ ast_cond_destroy(&p->app_complete_cond);
free(p);
}
return 0;
@@ -930,6 +934,7 @@
} else if (p->dead) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
+ ast_cond_destroy(&p->app_complete_cond);
free(p);
} else {
if (p->chan) {
@@ -940,8 +945,10 @@
ast_mutex_unlock(&p->lock);
}
/* Release ownership of the agent to other threads (presumably running the login app). */
- if (ast_strlen_zero(p->loginchan))
- ast_mutex_unlock(&p->app_lock);
+ if (ast_strlen_zero(p->loginchan)) {
+ p->app_lock_flag = 0;
+ ast_cond_signal(&p->app_complete_cond);
+ }
}
return 0;
}
@@ -1029,6 +1036,7 @@
static struct ast_channel *agent_new(struct agent_pvt *p, int state)
{
struct ast_channel *tmp;
+ int alreadylocked;
#if 0
if (!p->chan) {
ast_log(LOG_WARNING, "No channel? :(\n");
@@ -1079,11 +1087,15 @@
* implemented in the kernel for this.
*/
p->app_sleep_cond = 0;
- if(ast_strlen_zero(p->loginchan) && ast_mutex_trylock(&p->app_lock)) {
+
+ alreadylocked = p->app_lock_flag;
+ p->app_lock_flag = 1;
+
+ if(ast_strlen_zero(p->loginchan) && alreadylocked) {
if (p->chan) {
ast_queue_frame(p->chan, &ast_null_frame);
ast_mutex_unlock(&p->lock); /* For other thread to read the condition. */
- ast_mutex_lock(&p->app_lock);
+ p->app_lock_flag = 1;
ast_mutex_lock(&p->lock);
} else {
ast_log(LOG_WARNING, "Agent disconnected while we were connecting the call\n");
@@ -1092,7 +1104,8 @@
p->app_sleep_cond = 1;
ast_channel_free( tmp );
ast_mutex_unlock(&p->lock); /* For other thread to read the condition. */
- ast_mutex_unlock(&p->app_lock);
+ p->app_lock_flag = 0;
+ ast_cond_signal(&p->app_complete_cond);
return NULL;
}
} else if (!ast_strlen_zero(p->loginchan)) {
@@ -1110,14 +1123,6 @@
}
if (p->chan)
ast_indicate(p->chan, AST_CONTROL_UNHOLD);
- p->owning_app = pthread_self();
- /* After the above step, there should not be any blockers. */
- if (p->chan) {
- if (ast_test_flag(p->chan, AST_FLAG_BLOCKING)) {
- ast_log( LOG_ERROR, "A blocker exists after agent channel ownership acquired\n" );
- ast_assert(ast_test_flag(p->chan, AST_FLAG_BLOCKING) == 0);
- }
- }
return tmp;
}
@@ -1262,6 +1267,7 @@
if (!p->chan) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
+ ast_cond_destroy(&p->app_complete_cond);
free(p);
} else {
/* Cause them to hang up */
@@ -1395,15 +1401,17 @@
struct agent_pvt *p;
char loginchan[80];
- if(multiplelogin)
+ if (multiplelogin) {
return 1;
- if(!chan)
+ }
+ if (!chan) {
return 0;
+ }
snprintf(loginchan, sizeof(loginchan), "%s@%s", chan, S_OR(context, "default"));
AST_LIST_TRAVERSE(&agents, p, list) {
- if(!strcasecmp(chan, p->loginchan))
+ if(!strcasecmp(loginchan, p->loginchan))
return 0;
}
return -1;
@@ -2255,15 +2263,17 @@
ast_mutex_unlock(&p->lock);
AST_LIST_UNLOCK(&agents);
/* Synchronize channel ownership between call to agent and itself. */
- ast_mutex_lock( &p->app_lock );
+ ast_mutex_lock(&p->app_lock);
+ if (p->app_lock_flag == 1) {
+ ast_cond_wait(&p->app_complete_cond, &p->app_lock);
+ }
+ ast_mutex_unlock(&p->app_lock);
ast_mutex_lock(&p->lock);
- p->owning_app = pthread_self();
ast_mutex_unlock(&p->lock);
if (p->ackcall > 1)
res = agent_ack_sleep(p);
else
res = ast_safe_sleep_conditional( chan, 1000, agent_cont_sleep, p );
- ast_mutex_unlock( &p->app_lock );
if ((p->ackcall > 1) && (res == 1)) {
AST_LIST_LOCK(&agents);
ast_mutex_lock(&p->lock);
@@ -2299,6 +2309,7 @@
if (p->dead && !p->owner) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
+ ast_cond_destroy(&p->app_complete_cond);
free(p);
}
}
Modified: team/oej/cancel_elsewhere_1.4/channels/chan_misdn.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/channels/chan_misdn.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/channels/chan_misdn.c (original)
+++ team/oej/cancel_elsewhere_1.4/channels/chan_misdn.c Thu Jan 15 08:01:25 2009
@@ -382,7 +382,7 @@
* \brief Tone zone sound used for dialtone generation.
* \note Used as a boolean. Non-NULL to prod generation if enabled.
*/
- const struct ind_tone_zone_sound *ts;
+ const struct tone_zone_sound *ts;
/*!
* \brief Enables overlap dialing for the set amount of seconds. (0 = Disabled)
@@ -3079,7 +3079,7 @@
static int dialtone_indicate(struct chan_list *cl)
{
- const struct ind_tone_zone_sound *ts = NULL;
+ const struct tone_zone_sound *ts = NULL;
struct ast_channel *ast = cl->ast;
int nd = 0;
Modified: team/oej/cancel_elsewhere_1.4/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/channels/chan_sip.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/channels/chan_sip.c (original)
+++ team/oej/cancel_elsewhere_1.4/channels/chan_sip.c Thu Jan 15 08:01:25 2009
@@ -7759,6 +7759,8 @@
}
if ((fromdomain = strchr(r->username, '@'))) {
+ /* the domain name is just behind '@' */
+ fromdomain++ ;
/* We have a domain in the username for registration */
snprintf(from, sizeof(from), "<sip:%s>;tag=%s", r->username, p->tag);
if (!ast_strlen_zero(p->theirtag))
@@ -7769,7 +7771,7 @@
/* If the registration username contains '@', then the domain should be used as
the equivalent of "fromdomain" for the registration */
if (ast_strlen_zero(p->fromdomain)) {
- ast_string_field_set(p, fromdomain, ++fromdomain);
+ ast_string_field_set(p, fromdomain, fromdomain);
}
} else {
snprintf(from, sizeof(from), "<sip:%s@%s>;tag=%s", r->username, p->tohost, p->tag);
@@ -11341,7 +11343,6 @@
unsigned int event;
const char *c = get_header(req, "Content-Type");
- check_via(p, req);
/* Need to check the media/type */
if (!strcasecmp(c, "application/dtmf-relay") ||
!strcasecmp(c, "application/vnd.nortelnetworks.digits")) {
@@ -13590,7 +13591,6 @@
char *eventid = NULL;
char *sep;
- check_via(p, req);
if( (sep = strchr(event, ';')) ) { /* XXX bug here - overwriting string ? */
*sep++ = '\0';
eventid = sep;
@@ -13718,7 +13718,7 @@
{
int res;
- check_via(p, req);
+
/* XXX Should we authenticate OPTIONS? XXX */
if (p->lastinvite) {
@@ -14914,7 +14914,6 @@
int res = 0;
- check_via(p, req);
if (ast_test_flag(req, SIP_PKT_DEBUG))
ast_verbose("Call %s got a SIP call transfer from %s: (REFER)!\n", p->callid, ast_test_flag(&p->flags[0], SIP_OUTGOING) ? "callee" : "caller");
@@ -15365,7 +15364,6 @@
static int handle_request_message(struct sip_pvt *p, struct sip_request *req)
{
if (!ast_test_flag(req, SIP_PKT_IGNORE)) {
- check_via(p, req);
if (ast_test_flag(req, SIP_PKT_DEBUG))
ast_verbose("Receiving message!\n");
receive_message(p, req);
Modified: team/oej/cancel_elsewhere_1.4/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/channels/misdn/isdn_lib.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/channels/misdn/isdn_lib.c (original)
+++ team/oej/cancel_elsewhere_1.4/channels/misdn/isdn_lib.c Thu Jan 15 08:01:25 2009
@@ -769,7 +769,7 @@
}
}
-static int newteid=0;
+static int new_te_id = 0;
#define MAXPROCS 0x100
@@ -885,68 +885,64 @@
-static int create_process (int midev, struct misdn_bchannel *bc) {
+static int create_process(int midev, struct misdn_bchannel *bc)
+{
iframe_t ncr;
int l3_id;
- int i;
- struct misdn_stack *stack=get_stack_by_bc(bc);
-
+ int proc_id;
+ struct misdn_stack *stack;
+
+ stack = get_stack_by_bc(bc);
if (stack->nt) {
- if (find_free_chan_in_stack(stack, bc, bc->channel_preselected?bc->channel:0, 0)<0) return -1;
- cb_log(4,stack->port, " --> found channel: %d\n",bc->channel);
-
- for (i=0; i <= MAXPROCS; i++)
- if (stack->procids[i]==0) break;
-
- if (i== MAXPROCS) {
+ if (find_free_chan_in_stack(stack, bc, bc->channel_preselected ? bc->channel : 0, 0) < 0) {
+ return -1;
+ }
+ cb_log(4, stack->port, " --> found channel: %d\n", bc->channel);
+
+ for (proc_id = 0; proc_id < MAXPROCS; ++proc_id) {
+ if (stack->procids[proc_id] == 0) {
+ break;
+ }
+ } /* end for */
+ if (proc_id == MAXPROCS) {
cb_log(0, stack->port, "Couldn't Create New ProcId.\n");
return -1;
}
- stack->procids[i]=1;
-
- l3_id = 0xff00 | i;
-
- ncr.prim = CC_NEW_CR | REQUEST;
-
- ncr.addr = (stack->upper_id | FLG_MSG_DOWN) ;
-
+
+ stack->procids[proc_id] = 1;
+
+ l3_id = 0xff00 | proc_id;
+ bc->l3_id = l3_id;
+ cb_log(3, stack->port, " --> new_l3id %x\n", l3_id);
+ } else {
+ if (stack->ptp || bc->te_choose_channel) {
+ /* we know exactly which channels are in use */
+ if (find_free_chan_in_stack(stack, bc, bc->channel_preselected ? bc->channel : 0, bc->dec) < 0) {
+ return -1;
+ }
+ cb_log(2, stack->port, " --> found channel: %d\n", bc->channel);
+ } else {
+ /* other phones could have made a call also on this port (ptmp) */
+ bc->channel = 0xff;
+ }
+
+ /* if we are in te-mode, we need to create a process first */
+ if (++new_te_id > 0xffff) {
+ new_te_id = 0x0001;
+ }
+
+ l3_id = (entity << 16) | new_te_id;
+ bc->l3_id = l3_id;
+ cb_log(3, stack->port, "--> new_l3id %x\n", l3_id);
+
+ /* send message */
+ ncr.prim = CC_NEW_CR | REQUEST;
+ ncr.addr = (stack->upper_id | FLG_MSG_DOWN);
ncr.dinfo = l3_id;
ncr.len = 0;
-
- bc->l3_id = l3_id;
- cb_log(3, stack->port, " --> new_l3id %x\n",l3_id);
-
- } else {
- if (stack->ptp || bc->te_choose_channel) {
- /* we know exactly which channels are in use */
- if (find_free_chan_in_stack(stack, bc, bc->channel_preselected?bc->channel:0, bc->dec)<0) return -1;
- cb_log(2,stack->port, " --> found channel: %d\n",bc->channel);
- } else {
- /* other phones could have made a call also on this port (ptmp) */
- bc->channel=0xff;
- }
-
-
- /* if we are in te-mode, we need to create a process first */
- if (newteid++ > 0xffff)
- newteid = 0x0001;
-
- l3_id = (entity<<16) | newteid;
- /* preparing message */
- ncr.prim = CC_NEW_CR | REQUEST;
-
- ncr.addr = (stack->upper_id | FLG_MSG_DOWN) ;
-
- ncr.dinfo =l3_id;
- ncr.len = 0;
- /* send message */
-
- bc->l3_id = l3_id;
- cb_log(3, stack->port, "--> new_l3id %x\n",l3_id);
-
- mISDN_write(midev, &ncr, mISDN_HEADER_LEN+ncr.len, TIMEOUT_1SEC);
- }
-
+ mISDN_write(midev, &ncr, mISDN_HEADER_LEN + ncr.len, TIMEOUT_1SEC);
+ }
+
return l3_id;
}
Modified: team/oej/cancel_elsewhere_1.4/configs/indications.conf.sample
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/configs/indications.conf.sample?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/configs/indications.conf.sample (original)
+++ team/oej/cancel_elsewhere_1.4/configs/indications.conf.sample Thu Jan 15 08:01:25 2009
@@ -117,7 +117,7 @@
[bg]
; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
description = Bulgaria
-ringdance = 1000,4000
+ringcadence = 1000,4000
;
dial = 425
busy = 425/500,0/500
Modified: team/oej/cancel_elsewhere_1.4/contrib/scripts/autosupport
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/contrib/scripts/autosupport?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/contrib/scripts/autosupport (original)
+++ team/oej/cancel_elsewhere_1.4/contrib/scripts/autosupport Thu Jan 15 08:01:25 2009
@@ -67,7 +67,7 @@
uname -a >> $OUTPUT;
echo >> $OUTPUT;
echo >> $OUTPUT;
-
+
echo "------------------" >> $OUTPUT;
echo "CPU INFO" >> $OUTPUT;
echo "------------------" >> $OUTPUT;
@@ -106,7 +106,14 @@
modinfo /lib/modules/$(uname -r)/misc/*.ko >> $OUTPUT;
echo >> $OUTPUT;
echo >> $OUTPUT;
-
+
+ echo "------------------" >> $OUTPUT;
+ echo "DAHDI MODULE INFO" >> $OUTPUT;
+ echo "------------------" >> $OUTPUT;
+ modinfo /lib/modules/$(uname -r)/dahdi/*.ko >> $OUTPUT;
+ echo >> $OUTPUT;
+ echo >> $OUTPUT;
+
echo "------------------" >> $OUTPUT;
echo "OTHER INFO" >> $OUTPUT;
echo "------------------" >> $OUTPUT;
@@ -136,6 +143,13 @@
echo >> $OUTPUT;
echo "------------------" >> $OUTPUT;
+ echo "DAHDI_TEST" >> $OUTPUT;
+ echo "------------------" >> $OUTPUT;
+ dahdi_test -c 20 >> $OUTPUT;
+ echo >> $OUTPUT;
+ echo >> $OUTPUT;
+
+ echo "------------------" >> $OUTPUT;
echo "DMESG OUTPUT" >> $OUTPUT;
echo "------------------" >> $OUTPUT;
dmesg >> $OUTPUT;
@@ -157,6 +171,13 @@
echo >> $OUTPUT;
echo "------------------" >> $OUTPUT;
+ echo "DAHDI CONFIG" >> $OUTPUT;
+ echo "------------------" >> $OUTPUT;
+ grep -v '^#' /etc/dahdi/system.conf >> $OUTPUT;
+ echo >> $OUTPUT;
+ echo >> $OUTPUT;
+
+ echo "------------------" >> $OUTPUT;
echo "ZAPATA CONFIG" >> $OUTPUT;
echo "------------------" >> $OUTPUT;
grep -v '^;' /etc/asterisk/zapata.conf >> $OUTPUT;
@@ -164,7 +185,7 @@
echo >> $OUTPUT;
echo "------------------" >> $OUTPUT;
- echo "DAHDI CONFIG" >> $OUTPUT;
+ echo "CHAN_DAHDI CONFIG" >> $OUTPUT;
echo "------------------" >> $OUTPUT;
grep -v '^;' /etc/asterisk/chan_dahdi.conf >> $OUTPUT;
echo >> $OUTPUT;
@@ -219,7 +240,7 @@
echo "Additional login info: "$adinfo >> $OUTPUT
clear
- echo
+ echo
echo "All information has been stored in $OUTPUT,"
echo "Please attach this file to an email case you already"
echo "have open with Digium Tech Support."
@@ -232,6 +253,3 @@
echo "have open with Digium Tech Support."
exit
fi
-
-
-
Modified: team/oej/cancel_elsewhere_1.4/funcs/func_channel.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/funcs/func_channel.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/funcs/func_channel.c (original)
+++ team/oej/cancel_elsewhere_1.4/funcs/func_channel.c Thu Jan 15 08:01:25 2009
@@ -107,7 +107,7 @@
else if (!strcasecmp(data, "musicclass"))
locked_string_field_set(chan, musicclass, value);
else if (!strcasecmp(data, "tonezone")) {
- struct ind_tone_zone *new_zone;
+ struct tone_zone *new_zone;
if (!(new_zone = ast_get_indication_zone(value))) {
ast_log(LOG_ERROR, "Unknown country code '%s' for tonezone. Check indications.conf for available country codes.\n", value);
ret = -1;
Modified: team/oej/cancel_elsewhere_1.4/funcs/func_logic.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/funcs/func_logic.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/funcs/func_logic.c (original)
+++ team/oej/cancel_elsewhere_1.4/funcs/func_logic.c Thu Jan 15 08:01:25 2009
@@ -83,7 +83,7 @@
if (iffalse)
iffalse = ast_strip_quoted(iffalse, "\"", "\"");
- ast_copy_string(buf, ast_check_timing(&timing) ? iftrue : iffalse, len);
+ ast_copy_string(buf, ast_check_timing(&timing) ? S_OR(iftrue, "") : S_OR(iffalse, ""), len);
return 0;
}
Modified: team/oej/cancel_elsewhere_1.4/include/asterisk/channel.h
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/include/asterisk/channel.h?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/include/asterisk/channel.h (original)
+++ team/oej/cancel_elsewhere_1.4/include/asterisk/channel.h Thu Jan 15 08:01:25 2009
@@ -414,7 +414,7 @@
struct ast_cdr *cdr; /*!< Call Detail Record */
enum ast_channel_adsicpe adsicpe; /*!< Whether or not ADSI is detected on CPE */
- struct ind_tone_zone *zone; /*!< Tone zone as set in indications.conf or
+ struct tone_zone *zone; /*!< Tone zone as set in indications.conf or
in the CHANNEL dialplan function */
struct ast_channel_monitor *monitor; /*!< Channel monitoring */
Modified: team/oej/cancel_elsewhere_1.4/include/asterisk/indications.h
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/include/asterisk/indications.h?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/include/asterisk/indications.h (original)
+++ team/oej/cancel_elsewhere_1.4/include/asterisk/indications.h Thu Jan 15 08:01:25 2009
@@ -34,8 +34,8 @@
#include "asterisk/lock.h"
-struct ind_tone_zone_sound {
- struct ind_tone_zone_sound *next; /* next element */
+struct tone_zone_sound {
+ struct tone_zone_sound *next; /* next element */
const char *name; /* Identifing name */
const char *data; /* Actual zone description */
/* Description is a series of tones of the format:
@@ -45,33 +45,33 @@
specified in milliseconds */
};
-struct ind_tone_zone {
- struct ind_tone_zone* next; /* next in list */
+struct tone_zone {
+ struct tone_zone* next; /* next in list */
char country[5]; /* Country code */
char alias[5]; /* is this an alias? */
char description[40]; /* Description */
int nrringcadence; /* # registered ringcadence elements */
int *ringcadence; /* Ring cadence */
- struct ind_tone_zone_sound *tones; /* The known tones for this zone */
+ struct tone_zone_sound *tones; /* The known tones for this zone */
};
/* set the default tone country */
int ast_set_indication_country(const char *country);
/* locate ind_tone_zone, given the country. if country == NULL, use the default country */
-struct ind_tone_zone *ast_get_indication_zone(const char *country);
-/* locate a ind_tone_zone_sound, given the ind_tone_zone. if ind_tone_zone == NULL, use the default ind_tone_zone */
-struct ind_tone_zone_sound *ast_get_indication_tone(const struct ind_tone_zone *zone, const char *indication);
+struct tone_zone *ast_get_indication_zone(const char *country);
+/* locate a tone_zone_sound, given the tone_zone. if tone_zone == NULL, use the default tone_zone */
+struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, const char *indication);
/* add a new country, if country exists, it will be replaced. */
-int ast_register_indication_country(struct ind_tone_zone *country);
+int ast_register_indication_country(struct tone_zone *country);
/* remove an existing country and all its indications, country must exist */
int ast_unregister_indication_country(const char *country);
-/* add a new indication to a ind_tone_zone. ind_tone_zone must exist. if the indication already
+/* add a new indication to a tone_zone. tone_zone must exist. if the indication already
* exists, it will be replaced. */
-int ast_register_indication(struct ind_tone_zone *zone, const char *indication, const char *tonelist);
-/* remove an existing ind_tone_zone's indication. ind_tone_zone must exist */
-int ast_unregister_indication(struct ind_tone_zone *zone, const char *indication);
+int ast_register_indication(struct tone_zone *zone, const char *indication, const char *tonelist);
+/* remove an existing tone_zone's indication. tone_zone must exist */
+int ast_unregister_indication(struct tone_zone *zone, const char *indication);
/* Start a tone-list going */
int ast_playtones_start(struct ast_channel *chan, int vol, const char* tonelist, int interruptible);
@@ -79,10 +79,10 @@
void ast_playtones_stop(struct ast_channel *chan);
/* support for walking through a list of indications */
-struct ind_tone_zone *ast_walk_indications(const struct ind_tone_zone *cur);
+struct tone_zone *ast_walk_indications(const struct tone_zone *cur);
#if 0
-extern struct ind_tone_zone *ind_tone_zones;
+extern struct tone_zone *tone_zones;
extern ast_mutex_t tzlock;
#endif
Modified: team/oej/cancel_elsewhere_1.4/main/app.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/main/app.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/main/app.c (original)
+++ team/oej/cancel_elsewhere_1.4/main/app.c Thu Jan 15 08:01:25 2009
@@ -64,7 +64,7 @@
*/
int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect, size_t size, int maxlen, int timeout)
{
- struct ind_tone_zone_sound *ts;
+ struct tone_zone_sound *ts;
int res=0, x=0;
if (maxlen > size)
Modified: team/oej/cancel_elsewhere_1.4/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/main/channel.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/main/channel.c (original)
+++ team/oej/cancel_elsewhere_1.4/main/channel.c Thu Jan 15 08:01:25 2009
@@ -2483,7 +2483,7 @@
/* By using an enum, we'll get compiler warnings for values not handled
* in switch statements. */
enum ast_control_frame_type condition = _condition;
- const struct ind_tone_zone_sound *ts = NULL;
+ const struct tone_zone_sound *ts = NULL;
int res = -1;
ast_channel_lock(chan);
Modified: team/oej/cancel_elsewhere_1.4/main/indications.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/main/indications.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/main/indications.c (original)
+++ team/oej/cancel_elsewhere_1.4/main/indications.c Thu Jan 15 08:01:25 2009
@@ -329,21 +329,21 @@
/*--------------------------------------------*/
-static struct ind_tone_zone *ind_tone_zones;
-static struct ind_tone_zone *current_tonezone;
-
-/* Protect the ind_tone_zones list (highly unlikely that two things would change
+static struct tone_zone *tone_zones;
+static struct tone_zone *current_tonezone;
+
+/* Protect the tone_zones list (highly unlikely that two things would change
* it at the same time, but still! */
AST_MUTEX_DEFINE_STATIC(tzlock);
-struct ind_tone_zone *ast_walk_indications(const struct ind_tone_zone *cur)
-{
- struct ind_tone_zone *tz;
+struct tone_zone *ast_walk_indications(const struct tone_zone *cur)
+{
+ struct tone_zone *tz;
if (cur == NULL)
- return ind_tone_zones;
- ast_mutex_lock(&tzlock);
- for (tz = ind_tone_zones; tz; tz = tz->next)
+ return tone_zones;
+ ast_mutex_lock(&tzlock);
+ for (tz = tone_zones; tz; tz = tz->next)
if (tz == cur)
break;
if (tz)
@@ -356,7 +356,7 @@
int ast_set_indication_country(const char *country)
{
if (country) {
- struct ind_tone_zone *z = ast_get_indication_zone(country);
+ struct tone_zone *z = ast_get_indication_zone(country);
if (z) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Setting default indication country to '%s'\n",country);
@@ -367,22 +367,22 @@
return 1; /* not found */
}
-/* locate ind_tone_zone, given the country. if country == NULL, use the default country */
-struct ind_tone_zone *ast_get_indication_zone(const char *country)
-{
- struct ind_tone_zone *tz;
+/* locate tone_zone, given the country. if country == NULL, use the default country */
+struct tone_zone *ast_get_indication_zone(const char *country)
+{
+ struct tone_zone *tz;
int alias_loop = 0;
if (ast_strlen_zero(country)) {
/* No country specified? Return the default or the first in the list */
- return current_tonezone ? current_tonezone : ind_tone_zones;
+ return current_tonezone ? current_tonezone : tone_zones;
}
ast_mutex_lock(&tzlock);
do {
- for (tz=ind_tone_zones; tz; tz=tz->next) {
+ for (tz=tone_zones; tz; tz=tz->next) {
if (strcasecmp(country,tz->country)==0) {
- /* ind_tone_zone found */
+ /* tone_zone found */
if (tz->alias && tz->alias[0]) {
country = tz->alias;
break;
@@ -399,16 +399,16 @@
return 0;
}
-/* locate a ind_tone_zone_sound, given the ind_tone_zone. if ind_tone_zone == NULL, use the default ind_tone_zone */
-struct ind_tone_zone_sound *ast_get_indication_tone(const struct ind_tone_zone *zone, const char *indication)
-{
- struct ind_tone_zone_sound *ts;
+/* locate a tone_zone_sound, given the tone_zone. if tone_zone == NULL, use the default tone_zone */
+struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, const char *indication)
+{
+ struct tone_zone_sound *ts;
/* we need some tonezone, pick the first */
if (zone == NULL && current_tonezone)
zone = current_tonezone; /* default country? */
- if (zone == NULL && ind_tone_zones)
- zone = ind_tone_zones; /* any country? */
+ if (zone == NULL && tone_zones)
+ zone = tone_zones; /* any country? */
if (zone == NULL)
return 0; /* not a single country insight */
@@ -425,11 +425,11 @@
return 0;
}
-/* helper function to delete a ind_tone_zone in its entirety */
-static inline void free_zone(struct ind_tone_zone* zone)
+/* helper function to delete a tone_zone in its entirety */
+static inline void free_zone(struct tone_zone* zone)
{
while (zone->tones) {
- struct ind_tone_zone_sound *tmp = zone->tones->next;
+ struct tone_zone_sound *tmp = zone->tones->next;
free((void*)zone->tones->name);
free((void*)zone->tones->data);
free(zone->tones);
@@ -443,19 +443,19 @@
/*--------------------------------------------*/
/* add a new country, if country exists, it will be replaced. */
-int ast_register_indication_country(struct ind_tone_zone *zone)
-{
- struct ind_tone_zone *tz,*pz;
-
- ast_mutex_lock(&tzlock);
- for (pz=NULL,tz=ind_tone_zones; tz; pz=tz,tz=tz->next) {
+int ast_register_indication_country(struct tone_zone *zone)
+{
+ struct tone_zone *tz,*pz;
+
+ ast_mutex_lock(&tzlock);
+ for (pz=NULL,tz=tone_zones; tz; pz=tz,tz=tz->next) {
if (strcasecmp(zone->country,tz->country)==0) {
- /* ind_tone_zone already there, replace */
+ /* tone_zone already there, replace */
zone->next = tz->next;
if (pz)
pz->next = zone;
else
- ind_tone_zones = zone;
+ tone_zones = zone;
/* if we are replacing the default zone, re-point it */
if (tz == current_tonezone)
current_tonezone = zone;
@@ -470,7 +470,7 @@
if (pz)
pz->next = zone;
else
- ind_tone_zones = zone;
+ tone_zones = zone;
ast_mutex_unlock(&tzlock);
if (option_verbose > 2)
@@ -482,21 +482,21 @@
* Also, all countries which are an alias for the specified country are removed. */
int ast_unregister_indication_country(const char *country)
{
- struct ind_tone_zone *tz, *pz = NULL, *tmp;
+ struct tone_zone *tz, *pz = NULL, *tmp;
int res = -1;
ast_mutex_lock(&tzlock);
- tz = ind_tone_zones;
+ tz = tone_zones;
while (tz) {
if (country==NULL ||
(strcasecmp(country, tz->country)==0 ||
strcasecmp(country, tz->alias)==0)) {
- /* ind_tone_zone found, remove */
+ /* tone_zone found, remove */
tmp = tz->next;
if (pz)
pz->next = tmp;
else
- ind_tone_zones = tmp;
+ tone_zones = tmp;
/* if we are unregistering the default country, w'll notice */
if (tz == current_tonezone) {
ast_log(LOG_NOTICE,"Removed default indication country '%s'\n",tz->country);
@@ -505,8 +505,8 @@
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Unregistered indication country '%s'\n",tz->country);
free_zone(tz);
- if (ind_tone_zones == tz)
- ind_tone_zones = tmp;
+ if (tone_zones == tz)
+ tone_zones = tmp;
tz = tmp;
res = 0;
}
@@ -520,11 +520,11 @@
return res;
}
-/* add a new indication to a ind_tone_zone. ind_tone_zone must exist. if the indication already
+/* add a new indication to a tone_zone. tone_zone must exist. if the indication already
* exists, it will be replaced. */
-int ast_register_indication(struct ind_tone_zone *zone, const char *indication, const char *tonelist)
-{
- struct ind_tone_zone_sound *ts,*ps;
+int ast_register_indication(struct tone_zone *zone, const char *indication, const char *tonelist)
+{
+ struct tone_zone_sound *ts,*ps;
/* is it an alias? stop */
if (zone->alias[0])
@@ -560,9 +560,9 @@
}
/* remove an existing country's indication. Both country and indication must exist */
-int ast_unregister_indication(struct ind_tone_zone *zone, const char *indication)
-{
- struct ind_tone_zone_sound *ts,*ps = NULL, *tmp;
+int ast_unregister_indication(struct tone_zone *zone, const char *indication)
+{
+ struct tone_zone_sound *ts,*ps = NULL, *tmp;
int res = -1;
/* is it an alias? stop */
Modified: team/oej/cancel_elsewhere_1.4/main/udptl.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/cancel_elsewhere_1.4/main/udptl.c?view=diff&rev=168640&r1=168639&r2=168640
==============================================================================
--- team/oej/cancel_elsewhere_1.4/main/udptl.c (original)
+++ team/oej/cancel_elsewhere_1.4/main/udptl.c Thu Jan 15 08:01:25 2009
@@ -156,15 +156,15 @@
static int decode_length(uint8_t *buf, int limit, int *len, int *pvalue)
{
+ if (*len >= limit)
+ return -1;
if ((buf[*len] & 0x80) == 0) {
- if (*len >= limit)
- return -1;
*pvalue = buf[*len];
(*len)++;
return 0;
}
if ((buf[*len] & 0x40) == 0) {
- if (*len >= limit - 1)
+ if (*len == limit - 1)
return -1;
[... 132 lines stripped ...]
More information about the asterisk-commits
mailing list