diff -ru asterisk/acl.c /usr/src/asterisk/acl.c --- asterisk/acl.c 2004-03-20 14:08:45.000000000 -0500 +++ /usr/src/asterisk/acl.c 2004-02-02 01:39:23.000000000 -0500 @@ -279,7 +279,7 @@ fgets(line,sizeof(line),PROC); while (!feof(PROC)) { - char iface[256]; + char iface[8]; unsigned int dest, gateway, mask; int i,fieldnum; char *fields[40]; @@ -303,20 +303,18 @@ i = offset - line; } } - if (fieldnum >= 8) { - sscanf(fields[0],"%s",iface); - sscanf(fields[1],"%x",&dest); - sscanf(fields[2],"%x",&gateway); - sscanf(fields[7],"%x",&mask); + sscanf(fields[0],"%s",iface); + sscanf(fields[1],"%x",&dest); + sscanf(fields[2],"%x",&gateway); + sscanf(fields[7],"%x",&mask); #if 0 - printf("Addr: %s %08x Dest: %08x Mask: %08x\n", inet_ntoa(*them), remote_ip, dest, mask); + printf("Addr: %s %08x Dest: %08x Mask: %08x\n", inet_ntoa(*them), remote_ip, dest, mask); #endif - /* Looks simple, but here is the magic */ - if (((remote_ip & mask) ^ dest) == 0) { - res = ast_lookup_iface(iface,us); - break; - } + /* Looks simple, but here is the magic */ + if (((remote_ip & mask) ^ dest) == 0) { + res = ast_lookup_iface(iface,us); + break; } } fclose(PROC); Binary files asterisk/acl.o and /usr/src/asterisk/acl.o differ Binary files asterisk/aescrypt.o and /usr/src/asterisk/aescrypt.o differ Binary files asterisk/aeskey.o and /usr/src/asterisk/aeskey.o differ diff -ru asterisk/aesopt.h /usr/src/asterisk/aesopt.h --- asterisk/aesopt.h 2004-03-02 17:53:20.000000000 -0500 +++ /usr/src/asterisk/aesopt.h 2004-01-07 15:45:50.000000000 -0500 @@ -149,7 +149,6 @@ /* PLATFORM SPECIFIC INCLUDES */ #if defined( __FreeBSD__ ) || defined( __OpenBSD__ ) -# include # include #elif defined( BSD ) && ( BSD >= 199103 ) # include Binary files asterisk/aestab.o and /usr/src/asterisk/aestab.o differ Binary files asterisk/agi/eagi-sphinx-test and /usr/src/asterisk/agi/eagi-sphinx-test differ Binary files asterisk/agi/eagi-sphinx-test.o and /usr/src/asterisk/agi/eagi-sphinx-test.o differ Binary files asterisk/agi/eagi-test and /usr/src/asterisk/agi/eagi-test differ Binary files asterisk/agi/eagi-test.o and /usr/src/asterisk/agi/eagi-test.o differ Binary files asterisk/alaw.o and /usr/src/asterisk/alaw.o differ Binary files asterisk/app.o and /usr/src/asterisk/app.o differ diff -ru asterisk/apps/app_adsiprog.c /usr/src/asterisk/apps/app_adsiprog.c --- asterisk/apps/app_adsiprog.c 2004-03-20 12:27:27.000000000 -0500 +++ /usr/src/asterisk/apps/app_adsiprog.c 2003-05-07 23:43:14.000000000 -0400 @@ -666,7 +666,7 @@ } buf[0] = id; - buf[1] = (cmd << 6) | (disp->id & 0x3f); + buf[1] = (cmd << 6) | (disp->id & 0x2f); buf[2] = ((line & 0x1f) << 3) | (flag & 0x7); return 3; } @@ -695,18 +695,6 @@ return 2; } -static int clearcbone(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno) -{ - char *tok; - tok = get_token(&args, script, lineno); - if (tok) - ast_log(LOG_WARNING, "CLEARCB1 requires no arguments ('%s') at line %d of %s\n", tok, lineno, script); - - buf[0] = id; - buf[1] = 0; - return 2; -} - static int digitcollect(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno) { char *tok; @@ -843,7 +831,6 @@ { "VOICEMODE", 0x93 }, /* Display call buffer 'n' */ /* Clear call buffer 'n' */ - { "CLEARCB1", 0x95, clearcbone }, { "DIGITCOLLECT", 0x96, digitcollect }, { "DIGITDIRECT", 0x96, digitdirect }, { "CLEAR", 0x97 }, Binary files asterisk/apps/app_adsiprog.o and /usr/src/asterisk/apps/app_adsiprog.o differ Binary files asterisk/apps/app_adsiprog.so and /usr/src/asterisk/apps/app_adsiprog.so differ diff -ru asterisk/apps/app_agi.c /usr/src/asterisk/apps/app_agi.c --- asterisk/apps/app_agi.c 2004-03-12 13:50:05.000000000 -0500 +++ /usr/src/asterisk/apps/app_agi.c 2004-01-30 00:37:39.000000000 -0500 @@ -529,8 +529,6 @@ if (!fs) { res = -1; fdprintf(agi->fd, "200 result=%d (writefile)\n", res); - if (sildet) - ast_dsp_free(sildet); return RESULT_FAILURE; } @@ -547,16 +545,12 @@ if (res < 0) { ast_closestream(fs); fdprintf(agi->fd, "200 result=%d (waitfor) endpos=%ld\n", res,sample_offset); - if (sildet) - ast_dsp_free(sildet); return RESULT_FAILURE; } f = ast_read(chan); if (!f) { fdprintf(agi->fd, "200 result=%d (hangup) endpos=%ld\n", 0, sample_offset); ast_closestream(fs); - if (sildet) - ast_dsp_free(sildet); return RESULT_FAILURE; } switch(f->frametype) { @@ -567,8 +561,6 @@ fdprintf(agi->fd, "200 result=%d (dtmf) endpos=%ld\n", f->subclass, sample_offset); ast_closestream(fs); ast_frfree(f); - if (sildet) - ast_dsp_free(sildet); return RESULT_SUCCESS; } break; @@ -604,7 +596,6 @@ if (gotsilence) { ast_stream_rewind(fs, silence-1000); ast_truncstream(fs); - sample_offset = ast_tellstream(fs); } fdprintf(agi->fd, "200 result=%d (timeout) endpos=%ld\n", res, sample_offset); ast_closestream(fs); @@ -1227,10 +1218,6 @@ fdprintf(agi->fd, c->usage); fdprintf(agi->fd, "520 End of proper usage.\n"); break; - case AST_PBX_KEEPALIVE: - /* We've been asked to keep alive, so do so */ - return AST_PBX_KEEPALIVE; - break; case RESULT_FAILURE: /* They've already given the failure. We've been hung up on so handle this appropriately */ @@ -1298,7 +1285,7 @@ returnstatus |= agi_handle_command(chan, agi, buf); /* If the handle_command returns -1, we need to stop */ - if ((returnstatus < 0) || (returnstatus == AST_PBX_KEEPALIVE)) { + if (returnstatus < 0) { break; } } else { Binary files asterisk/apps/app_agi.o and /usr/src/asterisk/apps/app_agi.o differ Binary files asterisk/apps/app_agi.so and /usr/src/asterisk/apps/app_agi.so differ Binary files asterisk/apps/app_authenticate.o and /usr/src/asterisk/apps/app_authenticate.o differ Binary files asterisk/apps/app_authenticate.so and /usr/src/asterisk/apps/app_authenticate.so differ Binary files asterisk/apps/app_campon.o and /usr/src/asterisk/apps/app_campon.o differ Binary files asterisk/apps/app_campon.so and /usr/src/asterisk/apps/app_campon.so differ Binary files asterisk/apps/app_cdr.o and /usr/src/asterisk/apps/app_cdr.o differ Binary files asterisk/apps/app_cdr.so and /usr/src/asterisk/apps/app_cdr.so differ diff -ru asterisk/apps/app_chanisavail.c /usr/src/asterisk/apps/app_chanisavail.c --- asterisk/apps/app_chanisavail.c 2004-03-02 12:49:52.000000000 -0500 +++ /usr/src/asterisk/apps/app_chanisavail.c 2003-04-08 15:14:03.000000000 -0400 @@ -38,9 +38,9 @@ static char *descrip = " ChanIsAvail(Technology/resource[&Technology2/resource2...]): \n" "Checks is any of the requested channels are available. If none\n" -"of the requested channels are available the new priority will be\n" -"n+101 (unless such a priority does not exist or on error, in which\n" -"case ChanIsAvail will return -1). If any of the requested channels\n" +"of the requested channels are available the new priority will\n" +"be n+101 (unless such a priority does not exist, in which case\n" +"ChanIsAvail will return -1. If any of the requested channels\n" "are available, the next priority will be n+1, the channel variable\n" "${AVAILCHAN} will be set to the name of the available channel and\n" "the ChanIsAvail app will return 0.\n"; @@ -53,7 +53,7 @@ { int res=-1; struct localuser *u; - char info[512], *peers, *tech, *number, *rest, *cur; + char info[256], *peers, *tech, *number, *rest, *cur; struct ast_channel *tempchan; if (!data) { @@ -62,7 +62,7 @@ } LOCAL_USER_ADD(u); - strncpy(info, (char *)data, sizeof(info)-1); + strncpy(info, (char *)data, strlen((char *)data) + AST_MAX_EXTENSION-1); peers = info; if (peers) { cur = peers; @@ -76,8 +76,8 @@ tech = cur; number = strchr(tech, '/'); if (!number) { - ast_log(LOG_WARNING, "ChanIsAvail argument takes format ([technology]/[device])\n"); - return -1; + ast_log(LOG_WARNING, "ChanIsAvail argument takes format (Zap/[device])\n"); + continue; } *number = '\0'; number++; Binary files asterisk/apps/app_chanisavail.o and /usr/src/asterisk/apps/app_chanisavail.o differ Binary files asterisk/apps/app_chanisavail.so and /usr/src/asterisk/apps/app_chanisavail.so differ Binary files asterisk/apps/app_cut.o and /usr/src/asterisk/apps/app_cut.o differ Binary files asterisk/apps/app_cut.so and /usr/src/asterisk/apps/app_cut.so differ Binary files asterisk/apps/app_datetime.o and /usr/src/asterisk/apps/app_datetime.o differ Binary files asterisk/apps/app_datetime.so and /usr/src/asterisk/apps/app_datetime.so differ Binary files asterisk/apps/app_db.o and /usr/src/asterisk/apps/app_db.o differ Binary files asterisk/apps/app_db.so and /usr/src/asterisk/apps/app_db.so differ diff -ru asterisk/apps/app_dial.c /usr/src/asterisk/apps/app_dial.c --- asterisk/apps/app_dial.c 2004-03-18 19:09:14.000000000 -0500 +++ /usr/src/asterisk/apps/app_dial.c 2004-03-18 15:17:52.000000000 -0500 @@ -139,7 +139,6 @@ } else if (outgoing->ringbackonly) { ast_indicate(in, AST_CONTROL_RINGING); } - sentringing++; } while(*to && !peer) { @@ -172,7 +171,7 @@ /* if no one available we'd better stop MOH/ringing to */ if (moh) { ast_moh_stop(in); - } else if (sentringing) { + } else if (ringind) { ast_indicate(in, -1); } return NULL; @@ -208,20 +207,20 @@ if (o->chan->callerid) free(o->chan->callerid); o->chan->callerid = malloc(strlen(in->callerid) + 1); - if (o->chan->callerid) - strncpy(o->chan->callerid, in->callerid, strlen(in->callerid) + 1); - else - ast_log(LOG_WARNING, "Out of memory\n"); + strncpy(o->chan->callerid, in->callerid, strlen(in->callerid) + 1); } if (in->ani) { if (o->chan->ani) free(o->chan->ani); o->chan->ani = malloc(strlen(in->ani) + 1); - if (o->chan->ani) - strncpy(o->chan->ani, in->ani, strlen(in->ani) + 1); - else - ast_log(LOG_WARNING, "Out of memory\n"); + strncpy(o->chan->ani, in->ani, strlen(in->ani) + 1); } + if (o->chan->rdnis) + free(o->chan->rdnis); + if (strlen(in->macroexten)) + o->chan->rdnis = strdup(in->macroexten); + else + o->chan->rdnis = strdup(in->exten); if (ast_call(o->chan, tmpchan, 0)) { ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan); o->stillgoing = 0; @@ -275,6 +274,7 @@ if (!sentringing && !moh) { ast_indicate(in, AST_CONTROL_RINGING); sentringing++; + ringind++; } break; case AST_CONTROL_PROGRESS: @@ -286,12 +286,9 @@ /* Ignore going off hook */ break; case -1: - if (!ringind && !moh) { - if (option_verbose > 2) - ast_verbose( VERBOSE_PREFIX_3 "%s stopped sounds\n", o->chan->name); - ast_indicate(in, -1); - sentringing = 0; - } + if (option_verbose > 2) + ast_verbose( VERBOSE_PREFIX_3 "%s stopped sounds\n", o->chan->name); + ast_indicate(in, -1); break; default: ast_log(LOG_DEBUG, "Dunno what to do with control type %d\n", f->subclass); @@ -346,7 +343,7 @@ } if (moh) { ast_moh_stop(in); - } else if (sentringing) { + } else if (ringind) { ast_indicate(in, -1); } Binary files asterisk/apps/app_dial.o and /usr/src/asterisk/apps/app_dial.o differ Binary files asterisk/apps/app_dial.so and /usr/src/asterisk/apps/app_dial.so differ diff -ru asterisk/apps/app_directory.c /usr/src/asterisk/apps/app_directory.c --- asterisk/apps/app_directory.c 2004-03-23 00:32:54.000000000 -0500 +++ /usr/src/asterisk/apps/app_directory.c 2003-11-09 01:16:07.000000000 -0500 @@ -37,8 +37,7 @@ "discovered from voicemail.conf. The context argument is required, and\n" "specifies the context in which to interpret the extensions. Returns 0\n" "unless the user hangs up. It also sets up the channel on exit to enter the\n" -"extension the user selected. Please note that the context must be the same\n" -"as the section in voicemail.conf that the mailbox is processed from as well.\n"; +"extension the user selected.\n"; /* For simplicity, I'm keeping the format compatible with the voicemail config, but i'm open to suggestions for isolating it */ @@ -200,15 +199,10 @@ ast_stopstream(chan); if (res > -1) { if (res == '1') { - if (ast_exists_extension(chan, context, v->name, 1, chan->callerid)) { - strncpy(chan->exten, v->name, sizeof(chan->exten)-1); - chan->priority = 0; - strncpy(chan->context, context, sizeof(chan->context)-1); - res = 0; - } else { - ast_log(LOG_WARNING, "Can't find extension '%s' in context '%s'. Did you pass the wrong context to Directory?\n", v->name, context); - res = -1; - } + strncpy(chan->exten, v->name, sizeof(chan->exten)-1); + chan->priority = 0; + strncpy(chan->context, context, sizeof(chan->context)-1); + res = 0; break; } else if (res == '*') { res = 0; Binary files asterisk/apps/app_directory.o and /usr/src/asterisk/apps/app_directory.o differ Binary files asterisk/apps/app_directory.so and /usr/src/asterisk/apps/app_directory.so differ Binary files asterisk/apps/app_disa.o and /usr/src/asterisk/apps/app_disa.o differ Binary files asterisk/apps/app_disa.so and /usr/src/asterisk/apps/app_disa.so differ Binary files asterisk/apps/app_echo.o and /usr/src/asterisk/apps/app_echo.o differ Binary files asterisk/apps/app_echo.so and /usr/src/asterisk/apps/app_echo.so differ Binary files asterisk/apps/app_enumlookup.o and /usr/src/asterisk/apps/app_enumlookup.o differ Binary files asterisk/apps/app_enumlookup.so and /usr/src/asterisk/apps/app_enumlookup.so differ diff -ru asterisk/apps/app_festival.c /usr/src/asterisk/apps/app_festival.c --- asterisk/apps/app_festival.c 2004-03-24 17:52:10.000000000 -0500 +++ /usr/src/asterisk/apps/app_festival.c 2004-01-22 16:47:58.000000000 -0500 @@ -5,7 +5,7 @@ * * Copyright (C) 2002, Christos Ricudis * - * Christos Ricudis + * Christos Ricudis * * This program is free software, distributed under the terms of * the GNU General Public License @@ -376,7 +376,6 @@ if (strlen((char *)data)==strln) { ast_log(LOG_DEBUG,"Size OK\n"); read(fdesc,&bigstring,strln); - bigstring[strln] = 0; if (strcmp(bigstring,data)==0) { readcache=1; } else { Binary files asterisk/apps/app_festival.o and /usr/src/asterisk/apps/app_festival.o differ Binary files asterisk/apps/app_festival.so and /usr/src/asterisk/apps/app_festival.so differ Binary files asterisk/apps/app_flash.o and /usr/src/asterisk/apps/app_flash.o differ Binary files asterisk/apps/app_flash.so and /usr/src/asterisk/apps/app_flash.so differ Binary files asterisk/apps/app_getcpeid.o and /usr/src/asterisk/apps/app_getcpeid.o differ Binary files asterisk/apps/app_getcpeid.so and /usr/src/asterisk/apps/app_getcpeid.so differ Binary files asterisk/apps/app_hasnewvoicemail.o and /usr/src/asterisk/apps/app_hasnewvoicemail.o differ Binary files asterisk/apps/app_hasnewvoicemail.so and /usr/src/asterisk/apps/app_hasnewvoicemail.so differ Binary files asterisk/apps/app_image.o and /usr/src/asterisk/apps/app_image.o differ Binary files asterisk/apps/app_image.so and /usr/src/asterisk/apps/app_image.so differ Binary files asterisk/apps/app_intercom.o and /usr/src/asterisk/apps/app_intercom.o differ Binary files asterisk/apps/app_intercom.so and /usr/src/asterisk/apps/app_intercom.so differ Binary files asterisk/apps/app_lookupblacklist.o and /usr/src/asterisk/apps/app_lookupblacklist.o differ Binary files asterisk/apps/app_lookupblacklist.so and /usr/src/asterisk/apps/app_lookupblacklist.so differ Binary files asterisk/apps/app_lookupcidname.o and /usr/src/asterisk/apps/app_lookupcidname.o differ Binary files asterisk/apps/app_lookupcidname.so and /usr/src/asterisk/apps/app_lookupcidname.so differ diff -ru asterisk/apps/app_macro.c /usr/src/asterisk/apps/app_macro.c --- asterisk/apps/app_macro.c 2004-03-04 00:58:13.000000000 -0500 +++ /usr/src/asterisk/apps/app_macro.c 2003-08-21 19:26:13.000000000 -0400 @@ -202,7 +202,7 @@ /* If we're leaving the macro normally, restore original information */ chan->priority = oldpriority; strncpy(chan->context, oldcontext, sizeof(chan->context) - 1); - if (!(chan->_softhangup & AST_SOFTHANGUP_ASYNCGOTO)) { + if (!chan->_softhangup) { /* Copy the extension, so long as we're not in softhangup, where we could be given an asyncgoto */ strncpy(chan->exten, oldexten, sizeof(chan->exten) - 1); if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) { Binary files asterisk/apps/app_macro.o and /usr/src/asterisk/apps/app_macro.o differ Binary files asterisk/apps/app_macro.so and /usr/src/asterisk/apps/app_macro.so differ Binary files asterisk/apps/app_meetme.o and /usr/src/asterisk/apps/app_meetme.o differ Binary files asterisk/apps/app_meetme.so and /usr/src/asterisk/apps/app_meetme.so differ Binary files asterisk/apps/app_milliwatt.o and /usr/src/asterisk/apps/app_milliwatt.o differ Binary files asterisk/apps/app_milliwatt.so and /usr/src/asterisk/apps/app_milliwatt.so differ Binary files asterisk/apps/app_mp3.o and /usr/src/asterisk/apps/app_mp3.o differ Binary files asterisk/apps/app_mp3.so and /usr/src/asterisk/apps/app_mp3.so differ diff -ru asterisk/apps/app_parkandannounce.c /usr/src/asterisk/apps/app_parkandannounce.c --- asterisk/apps/app_parkandannounce.c 2004-03-11 01:16:27.000000000 -0500 +++ /usr/src/asterisk/apps/app_parkandannounce.c 2003-04-23 15:09:13.000000000 -0400 @@ -68,17 +68,13 @@ int outstate; struct localuser *u; - if (!data || (data && !strlen(data))) { - ast_log(LOG_WARNING, "ParkAndAnnounce requires arguments: (announce:template|timeout|dial|[return_context])\n"); + if (!data) { + ast_log(LOG_WARNING, "Park requires an argument (parkinglot)\n"); return -1; } l=strlen(data)+2; orig_s=malloc(l); - if (!orig_s) { - ast_log(LOG_WARNING, "Out of memory\n"); - return -1; - } s=orig_s; strncpy(s,data,l); @@ -89,10 +85,9 @@ return -1; } - if (s) { - timeout = atoi(strsep(&s, "|")); - timeout *= 1000; - } + timeout = atoi(strsep(&s, "|")); + timeout *= 1000; + dial=strsep(&s, "|"); if (! dial) { ast_log(LOG_WARNING, "PARK: A dial resouce must be specified i.e: Console/dsp or Zap/g1/5551212\n"); Binary files asterisk/apps/app_parkandannounce.o and /usr/src/asterisk/apps/app_parkandannounce.o differ Binary files asterisk/apps/app_parkandannounce.so and /usr/src/asterisk/apps/app_parkandannounce.so differ Binary files asterisk/apps/app_playback.o and /usr/src/asterisk/apps/app_playback.o differ Binary files asterisk/apps/app_playback.so and /usr/src/asterisk/apps/app_playback.so differ Binary files asterisk/apps/app_privacy.o and /usr/src/asterisk/apps/app_privacy.o differ Binary files asterisk/apps/app_privacy.so and /usr/src/asterisk/apps/app_privacy.so differ Binary files asterisk/apps/app_qcall.o and /usr/src/asterisk/apps/app_qcall.o differ Binary files asterisk/apps/app_qcall.so and /usr/src/asterisk/apps/app_qcall.so differ diff -ru asterisk/apps/app_queue.c /usr/src/asterisk/apps/app_queue.c --- asterisk/apps/app_queue.c 2004-03-31 17:43:11.000000000 -0500 +++ /usr/src/asterisk/apps/app_queue.c 2004-02-22 23:16:00.000000000 -0500 @@ -78,7 +78,7 @@ " 'n' -- no retries on the timeout; will exit this application and go to the next step.\n" " In addition to transferring the call, a call may be parked and then picked\n" "up by another user.\n" -" The optional URL will be sent to the called party if the channel supports\n" +" The optionnal URL will be sent to the called party if the channel supports\n" "it.\n"; // [PHM 06/26/03] @@ -707,10 +707,8 @@ int x=0; char *announce = NULL; char digit = 0; - time_t now; /* Hold the lock while we setup the outgoing calls */ ast_mutex_lock(&qe->parent->lock); - time(&now); cur = qe->parent->members; if (strlen(qe->announce)) announce = qe->announce; @@ -739,7 +737,7 @@ tmp->dataquality = 1; if (strchr(options, 'H')) tmp->allowdisconnect = 1; - if (strchr(options, 'n') && (now - qe->start >= qe->parent->timeout)) + if (strchr(options, 'n')) *go_on = 1; } if (url) { @@ -1529,8 +1527,6 @@ ast_cli_unregister(&cli_show_queues); ast_manager_unregister( "Queues" ); ast_manager_unregister( "QueueStatus" ); - ast_unregister_application(app_aqm); - ast_unregister_application(app_rqm); return ast_unregister_application(app); } Binary files asterisk/apps/app_queue.o and /usr/src/asterisk/apps/app_queue.o differ Binary files asterisk/apps/app_queue.so and /usr/src/asterisk/apps/app_queue.so differ diff -ru asterisk/apps/app_random.c /usr/src/asterisk/apps/app_random.c --- asterisk/apps/app_random.c 2004-03-01 15:45:23.000000000 -0500 +++ /usr/src/asterisk/apps/app_random.c 2004-01-11 20:56:38.000000000 -0500 @@ -42,7 +42,7 @@ int res=0; struct localuser *u; - char *s; + char *s, *ts; char *exten, *pri, *context; char *prob; int probint, priorityint; @@ -54,7 +54,7 @@ LOCAL_USER_ADD(u); s = ast_strdupa((void *) data); - prob = strsep(&s,":"); + prob = strsep(&ts,":"); if ((!prob) || (sscanf(prob, "%d", &probint) != 1)) probint = 0; Binary files asterisk/apps/app_random.o and /usr/src/asterisk/apps/app_random.o differ Binary files asterisk/apps/app_random.so and /usr/src/asterisk/apps/app_random.so differ Binary files asterisk/apps/app_read.o and /usr/src/asterisk/apps/app_read.o differ Binary files asterisk/apps/app_read.so and /usr/src/asterisk/apps/app_read.so differ diff -ru asterisk/apps/app_record.c /usr/src/asterisk/apps/app_record.c --- asterisk/apps/app_record.c 2004-02-25 17:33:49.000000000 -0500 +++ /usr/src/asterisk/apps/app_record.c 2004-01-30 00:13:25.000000000 -0500 @@ -30,13 +30,13 @@ static char *synopsis = "Record to a file"; static char *descrip = -" Record(filename:format|silence): Records from the channel into a given\n" +" Record(filename:extension|silence): Records from the channel into a given\n" "filename. If the file exists it will be overwritten. \n" -"- 'format' is the format of the file type to be recorded (wav, gsm, etc).\n" +"- 'extension' is the extension of the file type to be recorded (wav, gsm, etc).\n" "- 'silence' is the number of seconds of silence to allow before returning.\n\n" "If filename contains '%d', these characters will be replaced with a number\n" "incremented by one each time the file is recorded. \n\n" -"Formats: g723, g729, gsm, h263, ulaw, alaw, vox, wav, WAV\n\n" +"Extensions: g723, g729, gsm, h263, ulaw, alaw, vox, wav, WAV\n\n" "Returns -1 when the user hangs up.\n"; STANDARD_LOCAL_USER; Binary files asterisk/apps/app_record.o and /usr/src/asterisk/apps/app_record.o differ Binary files asterisk/apps/app_record.so and /usr/src/asterisk/apps/app_record.so differ Binary files asterisk/apps/app_sayunixtime.o and /usr/src/asterisk/apps/app_sayunixtime.o differ Binary files asterisk/apps/app_sayunixtime.so and /usr/src/asterisk/apps/app_sayunixtime.so differ Binary files asterisk/apps/app_senddtmf.o and /usr/src/asterisk/apps/app_senddtmf.o differ Binary files asterisk/apps/app_senddtmf.so and /usr/src/asterisk/apps/app_senddtmf.so differ Binary files asterisk/apps/app_setcallerid.o and /usr/src/asterisk/apps/app_setcallerid.o differ Binary files asterisk/apps/app_setcallerid.so and /usr/src/asterisk/apps/app_setcallerid.so differ Binary files asterisk/apps/app_setcdruserfield.o and /usr/src/asterisk/apps/app_setcdruserfield.o differ Binary files asterisk/apps/app_setcdruserfield.so and /usr/src/asterisk/apps/app_setcdruserfield.so differ Binary files asterisk/apps/app_setcidname.o and /usr/src/asterisk/apps/app_setcidname.o differ Binary files asterisk/apps/app_setcidname.so and /usr/src/asterisk/apps/app_setcidname.so differ Binary files asterisk/apps/app_setcidnum.o and /usr/src/asterisk/apps/app_setcidnum.o differ Binary files asterisk/apps/app_setcidnum.so and /usr/src/asterisk/apps/app_setcidnum.so differ Binary files asterisk/apps/app_softhangup.o and /usr/src/asterisk/apps/app_softhangup.o differ Binary files asterisk/apps/app_softhangup.so and /usr/src/asterisk/apps/app_softhangup.so differ diff -ru asterisk/apps/app_sql_postgres.c /usr/src/asterisk/apps/app_sql_postgres.c --- asterisk/apps/app_sql_postgres.c 2004-03-15 11:52:28.000000000 -0500 +++ /usr/src/asterisk/apps/app_sql_postgres.c 2002-11-11 11:37:01.000000000 -0500 @@ -5,7 +5,7 @@ * * Copyright (C) 2002, Christos Ricudis * - * Christos Ricudis + * Christos Ricudis * * This program is free software, distributed under the terms of * the GNU General Public License Binary files asterisk/apps/app_striplsd.o and /usr/src/asterisk/apps/app_striplsd.o differ Binary files asterisk/apps/app_striplsd.so and /usr/src/asterisk/apps/app_striplsd.so differ Binary files asterisk/apps/app_substring.o and /usr/src/asterisk/apps/app_substring.o differ Binary files asterisk/apps/app_substring.so and /usr/src/asterisk/apps/app_substring.so differ diff -ru asterisk/apps/app_system.c /usr/src/asterisk/apps/app_system.c --- asterisk/apps/app_system.c 2004-02-27 01:56:45.000000000 -0500 +++ /usr/src/asterisk/apps/app_system.c 2003-10-19 07:06:59.000000000 -0400 @@ -21,7 +21,6 @@ #include #include #include -#include #include @@ -54,15 +53,13 @@ LOCAL_USER_ADD(u); /* Do our thing here */ res = system((char *)data); - if ((res < 0) && (errno != ECHILD)) { + if (res < 0) { ast_log(LOG_WARNING, "Unable to execute '%s'\n", (char *)data); res = -1; } else if (res == 127) { ast_log(LOG_WARNING, "Unable to execute '%s'\n", (char *)data); res = -1; } else { - if (res < 0) - res = 0; if (res && ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->callerid)) chan->priority+=100; res = 0; Binary files asterisk/apps/app_system.o and /usr/src/asterisk/apps/app_system.o differ Binary files asterisk/apps/app_system.so and /usr/src/asterisk/apps/app_system.so differ Binary files asterisk/apps/app_transfer.o and /usr/src/asterisk/apps/app_transfer.o differ Binary files asterisk/apps/app_transfer.so and /usr/src/asterisk/apps/app_transfer.so differ Binary files asterisk/apps/app_url.o and /usr/src/asterisk/apps/app_url.o differ Binary files asterisk/apps/app_url.so and /usr/src/asterisk/apps/app_url.so differ Only in /usr/src/asterisk/apps: app_voicemail2.c.save diff -ru asterisk/apps/app_voicemail.c /usr/src/asterisk/apps/app_voicemail.c --- asterisk/apps/app_voicemail.c 2004-04-13 10:39:17.000000000 -0400 +++ /usr/src/asterisk/apps/app_voicemail.c 2004-04-12 20:41:31.000000000 -0400 @@ -148,14 +148,12 @@ static char *descrip_vm = " VoiceMail([s|u|b]extension[@context]): Leaves voicemail for a given\n" -"extension (must be configured in voicemail.conf). \n" -" If the extension is preceded by \n" -"* 's' instructions for leaving the message will be skipped.\n" -"* 'u' the \"unavailable\" message will be played \n" -" (/var/lib/asterisk/sounds/vm//unavail) if it exists.\n" -"* 'b' the busy message will be played (that is, busy instead of unavail).\n" -"If the caller presses '0' (zero) during the prompt, the call jumps to\n" -"priority 'o' in the current context.\n" +"extension (must be configured in voicemail.conf). If the extension is\n" +"preceded by an 's' then instructions for leaving the message will be\n" +"skipped. If the extension is preceeded by 'u' then the \"unavailable\"\n" +"message will be played (/var/lib/asterisk/sounds/vm//unavail) if it\n" +"exists. If the extension is preceeded by a 'b' then the the busy message\n" +"will be played (that is, busy instead of unavail).\n" "If the requested mailbox does not exist, and there exists a priority\n" "n + 101, then that priority will be taken next.\n" "Returns -1 on error or mailbox not found, or if the user hangs up.\n" @@ -169,7 +167,7 @@ "for the checking of voicemail. The mailbox can be passed as the option,\n" "which will stop the voicemail system from prompting the user for the mailbox.\n" "If the mailbox is preceded by 's' then the password check will be skipped. If\n" -"a context is specified, logins are considered in that voicemail context only.\n" +"a context is specified, logins are considered in that context only.\n" "Returns -1 if the user hangs up or 0 otherwise.\n"; static char *synopsis_vm_box_exists = @@ -179,7 +177,6 @@ " VoiceMailExists(mailbox[@context]): Conditionally branches to priority n+101\n" "if the specified voice mailbox exists.\n"; - /* Leave a message */ static char *capp = "VoiceMail2"; static char *app = "VoiceMail"; @@ -773,7 +770,7 @@ fprintf(p, "--%s\n", bound); } - fprintf(p, "Content-Type: text/plain; charset=ISO-8859-1\nContent-Transfer-Encoding: 8bit\n\n"); + fprintf(p, "Content-Type: text/plain; charset=ISO-8859-1\nContent-Transfer-Encoding: 8bit\n"); strftime(date, sizeof(date), "%A, %B %d, %Y at %r", &tm); if (emailbody) { struct ast_channel *ast = ast_channel_alloc(0); @@ -1350,7 +1347,6 @@ FILE *txt; int res = 0; int msgnum; - int fd; char date[256]; char dir[256]; char fn[256]; @@ -1486,15 +1482,11 @@ res = play_and_record(chan, NULL, fn, vmmaxmessage, fmt); if (res > 0) res = 0; - fd = open(txtfile, O_APPEND | O_WRONLY); - if (fd > -1) { - txt = fdopen(fd, "a"); - if (txt) { - time(&end); - fprintf(txt, "duration=%ld\n", (long)(end-start)); - fclose(txt); - } else - close(fd); + txt = fopen(txtfile, "a"); + if (txt) { + time(&end); + fprintf(txt, "duration=%ld\n", (long)(end-start)); + fclose(txt); } stringp = fmt; strsep(&stringp, "|"); @@ -2281,7 +2273,7 @@ system(sys); todircount = count_messages(todir); - strncpy(tmp, fmt, sizeof(tmp) - 1); + strncpy(tmp, fmt, sizeof(tmp)); stringp = tmp; while((s = strsep(&stringp, "|"))) { /* XXX This is a hack -- we should use build_filename or similar XXX */ @@ -2593,7 +2585,9 @@ if (!res) { vms->repeats++; if (vms->repeats > 2) { - res = 't'; + res = play_and_wait(chan, "vm-goodbye"); + if (!res) + res = 't'; } } } @@ -3029,22 +3023,22 @@ char *stringp; char *s; struct ast_vm_user *vmu; - strncpy(tmp, data, sizeof(tmp) - 1); + strncpy(tmp, data, sizeof(tmp)); vmu = malloc(sizeof(struct ast_vm_user)); if (vmu) { memset(vmu, 0, sizeof(struct ast_vm_user)); - strncpy(vmu->context, context, sizeof(vmu->context) - 1); - strncpy(vmu->mailbox, mbox, sizeof(vmu->mailbox) - 1); + strncpy(vmu->context, context, sizeof(vmu->context)); + strncpy(vmu->mailbox, mbox, sizeof(vmu->mailbox)); vmu->attach = -1; stringp = tmp; if ((s = strsep(&stringp, ","))) - strncpy(vmu->password, s, sizeof(vmu->password) - 1); + strncpy(vmu->password, s, sizeof(vmu->password)); if (stringp && (s = strsep(&stringp, ","))) - strncpy(vmu->fullname, s, sizeof(vmu->fullname) - 1); + strncpy(vmu->fullname, s, sizeof(vmu->fullname)); if (stringp && (s = strsep(&stringp, ","))) - strncpy(vmu->email, s, sizeof(vmu->email) - 1); + strncpy(vmu->email, s, sizeof(vmu->email)); if (stringp && (s = strsep(&stringp, ","))) - strncpy(vmu->pager, s, sizeof(vmu->pager) - 1); + strncpy(vmu->pager, s, sizeof(vmu->pager)); if (stringp && (s = strsep(&stringp, ","))) apply_options(vmu, s); vmu->next = NULL; @@ -3100,7 +3094,7 @@ return 0; } -#ifndef USEMYSQLVM + /* XXX TL Bug 690 */ static char show_voicemail_users_help[] = "Usage: show voicemail users [for ]\n" @@ -3222,7 +3216,7 @@ { { "show", "voicemail", "zones", NULL }, handle_show_voicemail_zones, "List zone message formats", show_voicemail_zones_help, NULL }; -#endif + static int load_config(void) { @@ -3381,21 +3375,16 @@ msg_format = ast_strdupa(var->value); if (msg_format != NULL) { timezone = strsep(&msg_format, "|"); - if (msg_format) { - strncpy(z->name, var->name, sizeof(z->name) - 1); - strncpy(z->timezone, timezone, sizeof(z->timezone) - 1); - strncpy(z->msg_format, msg_format, sizeof(z->msg_format) - 1); - z->next = NULL; - if (zones) { - zonesl->next = z; - zonesl = z; - } else { - zones = z; - zonesl = z; - } + strncpy(z->name, var->name, sizeof(z->name) - 1); + strncpy(z->timezone, timezone, sizeof(z->timezone) - 1); + strncpy(z->msg_format, msg_format, sizeof(z->msg_format) - 1); + z->next = NULL; + if (zones) { + zonesl->next = z; + zonesl = z; } else { - ast_log(LOG_WARNING, "Invalid timezone definition at line %d\n", var->lineno); - free(z); + zones = z; + zonesl = z; } } else { ast_log(LOG_WARNING, "Out of memory while reading voicemail config\n"); @@ -3470,12 +3459,10 @@ res |= ast_unregister_application(capp); res |= ast_unregister_application(app2); res |= ast_unregister_application(capp2); - res |= ast_unregister_application(app3); + res |= ast_unregister_application(app3); sql_close(); -#ifndef USEMYSQLVM ast_cli_unregister(&show_voicemail_users_cli); ast_cli_unregister(&show_voicemail_zones_cli); -#endif return res; } @@ -3498,10 +3485,8 @@ ast_log(LOG_WARNING, "SQL init\n"); return res; } -#ifndef USEMYSQLVM ast_cli_register(&show_voicemail_users_cli); ast_cli_register(&show_voicemail_zones_cli); -#endif return res; } Binary files asterisk/apps/app_voicemail.o and /usr/src/asterisk/apps/app_voicemail.o differ Only in /usr/src/asterisk/apps: app_voicemail.old Binary files asterisk/apps/app_voicemail.so and /usr/src/asterisk/apps/app_voicemail.so differ Binary files asterisk/apps/app_waitforring.o and /usr/src/asterisk/apps/app_waitforring.o differ Binary files asterisk/apps/app_waitforring.so and /usr/src/asterisk/apps/app_waitforring.so differ Binary files asterisk/apps/app_zapateller.o and /usr/src/asterisk/apps/app_zapateller.o differ Binary files asterisk/apps/app_zapateller.so and /usr/src/asterisk/apps/app_zapateller.so differ Binary files asterisk/apps/app_zapbarge.o and /usr/src/asterisk/apps/app_zapbarge.o differ Binary files asterisk/apps/app_zapbarge.so and /usr/src/asterisk/apps/app_zapbarge.so differ diff -ru asterisk/apps/app_zapras.c /usr/src/asterisk/apps/app_zapras.c --- asterisk/apps/app_zapras.c 2004-02-27 01:00:58.000000000 -0500 +++ /usr/src/asterisk/apps/app_zapras.c 2003-02-04 10:48:42.000000000 -0500 @@ -44,7 +44,7 @@ static char *descrip = " ZapRAS(args): Executes a RAS server using pppd on the given channel.\n" "The channel must be a clear channel (i.e. PRI source) and a Zaptel\n" -"channel to be able to use this function (No modem emulation is included).\n" +"channel to be able to use this function (No modem emulcation is included).\n" "Your pppd must be patched to be zaptel aware. Arguments should be\n" "separated by | characters. Always returns -1.\n"; Binary files asterisk/apps/app_zapras.o and /usr/src/asterisk/apps/app_zapras.o differ Binary files asterisk/apps/app_zapras.so and /usr/src/asterisk/apps/app_zapras.so differ diff -ru asterisk/apps/app_zapscan.c /usr/src/asterisk/apps/app_zapscan.c --- asterisk/apps/app_zapscan.c 2004-03-18 22:46:21.000000000 -0500 +++ /usr/src/asterisk/apps/app_zapscan.c 2004-01-11 02:37:47.000000000 -0500 @@ -43,8 +43,8 @@ static char *synopsis = "Scan Zap channels to monitor calls"; static char *descrip = -" ZapScan allows a call center manager to monitor Zap channels in\n" -"a convenient way. Use '#' to select the next channel and use '*' to exit\n"; +" ZapScan allows a call center manager to monitor\n" +"phone conversations in a convenient way."; STANDARD_LOCAL_USER; @@ -191,9 +191,6 @@ if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) { ret = 0; break; - } else if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*')) { - ret = -1; - break; } else if (fd != chan->fds[0]) { if (f->frametype == AST_FRAME_VOICE) { if (f->subclass == AST_FORMAT_ULAW) { @@ -248,7 +245,6 @@ int confno = 0; char confstr[80], *tmp; struct ast_channel *tempchan = NULL, *lastchan = NULL; - struct ast_frame *f; LOCAL_USER_ADD(u); @@ -256,20 +252,10 @@ ast_answer(chan); for (;;) { - if (ast_waitfor(chan, 100) < 0) - break; - f = ast_read(chan); - if (!f) - break; - if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*')) { - ast_frfree(f); - break; - } - ast_frfree(f); tempchan = ast_channel_walk(tempchan); if ( !tempchan && !lastchan ) break; - if ( tempchan && tempchan->type && (!strcmp(tempchan->type, "Zap")) && (tempchan != chan) ) { + if ( tempchan && (!strcmp(tempchan->type, "Zap")) && (tempchan != chan) ) { ast_verbose(VERBOSE_PREFIX_3 "Zap channel %s is in-use, monitoring...\n", tempchan->name); strcpy(confstr, tempchan->name); if ((tmp = strchr(confstr,'-'))) { Binary files asterisk/apps/app_zapscan.o and /usr/src/asterisk/apps/app_zapscan.o differ Binary files asterisk/apps/app_zapscan.so and /usr/src/asterisk/apps/app_zapscan.so differ diff -ru asterisk/apps/CVS/Entries /usr/src/asterisk/apps/CVS/Entries --- asterisk/apps/CVS/Entries 2004-04-13 10:27:09.000000000 -0400 +++ /usr/src/asterisk/apps/CVS/Entries 2004-02-25 14:31:55.000000000 -0500 @@ -1,19 +1,19 @@ /.cvsignore/1.1/Thu May 8 03:46:43 2003//Tv1-0_stable /Makefile/1.50/Mon Jan 12 01:56:38 2004//Tv1-0_stable -/app_adsiprog.c/1.4.2.2/Sat Mar 20 17:27:27 2004//Tv1-0_stable -/app_agi.c/1.26.2.3/Fri Mar 12 18:50:05 2004//Tv1-0_stable +/app_adsiprog.c/1.4/Thu May 8 03:43:14 2003//Tv1-0_stable +/app_agi.c/1.26/Fri Jan 30 05:37:39 2004//Tv1-0_stable /app_authenticate.c/1.3/Thu Jan 29 20:54:37 2004//Tv1-0_stable /app_cdr.c/1.4/Wed Oct 22 02:53:39 2003//Tv1-0_stable -/app_chanisavail.c/1.3.2.2/Tue Mar 2 17:49:52 2004//Tv1-0_stable +/app_chanisavail.c/1.3/Tue Apr 8 19:14:03 2003//Tv1-0_stable /app_cut.c/1.3.2.1/Tue Feb 24 18:58:04 2004//Tv1-0_stable /app_datetime.c/1.1/Fri Jul 12 09:03:50 2002//Tv1-0_stable /app_db.c/1.4/Wed Apr 23 19:09:13 2003//Tv1-0_stable -/app_dial.c/1.53.2.4/Fri Mar 19 00:09:14 2004//Tv1-0_stable -/app_directory.c/1.14.2.1/Tue Mar 23 05:32:54 2004//Tv1-0_stable +/app_dial.c/1.53.2.2/Sun Feb 22 05:32:40 2004//Tv1-0_stable +/app_directory.c/1.14/Sun Nov 9 06:16:07 2003//Tv1-0_stable /app_disa.c/1.9/Mon Sep 1 15:44:27 2003//Tv1-0_stable /app_echo.c/1.7/Sat Jun 28 16:40:02 2003//Tv1-0_stable /app_enumlookup.c/1.7/Mon Oct 6 00:36:17 2003//Tv1-0_stable -/app_festival.c/1.13.2.2/Wed Mar 24 22:52:10 2004//Tv1-0_stable +/app_festival.c/1.13/Thu Jan 22 21:47:58 2004//Tv1-0_stable /app_flash.c/1.1/Tue Feb 4 15:48:42 2003//Tv1-0_stable /app_getcpeid.c/1.1/Mon May 13 22:29:38 2002//Tv1-0_stable /app_hasnewvoicemail.c/1.3/Mon Dec 8 19:31:56 2003//Tv1-0_stable @@ -21,18 +21,18 @@ /app_intercom.c/1.14/Wed Oct 22 03:10:24 2003//Tv1-0_stable /app_lookupblacklist.c/1.4/Sun Mar 16 22:37:29 2003//Tv1-0_stable /app_lookupcidname.c/1.2/Sun Mar 16 22:37:29 2003//Tv1-0_stable -/app_macro.c/1.11.2.1/Thu Mar 4 05:58:13 2004//Tv1-0_stable +/app_macro.c/1.11/Thu Aug 21 23:26:13 2003//Tv1-0_stable /app_meetme.c/1.18/Wed Jan 14 06:04:46 2004//Tv1-0_stable /app_milliwatt.c/1.4/Fri Jun 27 23:02:52 2003//Tv1-0_stable /app_mp3.c/1.12/Sat Sep 27 00:30:07 2003//Tv1-0_stable -/app_parkandannounce.c/1.3.2.1/Thu Mar 11 06:16:27 2004//Tv1-0_stable +/app_parkandannounce.c/1.3/Wed Apr 23 19:09:13 2003//Tv1-0_stable /app_playback.c/1.11/Mon Nov 11 16:37:01 2002//Tv1-0_stable /app_privacy.c/1.5/Fri Sep 26 23:41:41 2003//Tv1-0_stable /app_qcall.c/1.8/Wed Jan 28 21:32:48 2004//Tv1-0_stable -/app_queue.c/1.45.2.4/Wed Mar 31 22:43:11 2004//Tv1-0_stable -/app_random.c/1.1.2.1/Mon Mar 1 20:45:23 2004//Tv1-0_stable +/app_queue.c/1.45.2.1/Mon Feb 23 04:16:00 2004//Tv1-0_stable +/app_random.c/1.1/Mon Jan 12 01:56:38 2004//Tv1-0_stable /app_read.c/1.2/Mon Nov 10 04:54:02 2003//Tv1-0_stable -/app_record.c/1.12.2.1/Wed Feb 25 22:33:49 2004//Tv1-0_stable +/app_record.c/1.12/Fri Jan 30 05:13:25 2004//Tv1-0_stable /app_rpt.c/1.1/Sun Dec 8 17:30:24 2002//Tv1-0_stable /app_sayunixtime.c/1.5/Fri Dec 5 17:33:30 2003//Tv1-0_stable /app_senddtmf.c/1.1/Mon Oct 14 05:30:28 2002//Tv1-0_stable @@ -42,18 +42,18 @@ /app_setcidnum.c/1.1/Mon Aug 25 15:42:25 2003//Tv1-0_stable /app_skel.c/1.6/Sat Nov 15 06:14:15 2003//Tv1-0_stable /app_softhangup.c/1.2/Wed Apr 23 19:09:13 2003//Tv1-0_stable -/app_sql_postgres.c/1.2.2.1/Mon Mar 15 16:52:28 2004//Tv1-0_stable +/app_sql_postgres.c/1.2/Mon Nov 11 16:37:01 2002//Tv1-0_stable /app_striplsd.c/1.2/Wed Apr 23 19:09:13 2003//Tv1-0_stable /app_substring.c/1.6/Sat Sep 27 02:39:04 2003//Tv1-0_stable -/app_system.c/1.6.2.2/Fri Feb 27 06:56:45 2004//Tv1-0_stable +/app_system.c/1.6/Sun Oct 19 11:06:59 2003//Tv1-0_stable /app_transfer.c/1.2/Tue Dec 9 18:54:06 2003//Tv1-0_stable /app_url.c/1.4/Mon Nov 11 16:37:01 2002//Tv1-0_stable -/app_voicemail.c/1.55.2.9/Wed Mar 31 19:10:08 2004//Tv1-0_stable +/app_voicemail.c/1.55.2.2/Tue Feb 24 17:11:39 2004//Tv1-0_stable /app_waitforring.c/1.2.2.1/Sun Feb 15 08:41:21 2004//Tv1-0_stable /app_zapateller.c/1.4/Mon Mar 31 03:19:34 2003//Tv1-0_stable /app_zapbarge.c/1.1/Tue Feb 4 15:48:42 2003//Tv1-0_stable -/app_zapras.c/1.4.2.1/Fri Feb 27 06:00:58 2004//Tv1-0_stable -/app_zapscan.c/1.1.2.4/Fri Mar 19 03:46:21 2004//Tv1-0_stable +/app_zapras.c/1.4/Tue Feb 4 15:48:42 2003//Tv1-0_stable +/app_zapscan.c/1.1/Sun Jan 11 07:37:47 2004//Tv1-0_stable /enter.h/1.1/Mon Apr 8 21:42:26 2002//Tv1-0_stable /leave.h/1.1/Mon Apr 8 21:42:26 2002//Tv1-0_stable D diff -ru asterisk/apps/.depend /usr/src/asterisk/apps/.depend --- asterisk/apps/.depend 2004-04-13 10:32:54.000000000 -0400 +++ /usr/src/asterisk/apps/.depend 2004-03-19 11:21:58.000000000 -0500 @@ -98,8 +98,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -134,8 +134,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -213,8 +213,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -284,8 +284,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -350,8 +350,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -401,8 +401,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -435,8 +435,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -471,8 +471,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -504,8 +504,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -588,8 +588,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -628,8 +628,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -697,8 +697,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -731,8 +731,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -780,8 +780,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -815,8 +815,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -882,8 +882,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -924,8 +924,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -959,8 +959,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1031,8 +1031,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1064,8 +1064,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1100,8 +1100,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1139,8 +1139,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1184,23 +1184,23 @@ /usr/include/sys/ucontext.h app_random.o: app_random.c ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/include/endian.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h \ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \ - /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ - ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ - ../include/asterisk/linkedlists.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/xlocale.h /usr/include/signal.h \ - /usr/include/bits/initspin.h /usr/include/bits/sigthread.h \ - ../include/asterisk/lock.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /usr/include/setjmp.h /usr/include/bits/setjmp.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h ../include/asterisk/sched.h \ + ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/xlocale.h \ + /usr/include/signal.h /usr/include/bits/initspin.h \ + /usr/include/bits/sigthread.h ../include/asterisk/lock.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/environments.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/setjmp.h /usr/include/bits/setjmp.h \ ../include/asterisk/cdr.h /usr/include/sys/time.h \ ../include/asterisk/monitor.h /usr/include/stdio.h /usr/include/libio.h \ /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ @@ -1226,8 +1226,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1260,8 +1260,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1294,8 +1294,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1375,8 +1375,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1409,8 +1409,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1474,8 +1474,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1508,8 +1508,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1533,23 +1533,23 @@ /usr/include/bits/waitstatus.h /usr/include/alloca.h app_skel.o: app_skel.c ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/include/endian.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h \ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \ - /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ - ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ - ../include/asterisk/linkedlists.h /usr/include/pthread.h \ - /usr/include/sched.h /usr/include/xlocale.h /usr/include/signal.h \ - /usr/include/bits/initspin.h /usr/include/bits/sigthread.h \ - ../include/asterisk/lock.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /usr/include/setjmp.h /usr/include/bits/setjmp.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h ../include/asterisk/sched.h \ + ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/xlocale.h \ + /usr/include/signal.h /usr/include/bits/initspin.h \ + /usr/include/bits/sigthread.h ../include/asterisk/lock.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/environments.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/setjmp.h /usr/include/bits/setjmp.h \ ../include/asterisk/cdr.h /usr/include/sys/time.h \ ../include/asterisk/monitor.h /usr/include/stdio.h /usr/include/libio.h \ /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ @@ -1674,8 +1674,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1695,9 +1695,7 @@ /usr/include/stdlib.h /usr/include/bits/waitflags.h \ /usr/include/bits/waitstatus.h /usr/include/alloca.h \ /usr/include/string.h /usr/include/bits/string.h \ - /usr/include/bits/string2.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h + /usr/include/bits/string2.h app_transfer.o: app_transfer.c ../include/asterisk/lock.h \ /usr/include/pthread.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/gnu/stubs.h /usr/include/sched.h /usr/include/bits/types.h \ @@ -1709,8 +1707,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1742,8 +1740,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1776,8 +1774,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1861,8 +1859,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1894,8 +1892,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1935,8 +1933,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -1979,8 +1977,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ Binary files asterisk/asterisk and /usr/src/asterisk/asterisk differ Only in /usr/src/asterisk: asterisk-0.7.2-rdnis.diff diff -ru asterisk/asterisk.c /usr/src/asterisk/asterisk.c --- asterisk/asterisk.c 2004-04-09 13:46:10.000000000 -0400 +++ /usr/src/asterisk/asterisk.c 2004-02-22 22:43:45.000000000 -0500 @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -65,7 +65,7 @@ static int ast_socket = -1; /* UNIX Socket for allowing remote control */ static int ast_consock = -1; /* UNIX Socket for controlling another asterisk */ -int ast_mainpid; +static int mainpid; struct console { int fd; /* File descriptor */ int p[2]; /* Pipe */ @@ -109,7 +109,7 @@ static char *_argv[256]; static int shuttingdown = 0; static int restartnow = 0; -static pthread_t consolethread = AST_PTHREADT_NULL; +static pthread_t consolethread = (pthread_t) -1; int ast_register_atexit(void (*func)(void)) { @@ -196,7 +196,7 @@ if (gethostname(hostname, sizeof(hostname))) strncpy(hostname, "", sizeof(hostname)-1); - snprintf(tmp, sizeof(tmp), "%s/%d/%s\n", hostname, ast_mainpid, ASTERISK_VERSION); + snprintf(tmp, sizeof(tmp), "%s/%d/%s\n", hostname, mainpid, ASTERISK_VERSION); fdprint(con->fd, tmp); for(;;) { FD_ZERO(&rfds); @@ -257,15 +257,13 @@ FD_SET(ast_socket, &fds); s = ast_select(ast_socket + 1, &fds, NULL, NULL, NULL); if (s < 0) { - if (errno != EINTR) - ast_log(LOG_WARNING, "Select returned error: %s\n", strerror(errno)); + ast_log(LOG_WARNING, "Select retured error: %s\n", strerror(errno)); continue; } len = sizeof(sun); s = accept(ast_socket, (struct sockaddr *)&sun, &len); if (s < 0) { - if (errno != EINTR) - ast_log(LOG_WARNING, "Accept returned %d: %s\n", s, strerror(errno)); + ast_log(LOG_WARNING, "Accept retured %d: %s\n", s, strerror(errno)); } else { for (x=0;x= match_list_len) { match_list_len <<= 1; match_list = realloc(match_list, match_list_len * sizeof(char *)); } - match_list[matches++] = strdup(retstr); + match_list[matches++] = retstr; } if (!match_list) @@ -942,7 +936,7 @@ int nummatches = 0; char **matches; int retval = CC_ERROR; - char buf[2048]; + char buf[1024]; int res; LineInfo *lf = (LineInfo *)el_line(el); @@ -969,33 +963,12 @@ nummatches = atoi(buf); if (nummatches > 0) { - char *mbuf; - int mlen = 0, maxmbuf = 2048; - /* Start with a 2048 byte buffer */ - mbuf = malloc(maxmbuf); - if (!mbuf) - return (char *)(CC_ERROR); snprintf(buf, sizeof(buf),"_COMMAND MATCHESARRAY \"%s\" \"%s\"", lf->buffer, ptr); fdprint(ast_consock, buf); - res = 0; - mbuf[0] = '\0'; - while (!strstr(mbuf, AST_CLI_COMPLETE_EOF) && res != -1) { - if (mlen + 1024 > maxmbuf) { - /* Every step increment buffer 1024 bytes */ - maxmbuf += 1024; - mbuf = realloc(mbuf, maxmbuf); - if (!mbuf) - return (char *)(CC_ERROR); - } - /* Only read 1024 bytes at a time */ - res = read(ast_consock, mbuf + mlen, 1024); - if (res > 0) - mlen += res; - } - mbuf[mlen] = '\0'; + res = read(ast_consock, buf, sizeof(buf)); + buf[res] = '\0'; - matches = ast_el_strtoarr(mbuf); - free(mbuf); + matches = ast_el_strtoarr(buf); } else matches = (char **) NULL; @@ -1071,8 +1044,6 @@ el_set(el, EL_BIND, "^I", "ed-complete", NULL); /* Bind ? to command completion */ el_set(el, EL_BIND, "?", "ed-complete", NULL); - /* Bind ^D to redisplay */ - el_set(el, EL_BIND, "^D", "ed-redisplay", NULL); return 0; } @@ -1291,7 +1262,7 @@ if (gethostname(hostname, sizeof(hostname))) strncpy(hostname, "", sizeof(hostname)-1); - ast_mainpid = getpid(); + mainpid = getpid(); ast_ulaw_init(); ast_alaw_init(); callerid_init(); @@ -1499,8 +1470,6 @@ ast_verbose(" ]\n"); if (option_verbose || option_console) ast_verbose(term_color(tmp, "Asterisk Ready.\n", COLOR_BRWHITE, COLOR_BLACK, sizeof(tmp))); - if (option_nofork) - consolethread = pthread_self(); fully_booted = 1; pthread_sigmask(SIG_UNBLOCK, &sigs, NULL); #ifdef __AST_DEBUG_MALLOC @@ -1515,12 +1484,14 @@ ast_cli_register(&astshutdownwhenconvenient); ast_cli_register(&aborthalt); ast_cli_register(&astbang); + if (option_nofork) + consolethread = pthread_self(); if (option_console) { /* Console stuff now... */ /* Register our quit function */ char title[256]; set_icon("Asterisk"); - snprintf(title, sizeof(title), "Asterisk Console on '%s' (pid %d)", hostname, ast_mainpid); + snprintf(title, sizeof(title), "Asterisk Console on '%s' (pid %d)", hostname, mainpid); set_title(title); ast_cli_register(&quit); ast_cli_register(&astexit); Binary files asterisk/asterisk.o and /usr/src/asterisk/asterisk.o differ Binary files asterisk/ast_expr.o and /usr/src/asterisk/ast_expr.o differ Binary files asterisk/astmm.o and /usr/src/asterisk/astmm.o differ diff -ru asterisk/autoservice.c /usr/src/asterisk/autoservice.c --- asterisk/autoservice.c 2004-03-15 02:53:02.000000000 -0500 +++ /usr/src/asterisk/autoservice.c 2003-09-08 12:48:06.000000000 -0400 @@ -44,7 +44,7 @@ }; static struct asent *aslist = NULL; -static pthread_t asthread = AST_PTHREADT_NULL; +static pthread_t asthread = (pthread_t) -1; static void *autoservice_run(void *ign) { @@ -80,7 +80,7 @@ ast_frfree(f); } } - asthread = AST_PTHREADT_NULL; + asthread = (pthread_t) -1; return NULL; } @@ -90,7 +90,7 @@ struct asent *as; int needstart; ast_mutex_lock(&autolock); - needstart = (asthread == AST_PTHREADT_NULL) ? 1 : 0 /* aslist ? 0 : 1 */; + needstart = (asthread == (pthread_t) -1) ? 1 : 0 /* aslist ? 0 : 1 */; as = aslist; while(as) { if (as->chan == chan) @@ -142,7 +142,7 @@ if (!chan->_softhangup) res = 0; } - if (asthread != AST_PTHREADT_NULL) + if (asthread != (pthread_t) -1) pthread_kill(asthread, SIGURG); ast_mutex_unlock(&autolock); /* Wait for it to un-block */ Binary files asterisk/autoservice.o and /usr/src/asterisk/autoservice.o differ diff -ru asterisk/BUGS /usr/src/asterisk/BUGS --- asterisk/BUGS 2004-03-28 12:18:59.000000000 -0500 +++ /usr/src/asterisk/BUGS 2004-01-11 22:03:23.000000000 -0500 @@ -1,37 +1,3 @@ -Known Issues in Asterisk 1.0 -============================ -In order to provide a path for a stable Asterisk 1.0, the Asterisk CVS tree -was forked into a a 1.0-stable branch. Many new features and enhancements -have been added to the development tree in the mean time since the branch, -but in the interest of stability, only bug fixes were accepted into the -stable branch, meaning that over time, there has been a substantial -diversion of the feature set between stable (1.0) and developmental -Asterisk. This section is a list of important differences between the -stable (1.0) and development versions of Asterisk. - -* The number of SIP channels that can be simultaneously run through Asterisk - may be more limited than in development releases. - -* When Asterisk carries media from one RTP or IAX connection to another, - jitter on one side can sometimes be reflected in the timestamps going - to the other, causing the audio to be broken up on poor quality network - connections. This behavior has been changed in development releases. - -* The MGCP channel driver has been greatly extended in development releases. - -* The VPB (Voicetronix) driver in 1.0 only works with properly with FXO - interfaces. Extensive work has been done on the driver in the development - channel. - -* The SIP channel driver's ability to negotiate codecs has been improved - in developmental Asterisk. - -* The return result of app_system is unrealiable in 1.0 and has gone through - extensive rework in developmental Asterisk. - -* The queue system has been extensively reworked with a variety of new - features in developmental Asterisk. - Asterisk Bug Tracking Information ================================= diff -ru asterisk/build.h /usr/src/asterisk/build.h --- asterisk/build.h 2004-04-13 10:34:09.000000000 -0400 +++ /usr/src/asterisk/build.h 2004-03-19 11:23:12.000000000 -0500 @@ -6,5 +6,5 @@ #define BUILD_KERNEL "2.4.20-8smp" #define BUILD_MACHINE "i686" #define BUILD_OS "Linux" -#define BUILD_VERSION "CVS-04/13/04-10:34:09" +#define BUILD_VERSION "CVS-02/25/04-14:35:41" #define BUILD_USER "root" Binary files asterisk/callerid.o and /usr/src/asterisk/callerid.o differ Binary files asterisk/cdr/cdr_csv.o and /usr/src/asterisk/cdr/cdr_csv.o differ Binary files asterisk/cdr/cdr_csv.so and /usr/src/asterisk/cdr/cdr_csv.so differ Binary files asterisk/cdr/cdr_odbc.o and /usr/src/asterisk/cdr/cdr_odbc.o differ Binary files asterisk/cdr/cdr_odbc.so and /usr/src/asterisk/cdr/cdr_odbc.so differ Binary files asterisk/cdr.o and /usr/src/asterisk/cdr.o differ diff -ru asterisk/ChangeLog /usr/src/asterisk/ChangeLog --- asterisk/ChangeLog 2004-03-13 00:50:44.000000000 -0500 +++ /usr/src/asterisk/ChangeLog 2004-02-04 10:22:59.000000000 -0500 @@ -1,7 +1,3 @@ -Asterisk 0.9.0 - -- Fixes from the bug tracker - -- ADPCM Standardization - -- Branch to Stable CVS Asterisk 0.7.2 -- Countless small bug fixes from bug tracker -- DSP Fixes diff -ru asterisk/channel.c /usr/src/asterisk/channel.c --- asterisk/channel.c 2004-03-12 11:47:28.000000000 -0500 +++ /usr/src/asterisk/channel.c 2004-03-12 13:41:44.000000000 -0500 @@ -811,26 +811,15 @@ fd_set rfds, efds; int res; int x, y, max=-1; - time_t now = 0; - long whentohangup = 0, havewhen = 0, diff; struct ast_channel *winner = NULL; if (outfd) - *outfd = -99999; + *outfd = -1; if (exception) *exception = 0; /* Perform any pending masquerades */ for (x=0;xlock); - if (c[x]->whentohangup) { - if (!havewhen) - time(&now); - diff = c[x]->whentohangup - now; - if (!havewhen || (diff < whentohangup)) { - havewhen++; - whentohangup = diff; - } - } if (c[x]->masq) { if (ast_do_masquerade(c[x])) { ast_log(LOG_WARNING, "Masquerade failed\n"); @@ -844,13 +833,6 @@ tv.tv_sec = *ms / 1000; tv.tv_usec = (*ms % 1000) * 1000; - - if (havewhen) { - if ((*ms < 0) || (whentohangup * 1000 < *ms)) { - tv.tv_sec = whentohangup; - tv.tv_usec = 0; - } - } FD_ZERO(&rfds); FD_ZERO(&efds); @@ -871,7 +853,7 @@ if (fds[x] > max) max = fds[x]; } - if ((*ms >= 0) || (havewhen)) + if (*ms >= 0) res = ast_select(max + 1, &rfds, NULL, &efds, &tv); else res = ast_select(max + 1, &rfds, NULL, &efds, NULL); @@ -891,15 +873,8 @@ return NULL; } - if (havewhen) - time(&now); for (x=0;xblocking = 0; - if (havewhen && c[x]->whentohangup && (now > c[x]->whentohangup)) { - c[x]->_softhangup |= AST_SOFTHANGUP_TIMEOUT; - if (!winner) - winner = c[x]; - } for (y=0;yfds[y] > -1) { if ((FD_ISSET(c[x]->fds[y], &rfds) || FD_ISSET(c[x]->fds[y], &efds)) && !winner) { @@ -1578,8 +1553,6 @@ state = f->subclass; ast_frfree(f); break; - } else if (f->subclass == -1) { - /* Ignore -- just stopping indications */ } else { ast_log(LOG_NOTICE, "Don't know what to do with control frame %d\n", f->subclass); } @@ -2307,7 +2280,7 @@ *fo = f; *rc = who; res = 0; - ast_log(LOG_DEBUG, "Got a FRAME_CONTROL (%d) frame on channel %s\n", f->subclass, who->name); + ast_log(LOG_DEBUG, "Got a FRAME_CONTROL frame on channel %s\n",who->name); break; } if ((f->frametype == AST_FRAME_VOICE) || @@ -2523,36 +2496,3 @@ return 0; } -unsigned int ast_get_group(char *s) -{ - char *copy; - char *piece; - char *c=NULL; - int start=0, finish=0,x; - unsigned int group = 0; - copy = ast_strdupa(s); - if (!copy) { - ast_log(LOG_ERROR, "Out of memory\n"); - return 0; - } - c = copy; - - while((piece = strsep(&c, ","))) { - if (sscanf(piece, "%d-%d", &start, &finish) == 2) { - /* Range */ - } else if (sscanf(piece, "%d", &start)) { - /* Just one */ - finish = start; - } else { - ast_log(LOG_ERROR, "Syntax error parsing '%s' at '%s'. Using '0'\n", s,piece); - return 0; - } - for (x=start;x<=finish;x++) { - if ((x > 31) || (x < 0)) { - ast_log(LOG_WARNING, "Ignoring invalid group %d (maximum group is 31)\n", x); - } else - group |= (1 << x); - } - } - return group; -} Binary files asterisk/channel.o and /usr/src/asterisk/channel.o differ Binary files asterisk/channels/chan_agent.o and /usr/src/asterisk/channels/chan_agent.o differ Binary files asterisk/channels/chan_agent.so and /usr/src/asterisk/channels/chan_agent.so differ diff -ru asterisk/channels/chan_alsa.c /usr/src/asterisk/channels/chan_alsa.c --- asterisk/channels/chan_alsa.c 2004-03-25 11:50:26.000000000 -0500 +++ /usr/src/asterisk/channels/chan_alsa.c 2004-01-28 16:06:03.000000000 -0500 @@ -26,11 +26,7 @@ #include #include #include - -#define ALSA_PCM_NEW_HW_PARAMS_API -#define ALSA_PCM_NEW_SW_PARAMS_API #include - #include "busy.h" #include "ringtone.h" #include "ring10.h" @@ -320,15 +316,14 @@ static snd_pcm_t *alsa_card_init(char *dev, snd_pcm_stream_t stream) { int err; - int direction; snd_pcm_t *handle = NULL; snd_pcm_hw_params_t *hwparams = NULL; snd_pcm_sw_params_t *swparams = NULL; struct pollfd pfd; - snd_pcm_uframes_t period_size = PERIOD_FRAMES * 4; + int period_size = PERIOD_FRAMES * 4; //int period_bytes = 0; - snd_pcm_uframes_t buffer_size = 0; - + int buffer_size = 0; + unsigned int rate = DESIRED_RATE; unsigned int per_min = 1; //unsigned int per_max = 8; @@ -360,35 +355,35 @@ ast_log(LOG_ERROR, "set_channels failed: %s\n", snd_strerror(err)); } - direction = 0; - err = snd_pcm_hw_params_set_rate_near(handle, hwparams, &rate, &direction); + rate = snd_pcm_hw_params_set_rate_near(handle, hwparams, rate, 0); + if (rate != DESIRED_RATE) { ast_log(LOG_WARNING, "Rate not correct, requested %d, got %d\n", DESIRED_RATE, rate); } - direction = 0; - err = snd_pcm_hw_params_set_period_size_near(handle, hwparams, &period_size, &direction); + err = snd_pcm_hw_params_set_period_size_near(handle, hwparams, period_size, 0); if (err < 0) { - ast_log(LOG_ERROR, "period_size(%ld frames) is bad: %s\n", period_size, snd_strerror(err)); + ast_log(LOG_ERROR, "period_size(%d frames) is bad: %s\n", period_size, snd_strerror(err)); } else { ast_log(LOG_DEBUG, "Period size is %d\n", err); } + period_size = err; buffer_size = 4096 * 2; //period_size * 16; - err = snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, &buffer_size); + err = snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, buffer_size); if (err < 0) { - ast_log(LOG_WARNING, "Problem setting buffer size of %ld: %s\n", buffer_size, snd_strerror(err)); + ast_log(LOG_WARNING, "Problem setting buffer size of %d: %s\n", buffer_size, snd_strerror(err)); } else { ast_log(LOG_DEBUG, "Buffer size is set to %d frames\n", err); } + buffer_size = err; -#if 0 - direction = 0; - err = snd_pcm_hw_params_set_periods_min(handle, hwparams, &per_min, &direction); + err = snd_pcm_hw_params_set_periods_min(handle, hwparams, &per_min, 0); if (err < 0) { ast_log(LOG_ERROR, "periods_min: %s\n", snd_strerror(err)); } +#if 0 err = snd_pcm_hw_params_set_periods_max(handle, hwparams, &per_max, 0); if (err < 0) { ast_log(LOG_ERROR, "periods_max: %s\n", snd_strerror(err)); @@ -434,12 +429,11 @@ } #endif -#if 0 err = snd_pcm_sw_params_set_silence_threshold(handle, swparams, silencethreshold); if (err < 0) { ast_log(LOG_ERROR, "Unable to set silence threshold: %s\n", snd_strerror(err)); } -#endif + err = snd_pcm_sw_params(handle, swparams); if (err < 0) { ast_log(LOG_ERROR, "sw_params: %s\n", snd_strerror(err)); @@ -794,7 +788,7 @@ static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state) { struct ast_channel *tmp; - tmp = ast_channel_alloc(1); + tmp = ast_channel_alloc(0); if (tmp) { snprintf(tmp->name, sizeof(tmp->name), "ALSA/%s", indevname); tmp->type = type; @@ -949,9 +943,8 @@ return RESULT_FAILURE; } hookstate = 0; - if (alsa.owner) { - ast_queue_hangup(alsa.owner, 1); - } + if (alsa.owner) + needhangup++; return RESULT_SUCCESS; } @@ -995,7 +988,7 @@ strncpy(alsa.exten, mye, sizeof(alsa.exten)-1); strncpy(alsa.context, myc, sizeof(alsa.context)-1); hookstate = 1; - alsa_new(&alsa, AST_STATE_RINGING); + alsa_new(&alsa, AST_STATE_UP); } else ast_cli(fd, "No such extension '%s' in context '%s'\n", mye, myc); return RESULT_SUCCESS; diff -ru asterisk/channels/chan_h323.c /usr/src/asterisk/channels/chan_h323.c --- asterisk/channels/chan_h323.c 2004-03-15 04:14:36.000000000 -0500 +++ /usr/src/asterisk/channels/chan_h323.c 2004-03-18 10:32:07.000000000 -0500 @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Version Info: $Id: chan_h323.c,v 1.31.2.2 2004/03/15 09:14:36 citats Exp $ + * Version Info: $Id: chan_h323.c,v 1.31 2004/01/13 09:24:26 jeremy Exp $ */ @@ -148,7 +148,7 @@ /* This is the thread for the monitor which checks for input on the channels which are not currently in use. */ -static pthread_t monitor_thread = AST_PTHREADT_NULL; +static pthread_t monitor_thread = 0; static int restart_monitor(void); @@ -388,7 +388,7 @@ int res; struct oh323_pvt *p = c->pvt->pvt; char called_addr[256]; - char *tmp; + char *tmp, *cid, *cidname, oldcid[256]; strtok_r(dest, "/", &(tmp)); @@ -419,15 +419,47 @@ /* Copy callerid, if there is any */ if (c->callerid) { - char *tmp = strchr(c->callerid, '"'); - if (!tmp) { - p->calloptions.callerid = malloc(80); // evil - // sprintf(p->calloptions.callerid, "\"%s\"", c->callerid); - sprintf(p->calloptions.callerid, "\"\" <%s>", c->callerid); - } else { - p->calloptions.callerid = strdup(c->callerid); - } - } + memset(oldcid, 0, sizeof(oldcid)); + memcpy(oldcid, c->callerid, strlen(c->callerid)); + oldcid[sizeof(oldcid)-1] = '\0'; + ast_callerid_parse(oldcid, &cidname, &cid); + if (p->calloptions.callerid) { + free(p->calloptions.callerid); + p->calloptions.callerid = NULL; + } + if (p->calloptions.callername) { + free(p->calloptions.callername); + p->calloptions.callername = NULL; + } + p->calloptions.callerid = (char*)malloc(256); + if (p->calloptions.callerid == NULL) { + ast_log(LOG_ERROR, "Not enough memory.\n"); + return(-1); + } + memset(p->calloptions.callerid, 0, 256); + if ((cid != NULL)&&(strlen(cid) > 0)) + strncpy(p->calloptions.callerid, cid, 255); + + p->calloptions.callername = (char*)malloc(256); + if (p->calloptions.callername == NULL) { + ast_log(LOG_ERROR, "Not enough memory.\n"); + return(-1); + } + memset(p->calloptions.callername, 0, 256); + if ((cidname != NULL)&&(strlen(cidname) > 0)) + strncpy(p->calloptions.callername, cidname, 255); + + } else { + if (p->calloptions.callerid) { + free(p->calloptions.callerid); + p->calloptions.callerid = NULL; + } + if (p->calloptions.callername) { + free(p->calloptions.callername); + p->calloptions.callername = NULL; + } + } + res = h323_make_call(called_addr, &(p->cd), p->calloptions); @@ -436,7 +468,6 @@ return -1; } - ast_setstate(c, AST_STATE_RINGING); return 0; } @@ -592,27 +623,33 @@ switch(condition) { case AST_CONTROL_RINGING: - if (c->_state == AST_STATE_RING) { - // transmit_response(p, "180 Ringing", &p->initreq); + if (c->_state == AST_STATE_RING || c->_state == AST_STATE_RINGING) { + h323_send_alerting(p->cd.call_token); break; } - return 0; + return -1; + case AST_CONTROL_PROGRESS: + if (c->_state != AST_STATE_UP) { + h323_send_progress(p->cd.call_token); + break; + } + return -1; case AST_CONTROL_BUSY: if (c->_state != AST_STATE_UP) { - // transmit_response(p, "600 Busy everywhere", &p->initreq); + h323_answering_call(p->cd.call_token, 1); p->alreadygone = 1; - ast_softhangup(c, AST_SOFTHANGUP_DEV); + ast_softhangup_nolock(c, AST_SOFTHANGUP_DEV); break; } - return 0; + return -1; case AST_CONTROL_CONGESTION: if (c->_state != AST_STATE_UP) { - // transmit_response(p, "486 Busy here", &p->initreq); + h323_answering_call(p->cd.call_token, 1); p->alreadygone = 1; - ast_softhangup(c, AST_SOFTHANGUP_DEV); + ast_softhangup_nolock(c, AST_SOFTHANGUP_DEV); break; } - return 0; + return -1; case -1: return -1; default: @@ -985,11 +1022,12 @@ p->cd.call_dest_alias = cd.call_dest_alias; p->cd.call_source_e164 = cd.call_source_e164; p->cd.call_dest_e164 = cd.call_dest_e164; + p->cd.call_source_name = cd.call_source_name; if (h323debug) { ast_verbose(VERBOSE_PREFIX_3 "Setting up Call\n"); ast_verbose(VERBOSE_PREFIX_3 " Call token: [%s]\n", p->cd.call_token); - ast_verbose(VERBOSE_PREFIX_3 " Calling party name: [%s]\n", p->cd.call_source_aliases); + ast_verbose(VERBOSE_PREFIX_3 " Calling party name: [%s]\n", p->cd.call_source_name); ast_verbose(VERBOSE_PREFIX_3 " Calling party number: [%s]\n", p->cd.call_source_e164); ast_verbose(VERBOSE_PREFIX_3 " Called party name: [%s]\n", p->cd.call_dest_alias); ast_verbose(VERBOSE_PREFIX_3 " Called party number: [%s]\n", p->cd.call_dest_e164); @@ -1013,7 +1051,7 @@ } - sprintf(p->callerid, "%s <%s>", p->cd.call_source_aliases, p->cd.call_source_e164); + sprintf(p->callerid, "%s <%s>", p->cd.call_source_name, p->cd.call_source_e164); } else { /* Either this call is not from the Gatekeeper @@ -1024,7 +1062,7 @@ if (!user) { - sprintf(p->callerid, "%s <%s>", p->cd.call_source_aliases, p->cd.call_source_e164); + sprintf(p->callerid, "%s <%s>", p->cd.call_source_name, p->cd.call_source_e164); if (strlen(p->cd.call_dest_e164)) { strncpy(p->exten, cd.call_dest_e164, sizeof(p->exten)-1); } else { @@ -1064,7 +1102,7 @@ if (strlen(user->callerid)) strncpy(p->callerid, user->callerid, sizeof(p->callerid) - 1); else - sprintf(p->callerid, "%s <%s>", p->cd.call_source_aliases, p->cd.call_source_e164); + sprintf(p->callerid, "%s <%s>", p->cd.call_source_name, p->cd.call_source_e164); if (strlen(p->cd.call_dest_e164)) { strncpy(p->exten, cd.call_dest_e164, sizeof(p->exten)-1); @@ -1162,8 +1200,38 @@ c = p->owner; ast_setstate(c, AST_STATE_UP); + ast_queue_control(c, AST_CONTROL_ANSWER, 0); + return; } +/** + * Call-back function to signal asterisk that the channel is ringing + + * Returns nothing + */ + +void chan_ringing(unsigned call_reference) +{ + struct ast_channel *c = NULL; + struct oh323_pvt *p = NULL; + + p = find_call(call_reference); + + if (!p) + ast_log(LOG_ERROR, "Something is wrong: ringing\n"); + + + if (!p->owner) { + ast_log(LOG_ERROR, "Channel has no owner\n"); + return; + } + c = p->owner; + ast_setstate(c, AST_STATE_RINGING); + ast_queue_control(c, AST_CONTROL_RINGING, 0); + + return; +} + /** * Call-back function to cleanup communication @@ -1259,7 +1327,7 @@ static int restart_monitor(void) { /* If we're supposed to be stopped -- stay stopped */ - if (monitor_thread == AST_PTHREADT_STOP) + if (monitor_thread == -2) return 0; if (ast_mutex_lock(&monlock)) { ast_log(LOG_WARNING, "Unable to lock monitor\n"); @@ -1270,7 +1338,7 @@ ast_log(LOG_WARNING, "Cannot kill myself\n"); return -1; } - if (monitor_thread && (monitor_thread != AST_PTHREADT_NULL)) { + if (monitor_thread && (monitor_thread != -2)) { /* Wake up the thread */ pthread_kill(monitor_thread, SIGURG); } else { @@ -1793,6 +1861,7 @@ create_connection, setup_rtp_connection, cleanup_connection, + chan_ringing, connection_made, send_digit); @@ -1839,12 +1908,12 @@ } if (!ast_mutex_lock(&monlock)) { - if (monitor_thread && (monitor_thread != AST_PTHREADT_STOP)) { + if (monitor_thread && (monitor_thread != -2)) { pthread_cancel(monitor_thread); pthread_kill(monitor_thread, SIGURG); pthread_join(monitor_thread, NULL); } - monitor_thread = AST_PTHREADT_STOP; + monitor_thread = (pthread_t) -2; ast_mutex_unlock(&monlock); } else { ast_log(LOG_WARNING, "Unable to lock the monitor\n"); Only in /usr/src/asterisk/channels: chan_h323.o Only in /usr/src/asterisk/channels: chan_h323.so diff -ru asterisk/channels/chan_iax2.c /usr/src/asterisk/channels/chan_iax2.c --- asterisk/channels/chan_iax2.c 2004-03-24 16:24:33.000000000 -0500 +++ /usr/src/asterisk/channels/chan_iax2.c 2004-02-18 11:05:23.000000000 -0500 @@ -49,7 +49,6 @@ #include #include #include -#include #ifdef IAX_TRUNKING #include #include @@ -167,7 +166,7 @@ static int amaflags = 0; static int notransfer = 0; -static pthread_t netthreadid = AST_PTHREADT_NULL; +static pthread_t netthreadid; #define IAX_STATE_STARTED (1 << 0) #define IAX_STATE_AUTHENTICATED (1 << 1) @@ -1891,8 +1890,6 @@ if (!secret && strlen(storedsecret)) secret = storedsecret; ast_mutex_lock(&iaxsl[callno]); - if (strlen(c->context)) - strncpy(iaxs[callno]->context, c->context, sizeof(iaxs[callno]->context)); if (secret) { if (secret[0] == '[') { /* This is an RSA key, not a normal secret */ @@ -4073,7 +4070,7 @@ fr.callno = find_callno(ntohs(vh->callno) & ~0x8000, dcallno, &sin, new, 1); minivid = 1; } else if (meta->zeros == 0) { - /* This is a meta header */ + /* This is a a meta header */ switch(meta->metacmd) { case IAX_META_TRUNK: if (res < sizeof(struct ast_iax2_meta_hdr) + sizeof(struct ast_iax2_meta_trunk_hdr)) { @@ -4180,7 +4177,7 @@ || (f.subclass == IAX_COMMAND_POKE))) new = NEW_ALLOW; } else { - /* Don't know anything about it yet */ + /* Don't knwo anything about it yet */ f.frametype = AST_FRAME_NULL; f.subclass = 0; } @@ -4577,22 +4574,11 @@ iaxs[fr.callno]->owner->nativeformats = iaxs[fr.callno]->peerformat; if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Format for call is %s\n", ast_getformatname(iaxs[fr.callno]->owner->nativeformats)); -retryowner2: - if (ast_mutex_trylock(&iaxs[fr.callno]->owner->lock)) { - ast_mutex_unlock(&iaxsl[fr.callno]); - usleep(1); - ast_mutex_lock(&iaxsl[fr.callno]); - if (iaxs[fr.callno] && iaxs[fr.callno]->owner) goto retryowner2; - } - - if (iaxs[fr.callno] && iaxs[fr.callno]->owner) { - /* Setup read/write formats properly. */ - if (iaxs[fr.callno]->owner->writeformat) - ast_set_write_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->writeformat); - if (iaxs[fr.callno]->owner->readformat) - ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat); - ast_mutex_unlock(&iaxs[fr.callno]->owner->lock); - } + /* Setup read/write formats properly. */ + if (iaxs[fr.callno]->owner->writeformat) + ast_set_write_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->writeformat); + if (iaxs[fr.callno]->owner->readformat) + ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat); } } ast_mutex_lock(&dpcache_lock); @@ -6158,10 +6144,8 @@ { int x; /* Cancel the network thread, close the net socket */ - if (netthreadid != AST_PTHREADT_NULL) { - pthread_cancel(netthreadid); - pthread_join(netthreadid, NULL); - } + pthread_cancel(netthreadid); + pthread_join(netthreadid, NULL); close(netsocket); for (x=0;xchan->callerid = strdup(p->owner->callerid); else p->chan->callerid = NULL; + if (p->owner->rdnis) + p->chan->rdnis = strdup(p->owner->rdnis); + else + p->chan->rdnis = NULL; if (p->owner->ani) p->chan->ani = strdup(p->owner->ani); else Binary files asterisk/channels/chan_local.o and /usr/src/asterisk/channels/chan_local.o differ Binary files asterisk/channels/chan_local.so and /usr/src/asterisk/channels/chan_local.so differ diff -ru asterisk/channels/chan_mgcp.c /usr/src/asterisk/channels/chan_mgcp.c --- asterisk/channels/chan_mgcp.c 2004-03-15 04:14:36.000000000 -0500 +++ /usr/src/asterisk/channels/chan_mgcp.c 2004-02-02 01:38:08.000000000 -0500 @@ -167,7 +167,7 @@ /* This is the thread for the monitor which checks for input on the channels which are not currently in use. */ -static pthread_t monitor_thread = AST_PTHREADT_NULL; +static pthread_t monitor_thread = 0; static int restart_monitor(void); @@ -2558,7 +2558,7 @@ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); /* If we're supposed to be stopped -- stay stopped */ - if (monitor_thread == AST_PTHREADT_STOP) + if (monitor_thread == (pthread_t) -2) return 0; if (ast_mutex_lock(&monlock)) { ast_log(LOG_WARNING, "Unable to lock monitor\n"); @@ -2569,7 +2569,7 @@ ast_log(LOG_WARNING, "Cannot kill myself\n"); return -1; } - if (monitor_thread != AST_PTHREADT_NULL) { + if (monitor_thread) { /* Wake up the thread */ pthread_kill(monitor_thread, SIGURG); } else { @@ -3052,12 +3052,12 @@ return -1; } if (!ast_mutex_lock(&monlock)) { - if (monitor_thread && (monitor_thread != AST_PTHREADT_STOP)) { + if (monitor_thread && (monitor_thread != -2)) { pthread_cancel(monitor_thread); pthread_kill(monitor_thread, SIGURG); pthread_join(monitor_thread, NULL); } - monitor_thread = AST_PTHREADT_STOP; + monitor_thread = -2; ast_mutex_unlock(&monlock); } else { ast_log(LOG_WARNING, "Unable to lock the monitor\n"); Binary files asterisk/channels/chan_mgcp.o and /usr/src/asterisk/channels/chan_mgcp.o differ Binary files asterisk/channels/chan_mgcp.so and /usr/src/asterisk/channels/chan_mgcp.so differ Binary files asterisk/channels/chan_modem_aopen.o and /usr/src/asterisk/channels/chan_modem_aopen.o differ Binary files asterisk/channels/chan_modem_aopen.so and /usr/src/asterisk/channels/chan_modem_aopen.so differ Binary files asterisk/channels/chan_modem_bestdata.o and /usr/src/asterisk/channels/chan_modem_bestdata.o differ Binary files asterisk/channels/chan_modem_bestdata.so and /usr/src/asterisk/channels/chan_modem_bestdata.so differ diff -ru asterisk/channels/chan_modem.c /usr/src/asterisk/channels/chan_modem.c --- asterisk/channels/chan_modem.c 2004-03-15 02:53:02.000000000 -0500 +++ /usr/src/asterisk/channels/chan_modem.c 2003-12-27 18:46:19.000000000 -0500 @@ -83,7 +83,7 @@ /* This is the thread for the monitor which checks for input on the channels which are not currently in use. */ -static pthread_t monitor_thread = AST_PTHREADT_NULL; +static pthread_t monitor_thread = (pthread_t) -1; static int restart_monitor(void); @@ -646,7 +646,7 @@ static int restart_monitor() { /* If we're supposed to be stopped -- stay stopped */ - if (monitor_thread == AST_PTHREADT_STOP) + if (monitor_thread == (pthread_t) -2) return 0; if (ast_mutex_lock(&monlock)) { ast_log(LOG_WARNING, "Unable to lock monitor\n"); @@ -657,7 +657,7 @@ ast_log(LOG_WARNING, "Cannot kill myself\n"); return -1; } - if (monitor_thread != AST_PTHREADT_NULL) { + if (monitor_thread != (pthread_t) -1) { pthread_cancel(monitor_thread); /* Nudge it a little, as it's probably stuck in select */ pthread_kill(monitor_thread, SIGURG); @@ -861,11 +861,11 @@ return -1; } if (!ast_mutex_lock(&monlock)) { - if (monitor_thread != AST_PTHREADT_NULL && monitor_thread != AST_PTHREADT_STOP) { + if (monitor_thread != (pthread_t) -1 && monitor_thread != (pthread_t) -2) { pthread_cancel(monitor_thread); pthread_join(monitor_thread, NULL); } - monitor_thread = AST_PTHREADT_STOP; + monitor_thread = (pthread_t) -2; ast_mutex_unlock(&monlock); } else { ast_log(LOG_WARNING, "Unable to lock the monitor\n"); Binary files asterisk/channels/chan_modem_i4l.o and /usr/src/asterisk/channels/chan_modem_i4l.o differ Binary files asterisk/channels/chan_modem_i4l.so and /usr/src/asterisk/channels/chan_modem_i4l.so differ Binary files asterisk/channels/chan_modem.o and /usr/src/asterisk/channels/chan_modem.o differ Binary files asterisk/channels/chan_modem.so and /usr/src/asterisk/channels/chan_modem.so differ diff -ru asterisk/channels/chan_nbs.c /usr/src/asterisk/channels/chan_nbs.c --- asterisk/channels/chan_nbs.c 2004-03-20 16:20:40.000000000 -0500 +++ /usr/src/asterisk/channels/chan_nbs.c 2003-12-09 18:55:17.000000000 -0500 @@ -149,7 +149,7 @@ return 0; } -static struct ast_frame *nbs_xread(struct ast_channel *ast) +static struct ast_frame *nbs_read(struct ast_channel *ast) { struct nbs_pvt *p = ast->pvt->pvt; @@ -209,7 +209,7 @@ tmp->pvt->pvt = i; tmp->pvt->call = nbs_call; tmp->pvt->hangup = nbs_hangup; - tmp->pvt->read = nbs_xread; + tmp->pvt->read = nbs_read; tmp->pvt->write = nbs_xwrite; strncpy(tmp->context, context, sizeof(tmp->context)-1); strncpy(tmp->exten, "s", sizeof(tmp->exten) - 1); Binary files asterisk/channels/chan_oss.o and /usr/src/asterisk/channels/chan_oss.o differ Binary files asterisk/channels/chan_oss.so and /usr/src/asterisk/channels/chan_oss.so differ diff -ru asterisk/channels/chan_phone.c /usr/src/asterisk/channels/chan_phone.c --- asterisk/channels/chan_phone.c 2004-03-15 02:53:02.000000000 -0500 +++ /usr/src/asterisk/channels/chan_phone.c 2003-12-09 18:55:17.000000000 -0500 @@ -67,7 +67,7 @@ /* This is the thread for the monitor which checks for input on the channels which are not currently in use. */ -static pthread_t monitor_thread = AST_PTHREADT_NULL; +static pthread_t monitor_thread = -1; static int restart_monitor(void); @@ -910,7 +910,7 @@ static int restart_monitor() { /* If we're supposed to be stopped -- stay stopped */ - if (monitor_thread == AST_PTHREADT_STOP) + if (monitor_thread == -2) return 0; if (ast_mutex_lock(&monlock)) { ast_log(LOG_WARNING, "Unable to lock monitor\n"); @@ -921,7 +921,7 @@ ast_log(LOG_WARNING, "Cannot kill myself\n"); return -1; } - if (monitor_thread != AST_PTHREADT_NULL) { + if (monitor_thread != -1) { pthread_cancel(monitor_thread); #if 0 pthread_join(monitor_thread, NULL); @@ -1071,11 +1071,11 @@ return -1; } if (!ast_mutex_lock(&monlock)) { - if (monitor_thread > AST_PTHREADT_NULL) { + if (monitor_thread > -1) { pthread_cancel(monitor_thread); pthread_join(monitor_thread, NULL); } - monitor_thread = AST_PTHREADT_STOP; + monitor_thread = -2; ast_mutex_unlock(&monlock); } else { ast_log(LOG_WARNING, "Unable to lock the monitor\n"); Binary files asterisk/channels/chan_phone.o and /usr/src/asterisk/channels/chan_phone.o differ Binary files asterisk/channels/chan_phone.so and /usr/src/asterisk/channels/chan_phone.so differ diff -ru asterisk/channels/chan_sip.c /usr/src/asterisk/channels/chan_sip.c --- asterisk/channels/chan_sip.c 2004-04-01 01:35:17.000000000 -0500 +++ /usr/src/asterisk/channels/chan_sip.c 2004-03-19 11:19:17.000000000 -0500 @@ -54,8 +54,7 @@ #include #include -#ifdef SIP_MYSQL_FRIENDS -#define MYSQL_FRIENDS +#ifdef MYSQL_FRIENDS #include #endif @@ -207,6 +206,7 @@ int needdestroy; /* if we need to be destroyed */ int capability; /* Special capability */ int jointcapability; /* Supported capability at both ends */ + int prefcodec; /* Preferred codec (outbound only) */ int noncodeccapability; int outgoing; /* Outgoing or incoming call? */ int authtries; /* Times we've tried to authenticate */ @@ -253,7 +253,6 @@ char our_contact[256]; /* Our contact header */ char realm[256]; /* Authorization realm */ char nonce[256]; /* Authorization nonce */ - char opaque[256]; /* Opaque nonsense */ char domain[256]; /* Authorization nonce */ char lastmsg[256]; /* Last Message sent/received */ int amaflags; /* AMA Flags */ @@ -978,7 +977,7 @@ static int sip_codec_choose(int formats) { struct sip_codec_pref *cur; - formats &= (AST_FORMAT_MAX_AUDIO - 1); + formats &= ((AST_FORMAT_MAX_AUDIO << 1) - 1); cur = prefs; while(cur) { if (formats & cur->codec) @@ -1366,17 +1365,20 @@ return res; } -static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan) +static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, int needlock) { struct sip_pvt *p = newchan->pvt->pvt; - ast_mutex_lock(&p->lock); + if (needlock) + ast_mutex_lock(&p->lock); if (p->owner != oldchan) { ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, p->owner); - ast_mutex_unlock(&p->lock); + if (needlock) + ast_mutex_unlock(&p->lock); return -1; } p->owner = newchan; - ast_mutex_unlock(&p->lock); + if (needlock) + ast_mutex_unlock(&p->lock); return 0; } @@ -1409,7 +1411,7 @@ switch(condition) { case AST_CONTROL_RINGING: if (ast->_state == AST_STATE_RING) { - if (!p->progress) { + if (!p->progress && !p->ringing) { transmit_response(p, "180 Ringing", &p->initreq); p->ringing = 1; break; @@ -1531,6 +1533,8 @@ tmp->callerid = strdup(i->callerid); if (strlen(i->rdnis)) tmp->rdnis = strdup(i->rdnis); + if (strlen(i->exten) && strcmp(i->exten, "s")) + tmp->dnid = strdup(i->exten); tmp->priority = 1; if (strlen(i->domain)) { pbx_builtin_setvar_helper(tmp, "SIPDOMAIN", i->domain); @@ -2620,7 +2624,7 @@ char a2[1024] = ""; int x; struct sockaddr_in dest; - struct sockaddr_in vdest = { 0, }; + struct sockaddr_in vdest; /* XXX We break with the "recommendation" and send our IP, in order that our peer doesn't have to gethostbyname() us XXX */ len = 0; @@ -2670,16 +2674,34 @@ snprintf(t, sizeof(t), "t=0 0\r\n"); snprintf(m, sizeof(m), "m=audio %d RTP/AVP", ntohs(dest.sin_port)); snprintf(m2, sizeof(m2), "m=video %d RTP/AVP", ntohs(vdest.sin_port)); + if (p->jointcapability & p->prefcodec) { + if (sipdebug) + ast_verbose("Answering/Requesting with root capability %d\n", p->prefcodec); + codec = ast_rtp_lookup_code(p->rtp, 1, p->prefcodec); + if (codec > -1) { + snprintf(costr, sizeof(costr), " %d", codec); + if (p->prefcodec <= AST_FORMAT_MAX_AUDIO) { + strncat(m, costr, sizeof(m) - strlen(m)); + snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/8000\r\n", codec, ast_rtp_lookup_mime_subtype(1, p->prefcodec)); + strncat(a, costr, sizeof(a)); + } else { + strncat(m2, costr, sizeof(m2) - strlen(m2)); + snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/90000\r\n", codec, ast_rtp_lookup_mime_subtype(1, p->prefcodec)); + strncat(a2, costr, sizeof(a2)); + } + } + alreadysent |= p->prefcodec; + } /* Start by sending our preferred codecs */ cur = prefs; while(cur) { if (p->jointcapability & cur->codec) { if (sipdebug) - ast_verbose("Answering with preferred capability %d\n", cur->codec); + ast_verbose("Answering/Requesting with preferred capability %d\n", cur->codec); codec = ast_rtp_lookup_code(p->rtp, 1, cur->codec); if (codec > -1) { snprintf(costr, sizeof(costr), " %d", codec); - if (cur->codec < AST_FORMAT_MAX_AUDIO) { + if (cur->codec <= AST_FORMAT_MAX_AUDIO) { strncat(m, costr, sizeof(m) - strlen(m)); snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/8000\r\n", codec, ast_rtp_lookup_mime_subtype(1, cur->codec)); strncat(a, costr, sizeof(a)); @@ -2701,7 +2723,7 @@ codec = ast_rtp_lookup_code(p->rtp, 1, x); if (codec > -1) { snprintf(costr, sizeof(costr), " %d", codec); - if (x < AST_FORMAT_MAX_AUDIO) { + if (x <= AST_FORMAT_MAX_AUDIO) { strncat(m, costr, sizeof(m) - strlen(m)); snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/8000\r\n", codec, ast_rtp_lookup_mime_subtype(1, x)); strncat(a, costr, sizeof(a) - strlen(a)); @@ -3640,26 +3662,13 @@ ptr += sprintf(ptr, "%2.2x", digest[x]); } -static int check_auth(struct sip_pvt *p, struct sip_request *req, char *randdata, int randlen, char *username, char *secret, char *md5secret, char *method, char *uri, int reliable, int ignore) +static int check_auth(struct sip_pvt *p, struct sip_request *req, char *randdata, int randlen, char *username, char *secret, char *md5secret, char *method, char *uri, int reliable) { int res = -1; /* Always OK if no secret */ if (!strlen(secret) && !strlen(md5secret)) return 0; - if (ignore) { - /* This is a retransmitted invite/register/etc, don't reconstruct authentication - information */ - if (strlen(randdata)) { - if (!reliable) { - /* Resend message if this was NOT a reliable delivery. Otherwise the - retransmission should get it */ - transmit_response_with_auth(p, "407 Proxy Authentication Required", req, randdata, reliable); - /* Schedule auto destroy in 15 seconds */ - sip_scheddestroy(p, 15000); - } - res = 1; - } - } else if (!strlen(randdata) || !strlen(get_header(req, "Proxy-Authorization"))) { + if (!strlen(randdata) || !strlen(get_header(req, "Proxy-Authorization"))) { snprintf(randdata, randlen, "%08x", rand()); transmit_response_with_auth(p, "407 Proxy Authentication Required", req, randdata, reliable); /* Schedule auto destroy in 15 seconds */ @@ -3673,7 +3682,7 @@ char a1_hash[256]; char a2_hash[256]; char resp[256]; - char resp_hash[256]=""; + char resp_hash[256]; char tmp[256] = ""; char *c; char *z; @@ -3760,7 +3769,7 @@ return 0; } -static int register_verify(struct sip_pvt *p, struct sockaddr_in *sin, struct sip_request *req, char *uri, int ignore) +static int register_verify(struct sip_pvt *p, struct sockaddr_in *sin, struct sip_request *req, char *uri) { int res = -1; struct sip_peer *peer; @@ -3809,16 +3818,16 @@ } else { p->nat = peer->nat; transmit_response(p, "100 Trying", req); - if (!(res = check_auth(p, req, p->randdata, sizeof(p->randdata), peer->name, peer->secret, peer->md5secret, "REGISTER", uri, 0, ignore))) { + if (!(res = check_auth(p, req, p->randdata, sizeof(p->randdata), peer->name, peer->secret, peer->md5secret, "REGISTER", uri, 0))) { sip_cancel_destroy(p); if (parse_contact(p, peer, req)) { ast_log(LOG_WARNING, "Failed to parse contact info\n"); } else { #ifdef MYSQL_FRIENDS - if (peer->temponly) - mysql_update_peer(peer->name, &peer->addr, peer->username, p->expiry); -#endif - /* Say OK and ask subsystem to retransmit msg counter */ + if (peer->temponly) + mysql_update_peer(peer->name, &peer->addr, peer->username, p->expiry); +#endif + /* Say OK and ask subsystem to retransmit msg counter */ transmit_response_with_date(p, "200 OK", req); peer->lastmsgssent = -1; res = 0; @@ -3837,7 +3846,7 @@ if (parse_contact(p, peer, req)) { ast_log(LOG_WARNING, "Failed to parse contact info\n"); } else { - /* Say OK and ask subsystem to retransmit msg counter */ + /* Say OK and ask subsystem to retransmit msg counter */ transmit_response_with_date(p, "200 OK", req); peer->lastmsgssent = -1; res = 0; @@ -4182,7 +4191,7 @@ } return output; } -static int check_user(struct sip_pvt *p, struct sip_request *req, char *cmd, char *uri, int reliable, struct sockaddr_in *sin, int ignore) +static int check_user(struct sip_pvt *p, struct sip_request *req, char *cmd, char *uri, int reliable, struct sockaddr_in *sin) { struct sip_user *user; struct sip_peer *peer; @@ -4239,7 +4248,7 @@ ast_log(LOG_DEBUG, "Setting NAT on VRTP to %d\n", p->nat); ast_rtp_setnat(p->vrtp, p->nat); } - if (!(res = check_auth(p, req, p->randdata, sizeof(p->randdata), user->name, user->secret, user->md5secret, cmd, uri, reliable, ignore))) { + if (!(res = check_auth(p, req, p->randdata, sizeof(p->randdata), user->name, user->secret, user->md5secret, cmd, uri, reliable))) { sip_cancel_destroy(p); if (strlen(user->context)) strncpy(p->context, user->context, sizeof(p->context) - 1); @@ -4655,7 +4664,7 @@ static int reply_digest(struct sip_pvt *p, struct sip_request *req, char *header, char *respheader, char *digest, int digest_len); static int do_register_auth(struct sip_pvt *p, struct sip_request *req, char *header, char *respheader) { - char digest[1024]; + char digest[256]; p->authtries++; memset(digest,0,sizeof(digest)); if (reply_digest(p,req, header, "REGISTER", digest, sizeof(digest))) { @@ -4666,7 +4675,7 @@ } static int do_proxy_auth(struct sip_pvt *p, struct sip_request *req, char *header, char *respheader, char *msg, int init) { - char digest[1024]; + char digest[256]; p->authtries++; memset(digest,0,sizeof(digest)); if (reply_digest(p,req, "Proxy-Authenticate", msg, digest, sizeof(digest) )) { @@ -4678,11 +4687,10 @@ static int reply_digest(struct sip_pvt *p, struct sip_request *req, char *header, char *orig_header, char *digest, int digest_len) { - char tmp[512] = ""; + char tmp[256] = ""; char *realm = ""; char *nonce = ""; char *domain = ""; - char *opaque = ""; char *c; @@ -4717,17 +4725,6 @@ if ((c = strchr(c,','))) *c = '\0'; } - } else if (!strncasecmp(c, "opaque=", strlen("opaque="))) { - c+=strlen("opaque="); - if ((*c == '\"')) { - opaque=++c; - if ((c = strchr(c,'\"'))) - *c = '\0'; - } else { - opaque = c; - if ((c = strchr(c,','))) - *c = '\0'; - } } else if (!strncasecmp(c, "domain=", strlen("domain="))) { c+=strlen("domain="); if ((*c == '\"')) { @@ -4751,7 +4748,6 @@ strncpy(p->realm, realm, sizeof(p->realm)-1); strncpy(p->nonce, nonce, sizeof(p->nonce)-1); strncpy(p->domain, domain, sizeof(p->domain)-1); - strncpy(p->opaque, opaque, sizeof(p->opaque)-1); build_reply_digest(p, orig_header, digest, digest_len); return 0; } @@ -4783,7 +4779,7 @@ snprintf(resp,sizeof(resp),"%s:%s:%s",a1_hash,p->nonce,a2_hash); md5_hash(resp_hash,resp); - snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=\"MD5\", uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\"",p->peername,p->realm,uri,p->nonce,resp_hash, p->opaque); + snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=\"MD5\", uri=\"%s\", nonce=\"%s\", response=\"%s\"",p->peername,p->realm,uri,p->nonce,resp_hash); return 0; } @@ -5331,7 +5327,7 @@ ast_verbose("Ignoring this request\n"); if (!p->lastinvite) { /* Handle authentication if this is our first invite */ - res = check_user(p, req, cmd, e, 1, sin, ignore); + res = check_user(p, req, cmd, e, 1, sin); if (res) { if (res < 0) { ast_log(LOG_NOTICE, "Failed to authenticate user %s\n", get_header(req, "From")); @@ -5557,7 +5553,7 @@ if (!p->lastinvite) { /* Handle authentication if this is our first subscribe */ - res = check_user(p, req, cmd, e, 0, sin, ignore); + res = check_user(p, req, cmd, e, 0, sin); if (res) { if (res < 0) { ast_log(LOG_NOTICE, "Failed to authenticate user %s for SUBSCRIBE\n", get_header(req, "From")); @@ -5619,7 +5615,7 @@ ast_verbose("Using latest request as basis request\n"); copy_request(&p->initreq, req); check_via(p, req); - if ((res = register_verify(p, sin, req, e, ignore)) < 0) + if ((res = register_verify(p, sin, req, e)) < 0) ast_log(LOG_NOTICE, "Registration from '%s' failed for '%s'\n", get_header(req, "To"), inet_ntoa(sin->sin_addr)); if (res < 1) { p->needdestroy = 1; @@ -5995,7 +5991,7 @@ char *dest = data; oldformat = format; - format &= capability; + format &= ((AST_FORMAT_MAX_AUDIO << 1) - 1); if (!format) { ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format %s while capability is %s\n", ast_getformatname(oldformat), ast_getformatname(capability)); return NULL; @@ -6044,6 +6040,7 @@ #if 0 printf("Setting up to call extension '%s' at '%s'\n", ext ? ext : "", host); #endif + p->prefcodec = format; tmpc = sip_new(p, AST_STATE_DOWN, host); if (!tmpc) sip_destroy(p); @@ -6828,7 +6825,7 @@ res = reload_config(); if (!res) { /* Make sure we can register our sip channel type */ - if (ast_channel_register_ex(type, tdesc, capability, sip_request, sip_devicestate)) { + if (ast_channel_register_ex(type, tdesc, ((AST_FORMAT_MAX_AUDIO << 1) - 1), sip_request, sip_devicestate)) { ast_log(LOG_ERROR, "Unable to register channel class %s\n", type); return -1; } Only in /usr/src/asterisk/channels: chan_sip.c.bak Binary files asterisk/channels/chan_sip.o and /usr/src/asterisk/channels/chan_sip.o differ Binary files asterisk/channels/chan_sip.so and /usr/src/asterisk/channels/chan_sip.so differ diff -ru asterisk/channels/chan_skinny.c /usr/src/asterisk/channels/chan_skinny.c --- asterisk/channels/chan_skinny.c 2004-03-15 04:14:36.000000000 -0500 +++ /usr/src/asterisk/channels/chan_skinny.c 2004-02-02 01:38:08.000000000 -0500 @@ -599,7 +599,7 @@ /* This is the thread for the monitor which checks for input on the channels which are not currently in use. */ -static pthread_t monitor_thread = AST_PTHREADT_NULL; +static pthread_t monitor_thread = 0; /* Wait up to 16 seconds for first digit */ static int firstdigittimeout = 16000; @@ -2425,7 +2425,7 @@ { /* If we're supposed to be stopped -- stay stopped */ - if (monitor_thread == AST_PTHREADT_STOP) + if (monitor_thread == (pthread_t)-2) return 0; if (ast_mutex_lock(&monlock)) { ast_log(LOG_WARNING, "Unable to lock monitor\n"); @@ -2436,7 +2436,7 @@ ast_log(LOG_WARNING, "Cannot kill myself\n"); return -1; } - if (monitor_thread != AST_PTHREADT_NULL) { + if (monitor_thread) { /* Wake up the thread */ pthread_kill(monitor_thread, SIGURG); } else { @@ -2740,12 +2740,12 @@ return -1; } if (!ast_mutex_lock(&monlock)) { - if (monitor_thread && (monitor_thread != AST_PTHREADT_STOP)) { + if (monitor_thread && (monitor_thread != -2)) { pthread_cancel(monitor_thread); pthread_kill(monitor_thread, SIGURG); pthread_join(monitor_thread, NULL); } - monitor_thread = AST_PTHREADT_STOP; + monitor_thread = -2; ast_mutex_unlock(&monlock); } else { ast_log(LOG_WARNING, "Unable to lock the monitor\n"); Binary files asterisk/channels/chan_skinny.o and /usr/src/asterisk/channels/chan_skinny.o differ Binary files asterisk/channels/chan_skinny.so and /usr/src/asterisk/channels/chan_skinny.so differ diff -ru asterisk/channels/chan_vofr.c /usr/src/asterisk/channels/chan_vofr.c --- asterisk/channels/chan_vofr.c 2004-03-15 04:14:36.000000000 -0500 +++ /usr/src/asterisk/channels/chan_vofr.c 2003-12-09 18:55:17.000000000 -0500 @@ -64,7 +64,7 @@ /* This is the thread for the monitor which checks for input on the channels which are not currently in use. */ -static pthread_t monitor_thread = AST_PTHREADT_NULL; +static pthread_t monitor_thread = 0; static int restart_monitor(void); @@ -997,7 +997,7 @@ static int restart_monitor(void) { /* If we're supposed to be stopped -- stay stopped */ - if (monitor_thread == AST_PTHREADT_STOP) + if (monitor_thread == -2) return 0; if (ast_mutex_lock(&monlock)) { ast_log(LOG_WARNING, "Unable to lock monitor\n"); @@ -1008,7 +1008,7 @@ ast_log(LOG_WARNING, "Cannot kill myself\n"); return -1; } - if (monitor_thread != AST_PTHREADT_NULL) { + if (monitor_thread) { /* Wake up the thread */ pthread_kill(monitor_thread, SIGURG); } else { @@ -1161,7 +1161,7 @@ pthread_kill(monitor_thread, SIGURG); pthread_join(monitor_thread, NULL); } - monitor_thread = AST_PTHREADT_STOP; + monitor_thread = -2; ast_mutex_unlock(&monlock); } else { ast_log(LOG_WARNING, "Unable to lock the monitor\n"); diff -ru asterisk/channels/chan_zap.c /usr/src/asterisk/channels/chan_zap.c --- asterisk/channels/chan_zap.c 2004-03-22 17:49:23.000000000 -0500 +++ /usr/src/asterisk/channels/chan_zap.c 2004-02-23 09:58:51.000000000 -0500 @@ -225,7 +225,7 @@ /* This is the thread for the monitor which checks for input on the channels which are not currently in use. */ -static pthread_t monitor_thread = AST_PTHREADT_NULL; +static pthread_t monitor_thread = 0; static int restart_monitor(void); @@ -388,7 +388,6 @@ struct zt_pvt *prev; /* Prev channel in list */ struct zt_distRings drings; - int usedistinctiveringdetection; char context[AST_MAX_EXTENSION]; char defcontext[AST_MAX_EXTENSION]; @@ -1711,8 +1710,7 @@ } if (p->dsp) ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_DTMF | p->dtmfrelax); - if (p->exten) - strcpy(p->exten, ""); + ast_log(LOG_DEBUG, "Hangup: channel: %d index = %d, normal = %d, callwait = %d, thirdcall = %d\n", p->channel, index, p->subs[SUB_REAL].zfd, p->subs[SUB_CALLWAIT].zfd, p->subs[SUB_THREEWAY].zfd); @@ -2314,11 +2312,8 @@ oi2 = zt_get_index(c1, p1, 0); oc1 = p0->owner; oc2 = p1->owner; - if ((oi1 < 0) || (oi2 < 0)) { - ast_mutex_unlock(&c0->lock); - ast_mutex_unlock(&c1->lock); + if ((oi1 < 0) || (oi2 < 0)) return -1; - } @@ -3005,6 +3000,7 @@ if (res < 0) { ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d\n", p->channel); p->dop.dialstr[0] = '\0'; + return NULL; } else { ast_log(LOG_DEBUG, "Sent FXO deferred digit string: %s\n", p->dop.dialstr); p->subs[index].f.frametype = AST_FRAME_NULL; @@ -3129,7 +3125,7 @@ } else if (!p->subs[SUB_THREEWAY].owner) { char callerid[256]; if (p->threewaycalling && !check_for_conference(p)) { - if (p->zaptrcallerid && p->owner && p->owner->callerid) + if (p->zaptrcallerid && p->owner) strncpy(callerid, p->owner->callerid, sizeof(callerid) - 1); /* XXX This section needs much more error checking!!! XXX */ /* Start a 3-way call if feasible */ @@ -4660,7 +4656,7 @@ break; } } - if (p->usedistinctiveringdetection == 1) { + if (usedistinctiveringdetection == 1) { if(option_verbose > 2) /* this only shows up if you have n of the dring patterns filled in */ ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]); @@ -5159,7 +5155,7 @@ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); /* If we're supposed to be stopped -- stay stopped */ - if (monitor_thread == AST_PTHREADT_STOP) + if (monitor_thread == -2) return 0; if (ast_mutex_lock(&monlock)) { ast_log(LOG_WARNING, "Unable to lock monitor\n"); @@ -5170,7 +5166,7 @@ ast_log(LOG_WARNING, "Cannot kill myself\n"); return -1; } - if (monitor_thread != AST_PTHREADT_NULL) { + if (monitor_thread) { /* Just signal it to be sure it wakes up */ #if 0 pthread_cancel(monitor_thread); @@ -5515,7 +5511,6 @@ /* Flag to destroy the channel must be cleared on new mkif. Part of changes for reload to work */ tmp->destroy = 0; tmp->drings = drings; - tmp->usedistinctiveringdetection = usedistinctiveringdetection; tmp->callwaitingcallerid = callwaitingcallerid; tmp->threewaycalling = threewaycalling; tmp->adsi = adsi; @@ -6423,7 +6418,7 @@ if ((chan >= 1) && (chan <= pri->channels)) if (pri->pvt[chan] && pri->overlapdial && !pri->pvt[chan]->proceeding) { struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, }; - ast_log(LOG_DEBUG, "Queuing frame from PRI_EVENT_PROCEEDING on channel %d span %d\n",chan,pri->pvt[chan]->span); + ast_log(LOG_DEBUG, "queling frame from PRI_EVENT_PROCEEDING on channel %d span %d\n",chan,pri->pvt[chan]->span); ast_queue_frame(pri->pvt[chan]->owner, &f, 0); pri->pvt[chan]->proceeding=1; @@ -6502,9 +6497,9 @@ if (!pri->pvt[chan]->alreadyhungup) { /* we're calling here zt_hangup so once we get there we need to clear p->call after calling pri_hangup */ pri->pvt[chan]->alreadyhungup = 1; + pri->pvt[chan]->owner->hangupcause = hangup_pri2cause(e->hangup.cause); /* Queue a BUSY instead of a hangup if our cause is appropriate */ if (pri->pvt[chan]->owner) { - pri->pvt[chan]->owner->hangupcause = hangup_pri2cause(e->hangup.cause); switch(e->hangup.cause) { case PRI_CAUSE_USER_BUSY: pri->pvt[chan]->subs[SUB_REAL].needbusy =1; @@ -6717,7 +6712,7 @@ if (p.sigtype != ZT_SIG_HDLCFCS) { close(pri->fd); pri->fd = -1; - ast_log(LOG_ERROR, "D-channel %d is not in HDLC/FCS mode. See /etc/zaptel.conf\n", x); + ast_log(LOG_ERROR, "D-channel %d is not in HDLC/FCS mode. See /etc/tormenta.conf\n", x); return -1; } bi.txbufpolicy = ZT_POLICY_IMMEDIATE; @@ -6755,7 +6750,7 @@ int span=1; char tmp[50]; while(span <= NUM_SPANS) { - if (span > state && pris[span-1].pri) + if (span > state) break; span++; } @@ -7232,12 +7227,12 @@ return -1; } if (!ast_mutex_lock(&monlock)) { - if (monitor_thread && (monitor_thread != AST_PTHREADT_STOP)) { + if (monitor_thread && (monitor_thread != -2)) { pthread_cancel(monitor_thread); pthread_kill(monitor_thread, SIGURG); pthread_join(monitor_thread, NULL); } - monitor_thread = AST_PTHREADT_STOP; + monitor_thread = -2; ast_mutex_unlock(&monlock); } else { ast_log(LOG_WARNING, "Unable to lock the monitor\n"); @@ -7362,8 +7357,7 @@ chan = strsep(&c, ","); } } else if (!strcasecmp(v->name, "usedistinctiveringdetection")) { - if (ast_true(v->value)) - usedistinctiveringdetection = 1; + if (!strcasecmp(v->value, "yes")) usedistinctiveringdetection = 1; } else if (!strcasecmp(v->name, "dring1context")) { strncpy(drings.ringContext[0].contextData,v->value,sizeof(drings.ringContext[0].contextData)-1); } else if (!strcasecmp(v->name, "dring2context")) { @@ -7846,8 +7840,7 @@ chan = strsep(&stringp, ","); } } else if (!strcasecmp(v->name, "usedistinctiveringdetection")) { - if (ast_true(v->value)) - usedistinctiveringdetection = 1; + if (!strcasecmp(v->value, "yes")) usedistinctiveringdetection = 1; } else if (!strcasecmp(v->name, "dring1context")) { strncpy(drings.ringContext[0].contextData,v->value,sizeof(drings.ringContext[0].contextData)-1); } else if (!strcasecmp(v->name, "dring2context")) { Binary files asterisk/channels/chan_zap.o and /usr/src/asterisk/channels/chan_zap.o differ Binary files asterisk/channels/chan_zap.so and /usr/src/asterisk/channels/chan_zap.so differ diff -ru asterisk/channels/CVS/Entries /usr/src/asterisk/channels/CVS/Entries --- asterisk/channels/CVS/Entries 2004-04-13 10:27:20.000000000 -0400 +++ /usr/src/asterisk/channels/CVS/Entries 2004-02-25 14:32:02.000000000 -0500 @@ -1,33 +1,33 @@ /.cvsignore/1.2/Thu May 8 03:46:43 2003//Tv1-0_stable /DialTone.h/1.2/Sat Dec 11 20:09:44 1999//Tv1-0_stable -/Makefile/1.37.2.6/Thu Mar 25 19:43:36 2004//Tv1-0_stable +/Makefile/1.37/Fri Jan 23 20:57:48 2004//Tv1-0_stable /adtranvofr.h/1.3/Fri Jun 21 01:40:13 2002//Tv1-0_stable /alaw.h/1.2/Sun Apr 27 21:34:27 2003//Tv1-0_stable /answer.h/1.1/Thu May 3 03:54:19 2001//Tv1-0_stable /chan_agent.c/1.61.2.1/Thu Feb 12 22:29:02 2004//Tv1-0_stable -/chan_alsa.c/1.11.2.2/Thu Mar 25 16:50:26 2004//Tv1-0_stable -/chan_h323.c/1.31.2.2/Mon Mar 15 09:14:36 2004//Tv1-0_stable -/chan_iax.c/1.49.2.2/Sun Mar 21 11:23:25 2004//Tv1-0_stable -/chan_iax2.c/1.91.2.11/Wed Mar 24 21:24:33 2004//Tv1-0_stable +/chan_alsa.c/1.11/Wed Jan 28 21:06:03 2004//Tv1-0_stable +/chan_h323.c/1.31/Tue Jan 13 09:24:26 2004//Tv1-0_stable +/chan_iax.c/1.49/Mon Feb 2 06:38:08 2004//Tv1-0_stable +/chan_iax2.c/1.91.2.5/Wed Feb 18 16:05:23 2004//Tv1-0_stable /chan_local.c/1.22/Wed Jan 28 21:06:03 2004//Tv1-0_stable -/chan_mgcp.c/1.34.2.2/Mon Mar 15 09:14:36 2004//Tv1-0_stable -/chan_modem.c/1.19.2.1/Mon Mar 15 07:53:02 2004//Tv1-0_stable +/chan_mgcp.c/1.34/Mon Feb 2 06:38:08 2004//Tv1-0_stable +/chan_modem.c/1.19/Sat Dec 27 23:46:19 2003//Tv1-0_stable /chan_modem_aopen.c/1.11/Wed Aug 13 15:25:16 2003//Tv1-0_stable /chan_modem_bestdata.c/1.9/Wed Aug 13 15:25:16 2003//Tv1-0_stable /chan_modem_i4l.c/1.12/Wed Aug 13 15:25:16 2003//Tv1-0_stable -/chan_nbs.c/1.4.2.1/Sat Mar 20 21:20:40 2004//Tv1-0_stable +/chan_nbs.c/1.4/Tue Dec 9 23:55:17 2003//Tv1-0_stable /chan_oss.c/1.21/Wed Oct 22 03:10:34 2003//Tv1-0_stable -/chan_phone.c/1.22.2.1/Mon Mar 15 07:53:02 2004//Tv1-0_stable -/chan_sip.c/1.292.2.26/Thu Apr 1 06:35:17 2004//Tv1-0_stable -/chan_skinny.c/1.27.2.2/Mon Mar 15 09:14:36 2004//Tv1-0_stable -/chan_vofr.c/1.12.2.2/Mon Mar 15 09:14:36 2004//Tv1-0_stable +/chan_phone.c/1.22/Tue Dec 9 23:55:17 2003//Tv1-0_stable +/chan_sip.c/1.292.2.10/Wed Feb 25 01:15:05 2004//Tv1-0_stable +/chan_skinny.c/1.27/Mon Feb 2 06:38:08 2004//Tv1-0_stable +/chan_vofr.c/1.12/Tue Dec 9 23:55:17 2003//Tv1-0_stable /chan_vpb.c/1.12/Tue Dec 9 23:55:17 2003//Tv1-0_stable -/chan_zap.c/1.171.2.18/Mon Mar 22 22:49:23 2004//Tv1-0_stable +/chan_zap.c/1.171.2.6/Mon Feb 23 14:58:51 2004//Tv1-0_stable /chan_zap_old.c/1.6/Mon Sep 29 20:13:54 2003//Tv1-0_stable /gentone-ulaw.c/1.1/Sat Nov 10 20:31:39 2001//Tv1-0_stable /gentone.c/1.3/Wed Jan 28 21:06:03 2004//Tv1-0_stable /iax.h/1.6/Sun Nov 10 18:47:26 2002//Tv1-0_stable -/iax2-parser.c/1.14.2.1/Thu Mar 18 06:03:24 2004//Tv1-0_stable +/iax2-parser.c/1.14/Wed Oct 22 02:53:39 2003//Tv1-0_stable /iax2-parser.h/1.6/Wed Oct 1 22:59:06 2003//Tv1-0_stable /iax2.h/1.13/Wed Oct 1 22:59:06 2003//Tv1-0_stable /ixjuser.h/1.16/Wed Feb 12 13:59:14 2003//Tv1-0_stable diff -ru asterisk/channels/.depend /usr/src/asterisk/channels/.depend --- asterisk/channels/.depend 2004-04-13 10:32:48.000000000 -0400 +++ /usr/src/asterisk/channels/.depend 2004-03-19 11:21:51.000000000 -0500 @@ -119,8 +119,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/channel.h ../include/asterisk/sched.h \ ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ @@ -183,8 +183,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/channel.h ../include/asterisk/sched.h \ ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ Only in /usr/src/asterisk/channels/h323: ast_h323[1].cpp.diff Only in /usr/src/asterisk/channels/h323: ast_h323[1].h.diff diff -ru asterisk/channels/h323/ast_h323.cpp /usr/src/asterisk/channels/h323/ast_h323.cpp --- asterisk/channels/h323/ast_h323.cpp 2004-01-13 03:31:13.000000000 -0500 +++ /usr/src/asterisk/channels/h323/ast_h323.cpp 2004-03-18 10:29:12.000000000 -0500 @@ -219,7 +219,7 @@ * port = 1720. */ int MyH323EndPoint::MakeCall(const PString & dest, PString & token, - unsigned int *callReference, unsigned int port, char *callerid) + unsigned int *callReference, unsigned int port, char *callerid, char *callername) { PString fullAddress; MyH323Connection * connection; @@ -243,8 +243,15 @@ *callReference = connection->GetCallReference(); - if (callerid) - connection->SetLocalPartyName(PString(callerid)); + if (callername) { + localAliasNames.RemoveAll(); + connection->SetLocalPartyName(PString(callername)); + if (callerid) + localAliasNames.AppendString(PString(callerid)); + } else if (callerid) { + localAliasNames.RemoveAll(); + connection->SetLocalPartyName(PString(callerid)); + } connection->Unlock(); @@ -447,6 +454,8 @@ if (noH245Tunnelling) options |= H323Connection::H245TunnelingOptionDisable; + SetAudioJitterDelay(10, 50); + return new MyH323Connection(*this, callReference, options); } @@ -478,7 +487,7 @@ { /* The call will be answered later with "AnsweringCall()" function. */ - return H323Connection::AnswerCallAlertWithMedia; + return H323Connection::AnswerCallDeferred; } BOOL MyH323Connection::OnAlerting(const H323SignalPDU & /*alertingPDU*/, const PString & username) @@ -487,6 +496,7 @@ if (h323debug) { cout << " -- Ringing phone for \"" << username << "\"" << endl; } + on_chan_ringing(GetCallReference()); return TRUE; } @@ -499,6 +509,7 @@ call_details_t cd; PString sourceE164; + PString sourceName; PString destE164; PString sourceAliases; PString destAliases; @@ -511,6 +522,8 @@ sourceE164 = ""; setupPDU.GetSourceE164(sourceE164); + sourceName = ""; + sourceName=setupPDU.GetQ931().GetDisplayName(); destE164 = ""; setupPDU.GetDestinationE164(destE164); @@ -538,6 +551,7 @@ cd.call_source_e164 = (const char *)sourceE164; cd.call_dest_e164 = (const char *)destE164; cd.sourceIp = (const char *)sourceIp; + cd.call_source_name = (const char *)sourceName; /* Notify Asterisk of the request */ int res = on_incoming_call(cd); @@ -683,7 +697,7 @@ cout << " -- SessionID: " << sessionID << endl; cout << " -- Direction: " << dir << endl; } - return new H323_ExternalRTPChannel(*this, capability, dir, sessionID, externalIpAddress, externalPort); + return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID, externalIpAddress, externalPort); } /** This callback function is invoked once upon creation of each @@ -717,6 +731,49 @@ } +MyH323_ExternalRTPChannel::MyH323_ExternalRTPChannel(MyH323Connection & connection, + const H323Capability & capability, + Directions direction, + unsigned id) +: +H323_ExternalRTPChannel::H323_ExternalRTPChannel(connection, capability, direction, id) +{ +} + +MyH323_ExternalRTPChannel::MyH323_ExternalRTPChannel(MyH323Connection & connection, const H323Capability & capability, + Directions direction, + unsigned id, + const H323TransportAddress & data, + const H323TransportAddress & control) : H323_ExternalRTPChannel::H323_ExternalRTPChannel(connection, capability, direction, id, data, control) +{ +} + +MyH323_ExternalRTPChannel::MyH323_ExternalRTPChannel(MyH323Connection & connection, + const H323Capability & capability, + Directions direction, + unsigned id, + const PIPSocket::Address & ip, + WORD dataPort) + : H323_ExternalRTPChannel::H323_ExternalRTPChannel(connection, capability, direction, id, ip, dataPort) +{ +} + +BOOL MyH323_ExternalRTPChannel::OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters & param) +{ + H323_ExternalRTPChannel::OnReceivedAckPDU(param); + + H323_ExternalRTPChannel::GetRemoteAddress(remoteIpAddress, remotePort); + + if (h323debug) { + cout << " -- remoteIpAddress: " << remoteIpAddress << endl; + cout << " -- remotePort: " << remotePort << endl; + } + /* Notify Asterisk of remote RTP information */ + on_start_logical_channel(connection.GetCallReference(), (const char *)remoteIpAddress.AsString(), remotePort); + + return TRUE; +} + /** IMPLEMENTATION OF C FUNCTIONS */ /** @@ -772,6 +829,7 @@ on_connection_cb confunc, start_logchan_cb lfunc, clear_con_cb clfunc, + chan_ringing_cb rfunc, con_established_cb efunc, send_digit_cb dfunc) { @@ -780,6 +838,7 @@ on_create_connection = confunc; on_start_logical_channel = lfunc; on_connection_cleared = clfunc; + on_chan_ringing = rfunc; on_connection_established = efunc; on_send_digit = dfunc; } @@ -1011,7 +1070,7 @@ PString dest(host); - res = endPoint->MakeCall(dest, token, &cd->call_reference, call_options.port, call_options.callerid); + res = endPoint->MakeCall(dest, token, &cd->call_reference, call_options.port, call_options.callerid, call_options.callername); memcpy((char *)(cd->call_token), (const unsigned char *)token, token.GetLength()); return res; @@ -1027,6 +1086,47 @@ return 0; }; +/* Send Alerting PDU to H.323 caller */ + +int h323_send_alerting(const char *token) +{ + const PString currentToken(token); + H323Connection * connection; + + connection = endPoint->FindConnectionWithLock(currentToken); + + if (connection == NULL) { + cout << "No connection found for " << token << endl; + return -1; + } + + connection->AnsweringCall(H323Connection::AnswerCallPending); + connection->Unlock(); + + return 0; + +} + +/* Send Progress PDU to H.323 caller */ + +int h323_send_progress(const char *token) +{ + const PString currentToken(token); + H323Connection * connection; + + connection = endPoint->FindConnectionWithLock(currentToken); + + if (connection == NULL) { + cout << "No connection found for " << token << endl; + return -1; + } + + connection->AnsweringCall(H323Connection::AnswerCallDeferredWithMedia); + connection->Unlock(); + + return 0; +} + /** This function tells the h.323 stack to either answer or deny an incoming call */ int h323_answering_call(const char *token, int busy) diff -ru asterisk/channels/h323/ast_h323.h /usr/src/asterisk/channels/h323/ast_h323.h --- asterisk/channels/h323/ast_h323.h 2004-01-12 22:06:06.000000000 -0500 +++ /usr/src/asterisk/channels/h323/ast_h323.h 2004-03-18 10:29:18.000000000 -0500 @@ -198,7 +198,7 @@ public: - int MakeCall(const PString &, PString &, unsigned int *, unsigned int, char *); + int MakeCall(const PString &, PString &, unsigned int *, unsigned int, char *, char *); BOOL ClearCall(const PString &); void OnClosedLogicalChannel(H323Connection &, const H323Channel &); @@ -253,6 +253,45 @@ BOOL bridging; // Used to help determine which IP to use }; +class MyH323_ExternalRTPChannel : public H323_ExternalRTPChannel { + + PCLASSINFO(MyH323_ExternalRTPChannel, H323_ExternalRTPChannel); + + public: + MyH323_ExternalRTPChannel( + MyH323Connection & connection, /// Connection to endpoint for channel + const H323Capability & capability, /// Capability channel is using + Directions direction, /// Direction of channel + unsigned sessionID /// Session ID for channel + ); + MyH323_ExternalRTPChannel( + MyH323Connection & connection, /// Connection to endpoint for channel + const H323Capability & capability, /// Capability channel is using + Directions direction, /// Direction of channel + unsigned sessionID, /// Session ID for channel + const H323TransportAddress & data, /// Data address + const H323TransportAddress & control/// Control address + ); + /**Create a new channel. + */ + MyH323_ExternalRTPChannel( + MyH323Connection & connection, /// Connection to endpoint for channel + const H323Capability & capability, /// Capability channel is using + Directions direction, /// Direction of channel + unsigned sessionID, /// Session ID for channel + const PIPSocket::Address & ip, /// IP address of media server + WORD dataPort /// Data port (control is dataPort+1) + ); + + BOOL OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters & param); + + PIPSocket::Address externalIpAddress; // IP address of media server + PIPSocket::Address remoteIpAddress; // IP Address of remote + WORD externalPort; // local media s + WORD remotePort; + +}; + /** * The MyProcess is a necessary descendant PProcess class so that the H323EndPoint * objected to be created from within that class. (Who owns main() problem). Only in /usr/src/asterisk/channels/h323: ast_h323.o Only in /usr/src/asterisk/channels/h323: bacl diff -ru asterisk/channels/h323/chan_h323.h /usr/src/asterisk/channels/h323/chan_h323.h --- asterisk/channels/h323/chan_h323.h 2004-01-13 03:46:46.000000000 -0500 +++ /usr/src/asterisk/channels/h323/chan_h323.h 2004-03-18 10:29:49.000000000 -0500 @@ -84,6 +84,7 @@ function*/ typedef struct call_options { char *callerid; + char *callername; int noFastStart; int noH245Tunnelling; int noSilenceSuppression; @@ -101,6 +102,7 @@ const char *call_dest_alias; const char *call_source_e164; const char *call_dest_e164; + const char *call_source_name; const char *sourceIp; } call_details_t; @@ -134,6 +136,11 @@ typedef void (*start_logchan_cb)(unsigned int, const char *, int); start_logchan_cb on_start_logical_channel; +/* This is a callback prototype function, called when openh323 + OnAlerting is invoked */ +typedef void (*chan_ringing_cb)(unsigned); +chan_ringing_cb on_chan_ringing; + /* This is a callback protoype function, called when the openh323 OnConnectionEstablished is inovked */ typedef void (*con_established_cb)(unsigned); @@ -167,6 +174,7 @@ on_connection_cb, start_logchan_cb, clear_con_cb, + chan_ringing_cb, con_established_cb, send_digit_cb); @@ -189,6 +197,8 @@ /* H323 create and destroy sessions */ int h323_make_call(char *host, call_details_t *cd, call_options_t); int h323_clear_call(const char *); + int h323_send_alerting(const char *token); + int h323_send_progress(const char *token); int h323_answering_call(const char *token, int); int h323_soft_hangup(const char *data); Only in /usr/src/asterisk/channels/h323: libchanh323.a Only in /usr/src/asterisk/channels/h323: patch.ast_h323.cpp Only in /usr/src/asterisk/channels/h323: patch.ast_h323.h Only in /usr/src/asterisk/channels/h323: patch.chan_h323.c Only in /usr/src/asterisk/channels/h323: patch.chan_h323.h diff -ru asterisk/channels/iax2-parser.c /usr/src/asterisk/channels/iax2-parser.c --- asterisk/channels/iax2-parser.c 2004-03-18 01:03:24.000000000 -0500 +++ /usr/src/asterisk/channels/iax2-parser.c 2003-10-21 22:53:39.000000000 -0400 @@ -64,7 +64,7 @@ static void dump_int(char *output, int maxlen, void *value, int len) { if (len == sizeof(unsigned int)) - snprintf(output, maxlen, "%lu", (unsigned long)ntohl(*((unsigned int *)value))); + snprintf(output, maxlen, "%ld", (long)ntohl(*((unsigned int *)value))); else snprintf(output, maxlen, "Invalid INT"); } @@ -287,8 +287,8 @@ retries, fh->oseqno, fh->iseqno, class, subclass); outputf(tmp); snprintf(tmp, sizeof(tmp), -" Timestamp: %05lums SCall: %5.5d DCall: %5.5d [%s:%d]\n", - (unsigned long)ntohl(fh->ts), +" Timestamp: %05ldms SCall: %5.5d DCall: %5.5d [%s:%d]\n", + (long)ntohl(fh->ts), ntohs(fh->scallno) & ~IAX_FLAG_FULL, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS, inet_ntoa(sin->sin_addr), ntohs(sin->sin_port)); outputf(tmp); Binary files asterisk/channels/iax2-parser.o and /usr/src/asterisk/channels/iax2-parser.o differ diff -ru asterisk/channels/Makefile /usr/src/asterisk/channels/Makefile --- asterisk/channels/Makefile 2004-03-25 14:43:36.000000000 -0500 +++ /usr/src/asterisk/channels/Makefile 2004-01-23 15:57:48.000000000 -0500 @@ -14,21 +14,14 @@ OSARCH=$(shell uname -s) USE_MYSQL_FRIENDS=0 -USE_SIP_MYSQL_FRIENDS=0 -CHANNEL_LIBS=chan_modem.so chan_sip.so \ +CHANNEL_LIBS=chan_modem.so chan_iax.so chan_sip.so \ chan_modem_aopen.so \ chan_modem_bestdata.so chan_modem_i4l.so \ chan_agent.so chan_mgcp.so chan_iax2.so \ chan_local.so chan_skinny.so # -# If you really want IAX1 uncomment the following, but it is -# unmaintained -# -#CHANNEL_LIBS+=chan_iax.so - -# # If you really want VoFR you can have it :-P # #CHANNEL_LIBS+=chan_vofr @@ -50,7 +43,6 @@ ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2") CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING") CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" ) -CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX") ALSA_SRC=chan_alsa.c ALSA_SRC+=$(shell [ -f alsa-monitor.h ] && echo "alsa-monitor.h") @@ -61,9 +53,6 @@ ifeq ($(USE_MYSQL_FRIENDS),1) CFLAGS+=-DMYSQL_FRIENDS endif -ifeq ($(USE_SIP_MYSQL_FRIENDS),1) -CFLAGS+=-DSIP_MYSQL_FRIENDS -endif CFLAGS+=#-DVOFRDUMPER @@ -117,7 +106,7 @@ chan_iax2.so: chan_iax2.o iax2-parser.o ifeq ($(USE_MYSQL_FRIENDS),1) - $(CC) $(SOLINK) -o $@ chan_iax2.o iax2-parser.o -L/usr/lib/mysql -lmysqlclient -lz + $(CC) $(SOLINK) -o $@ chan_iax2.o iax2-parser.o -lmysqlclient -lz else $(CC) $(SOLINK) -o $@ chan_iax2.o iax2-parser.o endif @@ -166,7 +155,6 @@ install: all for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done - if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi depend: .depend Binary files asterisk/chanvars.o and /usr/src/asterisk/chanvars.o differ diff -ru asterisk/cli.c /usr/src/asterisk/cli.c --- asterisk/cli.c 2004-04-08 01:30:39.000000000 -0400 +++ /usr/src/asterisk/cli.c 2004-02-15 04:07:28.000000000 -0500 @@ -186,8 +186,6 @@ #define WEEK (DAY*7) #define YEAR (DAY*365) - if (timeval < 0) - return NULL; if (timeval > YEAR) { years = (timeval / YEAR); timeval -= (years * YEAR); @@ -352,17 +350,13 @@ static int handle_commandmatchesarray(int fd, int argc, char *argv[]) { - char *buf; - int buflen = 2048; + char buf[2048]; int len = 0; char **matches; int x; if (argc != 4) return RESULT_SHOWUSAGE; - buf = malloc(buflen); - if (!buf) - return RESULT_FAILURE; buf[len] = '\0'; matches = ast_cli_completion_matches(argv[2], argv[3]); if (matches) { @@ -370,10 +364,6 @@ #if 0 printf("command matchesarray for '%s' %s got '%s'\n", argv[2], argv[3], matches[x]); #endif - if (len + strlen(matches[x]) >= buflen) { - buflen += strlen(matches[x]) * 3; - buf = realloc(buf, buflen); - } len += sprintf( buf + len, "%s ", matches[x]); free(matches[x]); matches[x] = NULL; @@ -385,8 +375,7 @@ #endif if (buf) { - ast_cli(fd, "%s%s",buf, AST_CLI_COMPLETE_EOF); - free(buf); + ast_cli(fd, buf); } else ast_cli(fd, "NULL\n"); @@ -562,7 +551,7 @@ static int handle_help(int fd, int argc, char *argv[]); static struct ast_cli_entry builtins[] = { - /* Keep alphabetized, with longer matches first (example: abcd before abc) */ + /* Keep alphabetized, with longer matches first (example: abcd before abc */ { { "_command", "complete", NULL }, handle_commandcomplete, "Command complete", commandcomplete_help }, { { "_command", "nummatches", NULL }, handle_commandnummatches, "Returns number of command matches", commandnummatches_help }, { { "_command", "matchesarray", NULL }, handle_commandmatchesarray, "Returns command matches array", commandmatchesarray_help }, @@ -983,7 +972,6 @@ fullcmd = e->generator(text, word, (strlen(word) ? (x - 1) : (x)), state); if (lock) ast_mutex_unlock(&clilock); - free(dup); return fullcmd; } Binary files asterisk/cli.o and /usr/src/asterisk/cli.o differ diff -ru asterisk/codecs/codec_adpcm.c /usr/src/asterisk/codecs/codec_adpcm.c --- asterisk/codecs/codec_adpcm.c 2004-03-11 15:56:56.000000000 -0500 +++ /usr/src/asterisk/codecs/codec_adpcm.c 2003-10-02 19:17:31.000000000 -0400 @@ -27,6 +27,7 @@ #include #define BUFFER_SIZE 8096 /* size for the translation buffers */ +#define BUF_SHIFT 5 static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER; static int localusecnt = 0; @@ -104,8 +105,6 @@ *signal = -2047; *next = 0; - -#ifdef AUTO_RETURN if( encoded & 0x7 ) *rkey = 0; else if ( ++(*rkey) == 24 ) { @@ -115,7 +114,6 @@ else if (*signal < 0) *next = 0x2; } -#endif *ssindex = *ssindex + indsft[(encoded & 7)]; if (*ssindex < 0) @@ -202,10 +200,6 @@ struct ast_frame f; char offset[AST_FRIENDLY_OFFSET]; /* Space to build offset */ short outbuf[BUFFER_SIZE]; /* Decoded signed linear values */ - short ssindex; - short signal; - unsigned char zero_count; - unsigned char next_flag; int tail; }; @@ -278,21 +272,41 @@ { struct adpcm_decoder_pvt *tmp = (struct adpcm_decoder_pvt *) pvt; int x; + short signal; + short ssindex; unsigned char *b; + unsigned char zero_count; + unsigned char next_flag; + + if (f->datalen < BUF_SHIFT) { + ast_log(LOG_WARNING, "Didn't have at least %d bytes of input\n", BUF_SHIFT); + return -1; + } - if (f->datalen * 4 > sizeof(tmp->outbuf)) { + if ((f->datalen - BUF_SHIFT) * 4 > sizeof(tmp->outbuf)) { ast_log(LOG_WARNING, "Out of buffer space\n"); return -1; } + /* Reset ssindex and signal to frame's specified values */ b = f->data; + ssindex = b[0]; + if (ssindex < 0) + ssindex = 0; + if (ssindex > 48) + ssindex = 48; + + signal = (b[1] << 8) | b[2]; + + zero_count = b[3]; + next_flag = b[4]; + + for (x=BUF_SHIFT;xdatalen;x++) { + decode((b[x] >> 4) & 0xf, &ssindex, &signal, &zero_count, &next_flag); + tmp->outbuf[tmp->tail++] = signal << 4; - for (x=0;xdatalen;x++) { - decode((b[x] >> 4) & 0xf, &tmp->ssindex, &tmp->signal, &tmp->zero_count, &tmp->next_flag); - tmp->outbuf[tmp->tail++] = tmp->signal << 4; - - decode(b[x] & 0x0f, &tmp->ssindex, &tmp->signal, &tmp->zero_count, &tmp->next_flag); - tmp->outbuf[tmp->tail++] = tmp->signal << 4; + decode(b[x] & 0x0f, &ssindex, &signal, &zero_count, &next_flag); + tmp->outbuf[tmp->tail++] = signal << 4; } return 0; @@ -394,7 +408,7 @@ adpcm0 = adpcm (tmp->inbuf[i], &tmp->ssindex, &tmp->signal, &tmp->zero_count, &tmp->next_flag); adpcm1 = adpcm (tmp->inbuf[i+1], &tmp->ssindex, &tmp->signal, &tmp->zero_count, &tmp->next_flag); - tmp->outbuf[i/2] = (adpcm0 << 4) | adpcm1; + tmp->outbuf[i/2 + BUF_SHIFT] = (adpcm0 << 4) | adpcm1; }; @@ -405,7 +419,7 @@ tmp->f.offset = AST_FRIENDLY_OFFSET; tmp->f.src = __PRETTY_FUNCTION__; tmp->f.data = tmp->outbuf; - tmp->f.datalen = i_max / 2; + tmp->f.datalen = i_max / 2 + BUF_SHIFT; /* * If there is a signal left over (there should be no more than Binary files asterisk/codecs/codec_adpcm.o and /usr/src/asterisk/codecs/codec_adpcm.o differ Binary files asterisk/codecs/codec_adpcm.so and /usr/src/asterisk/codecs/codec_adpcm.so differ Binary files asterisk/codecs/codec_alaw.o and /usr/src/asterisk/codecs/codec_alaw.o differ Binary files asterisk/codecs/codec_alaw.so and /usr/src/asterisk/codecs/codec_alaw.so differ Binary files asterisk/codecs/codec_a_mu.o and /usr/src/asterisk/codecs/codec_a_mu.o differ Binary files asterisk/codecs/codec_a_mu.so and /usr/src/asterisk/codecs/codec_a_mu.so differ diff -ru asterisk/codecs/codec_g723_1.c /usr/src/asterisk/codecs/codec_g723_1.c --- asterisk/codecs/codec_g723_1.c 2004-04-12 10:58:55.000000000 -0400 +++ /usr/src/asterisk/codecs/codec_g723_1.c 2003-09-26 22:45:37.000000000 -0400 @@ -115,7 +115,7 @@ f.subclass = AST_FORMAT_SLINEAR; f.datalen = sizeof(slin_g723_ex); /* Assume 8000 Hz */ - f.samples = sizeof(slin_g723_ex)/2; + f.samples = sizeof(slin_g723_ex)/16; f.mallocd = 0; f.offset = 0; f.src = __PRETTY_FUNCTION__; @@ -130,7 +130,7 @@ f.subclass = AST_FORMAT_G723_1; f.datalen = sizeof(g723_slin_ex); /* All frames are 30 ms long */ - f.samples = 240; + f.samples = 30; f.mallocd = 0; f.offset = 0; f.src = __PRETTY_FUNCTION__; @@ -167,7 +167,7 @@ tmp->f.subclass = AST_FORMAT_SLINEAR; tmp->f.datalen = tmp->tail * 2; /* Assume 8000 Hz */ - tmp->f.samples = tmp->tail; + tmp->f.samples = tmp->tail / 8; tmp->f.mallocd = 0; tmp->f.offset = AST_FRIENDLY_OFFSET; tmp->f.src = __PRETTY_FUNCTION__; @@ -296,8 +296,9 @@ Coder(&tmp->cod, tmp->buf, tmp->outbuf + cnt); #endif /* Assume 8000 Hz */ - tmp->f.samples += 240; - cnt += g723_len(tmp->outbuf[cnt]); + tmp->f.samples += 30; + /* FIXME:SLD: Shouldn't the [0] be [cnt]?? */ + cnt += g723_len(tmp->outbuf[0]); tmp->tail -= Frame; /* Move the data at the end of the buffer to the front */ if (tmp->tail) Binary files asterisk/codecs/codec_gsm.o and /usr/src/asterisk/codecs/codec_gsm.o differ Binary files asterisk/codecs/codec_gsm.so and /usr/src/asterisk/codecs/codec_gsm.so differ Binary files asterisk/codecs/codec_ilbc.o and /usr/src/asterisk/codecs/codec_ilbc.o differ Binary files asterisk/codecs/codec_ilbc.so and /usr/src/asterisk/codecs/codec_ilbc.so differ Binary files asterisk/codecs/codec_lpc10.o and /usr/src/asterisk/codecs/codec_lpc10.o differ Binary files asterisk/codecs/codec_lpc10.so and /usr/src/asterisk/codecs/codec_lpc10.so differ Binary files asterisk/codecs/codec_ulaw.o and /usr/src/asterisk/codecs/codec_ulaw.o differ Binary files asterisk/codecs/codec_ulaw.so and /usr/src/asterisk/codecs/codec_ulaw.so differ diff -ru asterisk/codecs/CVS/Entries /usr/src/asterisk/codecs/CVS/Entries --- asterisk/codecs/CVS/Entries 2004-04-13 10:27:20.000000000 -0400 +++ /usr/src/asterisk/codecs/CVS/Entries 2004-02-25 14:32:02.000000000 -0500 @@ -2,9 +2,9 @@ /Makefile/1.20/Tue Nov 4 02:40:09 2003//Tv1-0_stable /adpcm_slin_ex.h/1.1/Tue Mar 20 16:11:49 2001//Tv1-0_stable /codec_a_mu.c/1.5/Wed Aug 13 15:25:16 2003//Tv1-0_stable -/codec_adpcm.c/1.7.2.2/Thu Mar 11 20:56:56 2004//Tv1-0_stable +/codec_adpcm.c/1.7/Thu Oct 2 23:17:31 2003//Tv1-0_stable /codec_alaw.c/1.5/Wed Aug 13 15:25:16 2003//Tv1-0_stable -/codec_g723_1.c/1.12.2.1/Mon Apr 12 14:58:55 2004//Tv1-0_stable +/codec_g723_1.c/1.12/Sat Sep 27 02:45:37 2003//Tv1-0_stable /codec_gsm.c/1.11/Wed Aug 13 15:25:16 2003//Tv1-0_stable /codec_ilbc.c/1.3/Wed Aug 13 15:25:16 2003//Tv1-0_stable /codec_lpc10.c/1.7/Wed Aug 13 15:25:16 2003//Tv1-0_stable diff -ru asterisk/codecs/.depend /usr/src/asterisk/codecs/.depend --- asterisk/codecs/.depend 2004-04-13 10:32:56.000000000 -0400 +++ /usr/src/asterisk/codecs/.depend 2004-03-19 11:21:59.000000000 -0500 @@ -10,8 +10,8 @@ /usr/include/bits/sigthread.h ../include/asterisk/logger.h \ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \ ../include/asterisk/module.h ../include/asterisk/translate.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/channel.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ @@ -50,8 +50,8 @@ /usr/include/bits/sigthread.h ../include/asterisk/logger.h \ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \ ../include/asterisk/module.h ../include/asterisk/translate.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/channel.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ @@ -91,8 +91,8 @@ /usr/include/bits/sigthread.h ../include/asterisk/logger.h \ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \ ../include/asterisk/module.h ../include/asterisk/translate.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/channel.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ @@ -130,8 +130,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/translate.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/module.h \ ../include/asterisk/logger.h \ @@ -171,8 +171,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/translate.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/module.h \ ../include/asterisk/logger.h \ @@ -213,8 +213,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/translate.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/module.h \ ../include/asterisk/logger.h \ @@ -256,8 +256,8 @@ /usr/include/bits/sigthread.h ../include/asterisk/logger.h \ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \ ../include/asterisk/module.h ../include/asterisk/translate.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/channel.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ diff -ru asterisk/codecs/gsm/CVS/Entries /usr/src/asterisk/codecs/gsm/CVS/Entries --- asterisk/codecs/gsm/CVS/Entries 2004-04-13 10:27:20.000000000 -0400 +++ /usr/src/asterisk/codecs/gsm/CVS/Entries 2004-02-25 14:32:02.000000000 -0500 @@ -1,6 +1,6 @@ /.cvsignore/1.1/Thu May 8 03:47:22 2003//Tv1-0_stable /COPYRIGHT/1.1/Mon Nov 15 06:09:04 1999//Tv1-0_stable -/Makefile/1.12.2.1/Mon Mar 15 16:52:28 2004//Tv1-0_stable +/Makefile/1.12/Thu Jan 15 21:31:26 2004//Tv1-0_stable /README/1.1/Mon Nov 15 06:09:04 1999//Tv1-0_stable D/inc//// D/src//// Binary files asterisk/codecs/gsm/lib/libgsm.a and /usr/src/asterisk/codecs/gsm/lib/libgsm.a differ diff -ru asterisk/codecs/gsm/Makefile /usr/src/asterisk/codecs/gsm/Makefile --- asterisk/codecs/gsm/Makefile 2004-03-15 11:52:28.000000000 -0500 +++ /usr/src/asterisk/codecs/gsm/Makefile 2004-01-15 16:31:26.000000000 -0500 @@ -40,12 +40,10 @@ ifneq (${OSARCH},Darwin) ifneq (${PROC},x86_64) ifneq ($(shell uname -m),ppc) -ifneq ($(shell uname -m),alpha) OPTIMIZE+=-march=$(PROC) endif endif endif -endif PG = #PG = -g -pg @@ -202,12 +200,10 @@ ifeq (${OSARCH},Linux) ifneq (${PROC},x86_64) ifneq ($(shell uname -m),ppc) -ifneq ($(shell uname -m),alpha) GSM_SOURCES+= $(SRC)/k6opt.s endif endif endif -endif TOAST_SOURCES = $(SRC)/toast.c \ $(SRC)/toast_lin.c \ @@ -255,12 +251,10 @@ ifeq (${OSARCH},Linux) ifneq (${PROC},x86_64) ifneq ($(shell uname -m), ppc) -ifneq ($(shell uname -m), alpha) GSM_OBJECTS+= $(SRC)/k6opt.o endif endif endif -endif TOAST_OBJECTS = $(SRC)/toast.o \ $(SRC)/toast_lin.o \ Binary files asterisk/codecs/ilbc/anaFilter.o and /usr/src/asterisk/codecs/ilbc/anaFilter.o differ Binary files asterisk/codecs/ilbc/constants.o and /usr/src/asterisk/codecs/ilbc/constants.o differ Binary files asterisk/codecs/ilbc/createCB.o and /usr/src/asterisk/codecs/ilbc/createCB.o differ Binary files asterisk/codecs/ilbc/doCPLC.o and /usr/src/asterisk/codecs/ilbc/doCPLC.o differ Binary files asterisk/codecs/ilbc/enhancer.o and /usr/src/asterisk/codecs/ilbc/enhancer.o differ Binary files asterisk/codecs/ilbc/filter.o and /usr/src/asterisk/codecs/ilbc/filter.o differ Binary files asterisk/codecs/ilbc/FrameClassify.o and /usr/src/asterisk/codecs/ilbc/FrameClassify.o differ Binary files asterisk/codecs/ilbc/gainquant.o and /usr/src/asterisk/codecs/ilbc/gainquant.o differ Binary files asterisk/codecs/ilbc/getCBvec.o and /usr/src/asterisk/codecs/ilbc/getCBvec.o differ Binary files asterisk/codecs/ilbc/helpfun.o and /usr/src/asterisk/codecs/ilbc/helpfun.o differ Binary files asterisk/codecs/ilbc/hpInput.o and /usr/src/asterisk/codecs/ilbc/hpInput.o differ Binary files asterisk/codecs/ilbc/hpOutput.o and /usr/src/asterisk/codecs/ilbc/hpOutput.o differ Binary files asterisk/codecs/ilbc/iCBConstruct.o and /usr/src/asterisk/codecs/ilbc/iCBConstruct.o differ Binary files asterisk/codecs/ilbc/iCBSearch.o and /usr/src/asterisk/codecs/ilbc/iCBSearch.o differ Binary files asterisk/codecs/ilbc/iLBC_decode.o and /usr/src/asterisk/codecs/ilbc/iLBC_decode.o differ Binary files asterisk/codecs/ilbc/iLBC_encode.o and /usr/src/asterisk/codecs/ilbc/iLBC_encode.o differ Binary files asterisk/codecs/ilbc/libilbc.a and /usr/src/asterisk/codecs/ilbc/libilbc.a differ Binary files asterisk/codecs/ilbc/LPCdecode.o and /usr/src/asterisk/codecs/ilbc/LPCdecode.o differ Binary files asterisk/codecs/ilbc/LPCencode.o and /usr/src/asterisk/codecs/ilbc/LPCencode.o differ Binary files asterisk/codecs/ilbc/lsf.o and /usr/src/asterisk/codecs/ilbc/lsf.o differ Binary files asterisk/codecs/ilbc/packing.o and /usr/src/asterisk/codecs/ilbc/packing.o differ Binary files asterisk/codecs/ilbc/StateConstructW.o and /usr/src/asterisk/codecs/ilbc/StateConstructW.o differ Binary files asterisk/codecs/ilbc/StateSearchW.o and /usr/src/asterisk/codecs/ilbc/StateSearchW.o differ Binary files asterisk/codecs/ilbc/syntFilter.o and /usr/src/asterisk/codecs/ilbc/syntFilter.o differ diff -ru asterisk/codecs/lpc10/CVS/Entries /usr/src/asterisk/codecs/lpc10/CVS/Entries --- asterisk/codecs/lpc10/CVS/Entries 2004-04-13 10:27:14.000000000 -0400 +++ /usr/src/asterisk/codecs/lpc10/CVS/Entries 2004-02-25 14:31:58.000000000 -0500 @@ -1,4 +1,4 @@ -/Makefile/1.9.2.1/Mon Mar 15 16:52:28 2004//Tv1-0_stable +/Makefile/1.9/Thu Jan 8 16:52:11 2004//Tv1-0_stable /README/1.1/Wed Jan 5 00:20:05 2000//Tv1-0_stable /analys.c/1.15/Fri Sep 19 01:20:22 2003//Tv1-0_stable /bsynz.c/1.14/Wed Feb 12 13:59:14 2003//Tv1-0_stable Binary files asterisk/codecs/lpc10/liblpc10.a and /usr/src/asterisk/codecs/lpc10/liblpc10.a differ diff -ru asterisk/codecs/lpc10/Makefile /usr/src/asterisk/codecs/lpc10/Makefile --- asterisk/codecs/lpc10/Makefile 2004-03-15 11:52:28.000000000 -0500 +++ /usr/src/asterisk/codecs/lpc10/Makefile 2004-01-08 11:52:11.000000000 -0500 @@ -25,16 +25,14 @@ CFLAGS = $(OPTIMIZE) -I$(LIB_TARGET_DIR) $(WARNINGS) -fPIC #CFLAGS+= $(shell if uname -m | grep -q 86; then echo "-mpentium" ; fi) -#fix for PPC processors and ALPHA too +#fix for PPC processors ifneq ($(OSARCH),Darwin) ifneq ($(PROC),ppc) ifneq ($(PROC),x86_64) -ifneq ($(PROC),alpha) CFLAGS+= -march=$(PROC) endif endif endif -endif LIB = $(LIB_TARGET_DIR)/liblpc10.a diff -ru asterisk/config.c /usr/src/asterisk/config.c --- asterisk/config.c 2004-03-02 02:58:29.000000000 -0500 +++ /usr/src/asterisk/config.c 2003-07-01 00:08:25.000000000 -0400 @@ -128,20 +128,6 @@ return 0; } -int ast_false(char *s) -{ - if (!s) - return 0; - /* Determine if this is a false value */ - if (!strcasecmp(s, "no") || - !strcasecmp(s, "false") || - !strcasecmp(s, "n") || - !strcasecmp(s, "f") || - !strcasecmp(s, "0")) - return -1; - return 0; -} - struct ast_variable *ast_variable_browse(struct ast_config *config, char *category) { struct ast_category *cat; Binary files asterisk/config.o and /usr/src/asterisk/config.o differ diff -ru asterisk/configs/CVS/Entries /usr/src/asterisk/configs/CVS/Entries --- asterisk/configs/CVS/Entries 2004-04-13 10:27:14.000000000 -0400 +++ /usr/src/asterisk/configs/CVS/Entries 2004-02-25 14:31:58.000000000 -0500 @@ -6,9 +6,9 @@ /cdr_odbc.conf.sample/1.1/Mon Jan 12 03:12:48 2004//Tv1-0_stable /cdr_pgsql.conf.sample/1.1/Tue Nov 25 01:17:50 2003//Tv1-0_stable /enum.conf.sample/1.2/Sat Oct 4 21:58:16 2003//Tv1-0_stable -/extensions.conf.sample/1.19.2.1/Sat Mar 20 06:52:13 2004//Tv1-0_stable +/extensions.conf.sample/1.19/Thu Jan 29 16:11:21 2004//Tv1-0_stable /festival.conf.sample/1.1/Wed Sep 11 17:09:48 2002//Tv1-0_stable -/iax.conf.sample/1.17.2.2/Mon Mar 8 19:49:01 2004//Tv1-0_stable +/iax.conf.sample/1.17.2.1/Sun Feb 15 06:39:25 2004//Tv1-0_stable /indications.conf.sample/1.8/Fri Jan 16 00:14:22 2004//Tv1-0_stable /logger.conf.sample/1.6/Wed Jan 28 21:13:50 2004//Tv1-0_stable /manager.conf.sample/1.3/Mon May 5 06:14:25 2003//Tv1-0_stable @@ -24,10 +24,10 @@ /queues.conf.sample/1.5/Sat Aug 2 21:10:06 2003//Tv1-0_stable /rpt.conf.sample/1.1/Wed Nov 20 18:31:26 2002//Tv1-0_stable /rtp.conf.sample/1.1/Fri May 16 02:50:46 2003//Tv1-0_stable -/sip.conf.sample/1.19.2.2/Thu Mar 25 20:47:44 2004//Tv1-0_stable +/sip.conf.sample/1.19/Tue Jan 13 06:11:56 2004//Tv1-0_stable /skinny.conf.sample/1.2/Fri Jan 9 23:04:20 2004//Tv1-0_stable /telcordia-1.adsi/1.1/Fri May 3 04:01:44 2002//Tv1-0_stable -/voicemail.conf.sample/1.20.2.1/Thu Mar 18 23:03:42 2004//Tv1-0_stable +/voicemail.conf.sample/1.20/Tue Jan 27 00:37:47 2004//Tv1-0_stable /vpb.conf.sample/1.1/Tue Apr 15 14:39:06 2003//Tv1-0_stable -/zapata.conf.sample/1.16.2.1/Wed Mar 24 08:30:24 2004//Tv1-0_stable +/zapata.conf.sample/1.16/Mon Jan 19 02:32:24 2004//Tv1-0_stable D diff -ru asterisk/configs/extensions.conf.sample /usr/src/asterisk/configs/extensions.conf.sample --- asterisk/configs/extensions.conf.sample 2004-03-20 01:52:13.000000000 -0500 +++ /usr/src/asterisk/configs/extensions.conf.sample 2004-01-29 11:11:21.000000000 -0500 @@ -1,9 +1,6 @@ ; -; Static extension configuration file, used by -; the pbx_config module. This is where you configure all your -; inbound and outbound calls in Asterisk. -; - +; Static extension configuration files, used by +; the pbx_config module. ; ; The "General" category is for certain variables. ; @@ -51,14 +48,12 @@ ; literal. In patterns, some characters have special meanings: ; ; X - any digit from 0-9 -; Z - any digit from 1-9 ; N - any digit from 2-9 ; [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9) -; . - wildcard, matches anything remaining (e.g. _9011. matches -; anything starting with 9011 excluding 9011 itself) +; . - wildcard, matches anything remaining (e.g. _9011. matches anything starting with 9011 excluding 9011 itself) ; -; For example the extension _NXXXXXX would match normal 7 digit dialings, -; while _1NXXNXXXXXX would represent an area code plus phone number +; For example the extenion _NXXXXXX would match normal 7 digit dialings, while +; _1NXXNXXXXXX would represent an area code plus phone number ; preceeded by a one. ; ; Contexts contain several lines, one for each step of each @@ -164,7 +159,6 @@ ; You can use an alternative switch type as well, to resolve ; extensions that are not known here, for example with remote ; IAX switching you transparently get access to the remote -; Asterisk PBX ; ; switch => IAX2/user:password@bigserver/local @@ -299,13 +293,10 @@ ; ;exten => 8600,1,Meetme,1234 ; -; Or playing an announcement to the called party, as soon it answers +; Or playing an announce to the called party, as soon it answers ; ;exten = 8700,1,Dial(${MARK},30,A(/path/to/my/announcemsg)) ; ; For more information on applications, just type "show applications" at your ; friendly Asterisk CLI prompt. ; -; 'show application ' will show details of how you -; use that particular application in this file, the dial plan. -; diff -ru asterisk/configs/iax.conf.sample /usr/src/asterisk/configs/iax.conf.sample --- asterisk/configs/iax.conf.sample 2004-03-08 14:49:01.000000000 -0500 +++ /usr/src/asterisk/configs/iax.conf.sample 2004-02-15 01:39:25.000000000 -0500 @@ -43,9 +43,7 @@ ; buffer. Specifically, you can provide a maximum jitter buffer, ; you can turn it off entirely, and you can specify an acceptable ; drop rate (per MEMORY_SIZE, by default 3 of 100). Disabling the -; jitter buffer is generally recommended unless you are on a highly -; jittery network, since usually jitter buffering will cause you additional -; latency. Finally, you can specify the maximum +; jitter buffer is not recommended. Finally, you can specify the maximum ; excess jitter buffer, which if exceeded, causes the jitter buffer to ; slowly shrink in order to improve latency. ; diff -ru asterisk/configs/sip.conf.sample /usr/src/asterisk/configs/sip.conf.sample --- asterisk/configs/sip.conf.sample 2004-03-25 15:47:44.000000000 -0500 +++ /usr/src/asterisk/configs/sip.conf.sample 2004-01-13 01:11:56.000000000 -0500 @@ -1,74 +1,28 @@ ; ; SIP Configuration for Asterisk ; -; Syntax for specifying a SIP device in extensions.conf is -; SIP/devicename where devicename is defined in a section below. -; -; You may also use -; SIP/username@domain to call any SIP user on the Internet -; (Don't forget to enable DNS SRV records if you want to use this) -; -; If you define a SIP proxy as a peer below, you may call -; SIP/proxyhostname/user or SIP/user@proxyhostname -; where the proxyhostname is defined in a section below -; -; Useful CLI commands to check peers/users: -; sip show peers Show all SIP peers (including friends) -; sip show users Show all SIP users (including friends) -; sip show registry Show status of hosts we register with -; -; sip debug Show all SIP messages -; - - [general] port = 5060 ; Port to bind to -bindaddr = 0.0.0.0 ; Address to bind SIP channel to -context = default ; Default context for incoming calls -;srvlookup = yes ; Enable DNS SRV lookups on outbound calls - +bindaddr = 0.0.0.0 ; Address to bind to +;externip = 200.201.202.203 ; Address that we're going to put in SIP messages if we're behind a NAT +;localnet = 192.168.1.0 ; Internal NETWORK address +;localmask = 255.255.255.0 ; Internal netmask +context = default ; Default for incoming calls +;srvlookup = yes ; Enable SRV lookups on outbound calls ;pedantic = yes ; Enable slow, pedantic checking for Pingtel -;tos=lowdelay ; IP QoS parameter, either keyword or value - +;tos=lowdelay +;tos=184 ;maxexpirey=3600 ; Max length of incoming registration we allow ;defaultexpirey=120 ; Default length of incoming/outoing registration ;notifymimetype=text/plain ; Allow overriding of mime type in NOTIFY ;videosupport=yes ; Turn on support for SIP video - ;disallow=all ; Disallow all codecs ;allow=ulaw ; Allow codecs in order of preference ;allow=ilbc - -; Asterisk can register as a SIP user agent to a SIP proxy (provider) -; Format for the register statement is: -; register => user[:secret[:authuser]]@host[:port][/extension] -; -; If no extension is given, the 's' extension is used. The extension -; needs to be defined in extensions.conf to be able to accept calls -; from this SIP proxy (provider) ; -; host is either a host name defined in DNS or the name of a -; section defined below. +;register => 1234@mysipprovider.com ; Register with a SIP provider +;register => 2345@mysipprovider.com/1234 ; Register 2345 at sip provider as 1234 here. ; -; Examples: -, -;register => 1234:password@mysipprovider.com -; Will call to the 's' extension -; -;register => 2345@mysipprovider.com/1234 -; -; Register 2345 at sip provider. Calls from this provider connect to local -; extension 1234 in extensions.conf default context, unless you define -; [mysipprovider.com] in a section below, and configure a context - -;externip = 200.201.202.203 ; Address that we're going to put in outbound SIP messages - ; if we're behind a NAT -;localnet = 192.168.1.0 ; Internet NETWORK address -;localmask = 255.255.255.0 ; Internet netmask - ; The externip, localnet and localmask is used - ; when registering and communication with other proxies - ; that we're registered with - ;[snomsip] ;type=friend ;secret=blah @@ -84,8 +38,6 @@ ;secret=blah ;host=dynamic ;qualify=1000 ; Consider it down if it's 1 second to reply - ; Helps with NAT session - ; qualify=yes uses default value ;callgroup=1,3-4 ;pickupgroup=1,3-4 ;defaultip=192.168.0.60 @@ -95,14 +47,8 @@ ;username=cisco ;secret=blah ;nat=yes ; This phone may be natted - ; Use IP address that packet is received from - ; instead of trusting SIP headers ;host=dynamic -;canreinvite=no ; Asterisk by default tries to redirect the - ; RTP media stream (audio) to go directly from - ; the caller to the callee. Some devices do not - ; support this (especially if one of them is - ; behind a NAT). +;canreinvite=no ; Cisco poops on reinvite sometimes ;qualify=200 ; Qualify peer is no more than 200ms away ;defaultip=192.168.0.4 @@ -110,12 +56,8 @@ ;type=friend ;username=cisco1 ;fromuser=markster ; Specify user to put in "from" instead of callerid -;fromdomain=yourdomain.com ; Specify domain to put in "from" instead of callerid - ; fromuser and fromdomain are used when Asterisk - ; places calls to this account. It is not used for - ; calls from this account. ;secret=blah ;host=dynamic ;defaultip=192.168.0.4 ;amaflags=default ; Choices are default, omit, billing, documentation -;accountcode=markster ; Users may be associated with an accountcode to ease billing +;accountcode=markster ; Users may be associated with an accountcode tp ease billing diff -ru asterisk/configs/voicemail.conf.sample /usr/src/asterisk/configs/voicemail.conf.sample --- asterisk/configs/voicemail.conf.sample 2004-03-18 18:03:42.000000000 -0500 +++ /usr/src/asterisk/configs/voicemail.conf.sample 2004-01-26 19:37:47.000000000 -0500 @@ -10,9 +10,9 @@ ;serveremail=asterisk@linux-support.net ; Should the email contain the voicemail as an attachment attach=yes -; Maximum length of a voicemail message in seconds +; Maximum length of a voicemail message ;maxmessage=180 -; Maximum length of greetings in seconds +; Maximum length of greetings ;maxgreet=60 ; How many miliseconds to skip forward/back when rew/ff in message playback skipms=3000 diff -ru asterisk/configs/zapata.conf.sample /usr/src/asterisk/configs/zapata.conf.sample --- asterisk/configs/zapata.conf.sample 2004-03-24 03:30:24.000000000 -0500 +++ /usr/src/asterisk/configs/zapata.conf.sample 2004-01-18 21:32:24.000000000 -0500 @@ -73,6 +73,19 @@ ; signalling=fxo_ls ; +; A variety of timing parameters can be specified as well +; Including: +; prewink: Pre-wink time +; preflash: Pre-flash time +; wink: Wink time +; flash: Flash time +; start: Start time +; rxwink: Receiver wink time +; rxflash: Receiver flashtime +; debounce: Debounce timing +; +rxwink=300 ; Atlas seems to use long (250ms) winks +; ; Whether or not to do distinctive ring detection on FXO lines ; ;usedistinctiveringdetection=yes diff -ru asterisk/contrib/scripts/CVS/Entries /usr/src/asterisk/contrib/scripts/CVS/Entries --- asterisk/contrib/scripts/CVS/Entries 2004-04-13 10:27:14.000000000 -0400 +++ /usr/src/asterisk/contrib/scripts/CVS/Entries 2004-02-25 14:31:58.000000000 -0500 @@ -10,5 +10,5 @@ /safe_asterisk/1.5/Wed May 7 22:33:55 2003//Tv1-0_stable /sip-friends.sql/1.1.2.1/Fri Feb 20 15:40:44 2004//Tv1-0_stable /vmail.cgi/1.9/Sun Jan 11 03:26:50 2004//Tv1-0_stable -/vmdb.sql/1.2.2.1/Sat Mar 20 07:52:06 2004//Tv1-0_stable +/vmdb.sql/1.2/Fri May 16 23:52:01 2003//Tv1-0_stable D diff -ru asterisk/contrib/scripts/vmdb.sql /usr/src/asterisk/contrib/scripts/vmdb.sql --- asterisk/contrib/scripts/vmdb.sql 2004-03-20 02:52:06.000000000 -0500 +++ /usr/src/asterisk/contrib/scripts/vmdb.sql 2003-05-16 19:52:01.000000000 -0400 @@ -1,11 +1,2 @@ drop table if exists users; -create table users ( -context VARCHAR(80) NOT NULL, -mailbox VARCHAR(80) NOT NULL, -password VARCHAR(80) NOT NULL DEFAULT '', -fullname VARCHAR(80) NOT NULL DEFAULT '', -email VARCHAR(80) NOT NULL DEFAULT '', -pager VARCHAR(80) NOT NULL DEFAULT '', -options VARCHAR(160) NOT NULL DEFAULT '', -PRIMARY KEY (context, mailbox) -); +create table users (mailbox VARCHAR(80) NOT NULL PRIMARY KEY, context VARCHAR(80), password VARCHAR(80), fullname VARCHAR(80), email VARCHAR(80), pager VARCHAR(80), options VARCHAR(160)); diff -ru asterisk/CVS/Entries /usr/src/asterisk/CVS/Entries --- asterisk/CVS/Entries 2004-04-13 10:27:20.000000000 -0400 +++ /usr/src/asterisk/CVS/Entries 2004-02-25 14:32:02.000000000 -0500 @@ -1,63 +1,63 @@ /.cvsignore/1.2/Thu May 8 03:46:43 2003//Tv1-0_stable -/BUGS/1.7.2.1/Sun Mar 28 17:18:59 2004//Tv1-0_stable +/BUGS/1.7/Mon Jan 12 03:03:23 2004//Tv1-0_stable /CREDITS/1.22/Tue Jan 13 06:11:18 2004//Tv1-0_stable -/ChangeLog/1.61.2.1/Sat Mar 13 05:50:44 2004//Tv1-0_stable +/ChangeLog/1.61/Wed Feb 4 15:22:59 2004//Tv1-0_stable /HARDWARE/1.3/Mon Jan 12 03:16:56 2004//Tv1-0_stable /LICENSE/1.2/Wed Dec 8 00:16:51 1999//Tv1-0_stable -/Makefile/1.75.2.2/Wed Mar 31 22:43:10 2004//Tv1-0_stable +/Makefile/1.75.2.1/Sat Feb 7 07:14:13 2004//Tv1-0_stable /README/1.12.2.1/Sun Feb 15 06:58:25 2004//Tv1-0_stable /SECURITY/1.2/Sat Nov 10 18:09:19 2001//Tv1-0_stable -/acl.c/1.15.2.1/Sat Mar 20 19:08:45 2004//Tv1-0_stable +/acl.c/1.15/Mon Feb 2 06:39:23 2004//Tv1-0_stable /aescrypt.c/1.2/Wed Jan 7 20:45:50 2004//Tv1-0_stable /aeskey.c/1.2/Wed Jan 7 20:45:50 2004//Tv1-0_stable -/aesopt.h/1.2.2.1/Tue Mar 2 22:53:20 2004//Tv1-0_stable +/aesopt.h/1.2/Wed Jan 7 20:45:50 2004//Tv1-0_stable /aestab.c/1.2/Wed Jan 7 20:45:50 2004//Tv1-0_stable /alaw.c/1.1/Sun Dec 9 00:41:43 2001//Tv1-0_stable /app.c/1.9/Wed Jun 11 12:14:38 2003//Tv1-0_stable /ast_expr.y/1.3/Fri Sep 19 01:20:22 2003//Tv1-0_stable /astconf.h/1.1/Thu Jan 30 15:03:20 2003//Tv1-0_stable -/asterisk.c/1.51.2.13/Fri Apr 9 17:46:10 2004//Tv1-0_stable +/asterisk.c/1.51.2.1/Mon Feb 23 03:43:45 2004//Tv1-0_stable /asterisk.h/1.11/Wed Nov 26 22:00:07 2003//Tv1-0_stable /astmm.c/1.9/Wed Jan 14 06:35:00 2004//Tv1-0_stable -/autoservice.c/1.3.2.1/Mon Mar 15 07:53:02 2004//Tv1-0_stable +/autoservice.c/1.3/Mon Sep 8 16:48:06 2003//Tv1-0_stable /callerid.c/1.13/Sun Nov 9 18:46:52 2003//Tv1-0_stable /cdr.c/1.11/Sun Jan 11 03:23:05 2004//Tv1-0_stable -/channel.c/1.73.2.11/Fri Mar 12 16:47:28 2004//Tv1-0_stable +/channel.c/1.73.2.3/Fri Feb 20 20:01:41 2004//Tv1-0_stable /chanvars.c/1.3/Fri May 16 23:33:41 2003//Tv1-0_stable -/cli.c/1.30.2.6/Thu Apr 8 05:30:39 2004//Tv1-0_stable +/cli.c/1.30.2.2/Sun Feb 15 09:07:28 2004//Tv1-0_stable /coef_in.h/1.1/Tue Mar 20 20:11:26 2001//Tv1-0_stable /coef_out.h/1.1/Tue Mar 20 20:11:26 2001//Tv1-0_stable -/config.c/1.16.2.1/Tue Mar 2 07:58:29 2004//Tv1-0_stable +/config.c/1.16/Tue Jul 1 04:08:25 2003//Tv1-0_stable /db.c/1.6/Tue Dec 2 15:12:56 2003//Tv1-0_stable /dlfcn.c/1.1/Sun Oct 26 19:17:28 2003//Tv1-0_stable -/dns.c/1.2.2.3/Thu Mar 4 05:37:39 2004//Tv1-0_stable -/dsp.c/1.19.2.1/Tue Mar 23 23:10:35 2004//Tv1-0_stable +/dns.c/1.2/Sun Oct 26 18:50:49 2003//Tv1-0_stable +/dsp.c/1.19/Sun Jan 25 19:51:01 2004//Tv1-0_stable /ecdisa.h/1.1/Sat Nov 10 20:30:18 2001//Tv1-0_stable -/enum.c/1.14.2.1/Wed Mar 3 03:13:11 2004//Tv1-0_stable -/file.c/1.35.2.2/Wed Feb 25 22:33:49 2004//Tv1-0_stable +/enum.c/1.14/Wed Nov 26 19:15:56 2003//Tv1-0_stable +/file.c/1.35.2.1/Wed Feb 18 16:33:34 2004//Tv1-0_stable /frame.c/1.23.2.2/Wed Feb 25 18:44:48 2004//Tv1-0_stable /fskmodem.c/1.2/Sat Nov 10 20:30:18 2001//Tv1-0_stable /image.c/1.7/Sat Aug 16 05:10:35 2003//Tv1-0_stable /indications.c/1.7.2.3/Thu Feb 12 22:09:54 2004//Tv1-0_stable /io.c/1.7/Sun Oct 26 18:50:49 2003//Tv1-0_stable /loader.c/1.18.2.1/Thu Feb 19 01:04:58 2004//Tv1-0_stable -/logger.c/1.26.2.2/Tue Apr 13 04:46:23 2004//Tv1-0_stable +/logger.c/1.26/Tue Feb 3 16:43:07 2004//Tv1-0_stable /make_build_h/1.1/Wed May 9 03:08:02 2001//Tv1-0_stable -/manager.c/1.37.2.5/Mon Apr 5 19:40:40 2004//Tv1-0_stable -/md5.c/1.2.2.2/Fri Mar 26 08:38:03 2004//Tv1-0_stable +/manager.c/1.37.2.1/Sat Feb 7 07:14:13 2004//Tv1-0_stable +/md5.c/1.2/Sat Jun 29 22:09:03 2002//Tv1-0_stable /mkdep/1.3/Tue Aug 19 06:06:50 2003//Tv1-0_stable -/pbx.c/1.96.2.9/Fri Mar 19 06:35:51 2004//Tv1-0_stable +/pbx.c/1.96.2.3/Mon Feb 23 05:37:01 2004//Tv1-0_stable /poll.c/1.1/Sun Oct 26 19:17:28 2003//Tv1-0_stable /privacy.c/1.1/Fri Jan 17 03:46:33 2003//Tv1-0_stable -/rtp.c/1.47.2.3/Mon Mar 15 16:37:35 2004//Tv1-0_stable -/sample.call/1.1.2.1/Fri Mar 26 08:04:25 2004//Tv1-0_stable +/rtp.c/1.47.2.1/Wed Feb 18 21:38:18 2004//Tv1-0_stable +/sample.call/1.1/Tue Oct 29 05:38:33 2002//Tv1-0_stable /say.c/1.15.2.1/Fri Feb 20 17:44:07 2004//Tv1-0_stable /sched.c/1.11/Fri Nov 21 22:05:08 2003//Tv1-0_stable /sounds.txt/1.22/Mon Jan 19 02:21:24 2004//Tv1-0_stable -/srv.c/1.6.2.1/Wed Mar 3 03:13:11 2004//Tv1-0_stable +/srv.c/1.6/Mon Oct 27 20:00:41 2003//Tv1-0_stable /tdd.c/1.1/Fri Dec 7 22:57:34 2001//Tv1-0_stable /term.c/1.3/Wed Oct 22 03:04:45 2003//Tv1-0_stable -/translate.c/1.13.2.3/Sat Mar 20 10:56:09 2004//Tv1-0_stable +/translate.c/1.13/Sat Aug 16 15:47:53 2003//Tv1-0_stable /ulaw.c/1.2/Fri Dec 7 22:57:34 2001//Tv1-0_stable D/agi//// D/apps//// Binary files asterisk/db1-ast/libdb1.a and /usr/src/asterisk/db1-ast/libdb1.a differ Binary files asterisk/db.o and /usr/src/asterisk/db.o differ diff -ru asterisk/.depend /usr/src/asterisk/.depend --- asterisk/.depend 2004-04-13 10:32:43.000000000 -0400 +++ /usr/src/asterisk/.depend 2004-03-19 11:21:46.000000000 -0500 @@ -265,17 +265,18 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h include/asterisk/channel.h \ - include/asterisk/frame.h /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ - include/asterisk/sched.h include/asterisk/chanvars.h \ - include/asterisk/linkedlists.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /usr/include/setjmp.h /usr/include/bits/setjmp.h include/asterisk/cdr.h \ - /usr/include/sys/time.h include/asterisk/monitor.h /usr/include/stdio.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/include/bits/wchar.h /usr/include/gconv.h \ + include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/sys/sysmacros.h include/asterisk/sched.h \ + include/asterisk/chanvars.h include/asterisk/linkedlists.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/environments.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/setjmp.h /usr/include/bits/setjmp.h \ + include/asterisk/cdr.h /usr/include/sys/time.h \ + include/asterisk/monitor.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ /usr/include/bits/stdio.h include/asterisk/logger.h \ @@ -595,8 +596,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ include/asterisk/logger.h \ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \ @@ -789,8 +790,8 @@ /usr/include/pthread.h /usr/include/sched.h \ /usr/include/bits/initspin.h include/asterisk/options.h \ include/asterisk/channel.h include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ include/asterisk/sched.h include/asterisk/chanvars.h \ include/asterisk/linkedlists.h /usr/include/setjmp.h \ @@ -857,12 +858,12 @@ include/asterisk/options.h include/asterisk/cli.h \ include/asterisk/app.h include/asterisk/pbx.h include/asterisk/md5.h \ include/asterisk/acl.h -md5.o: md5.c /usr/include/endian.h /usr/include/features.h \ +md5.o: md5.c /usr/include/string.h /usr/include/features.h \ /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ - /usr/include/bits/endian.h /usr/include/string.h \ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \ /usr/include/xlocale.h /usr/include/bits/string.h \ - /usr/include/bits/string2.h /usr/include/bits/types.h \ + /usr/include/bits/string2.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/types.h \ /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ /usr/include/stdlib.h include/asterisk/md5.h pbx.o: pbx.c include/asterisk/lock.h /usr/include/pthread.h \ @@ -878,8 +879,8 @@ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \ include/asterisk/pbx.h include/asterisk/sched.h \ include/asterisk/channel.h include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ include/asterisk/chanvars.h include/asterisk/linkedlists.h \ /usr/include/unistd.h /usr/include/bits/posix_opt.h \ @@ -1188,17 +1189,18 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h include/asterisk/channel.h \ - include/asterisk/frame.h /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ - include/asterisk/sched.h include/asterisk/chanvars.h \ - include/asterisk/linkedlists.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /usr/include/setjmp.h /usr/include/bits/setjmp.h include/asterisk/cdr.h \ - /usr/include/sys/time.h include/asterisk/monitor.h /usr/include/stdio.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/include/bits/wchar.h /usr/include/gconv.h \ + include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/sys/sysmacros.h include/asterisk/sched.h \ + include/asterisk/chanvars.h include/asterisk/linkedlists.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/environments.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/setjmp.h /usr/include/bits/setjmp.h \ + include/asterisk/cdr.h /usr/include/sys/time.h \ + include/asterisk/monitor.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ /usr/include/bits/stdio.h include/asterisk/channel_pvt.h \ diff -ru asterisk/dns.c /usr/src/asterisk/dns.c --- asterisk/dns.c 2004-03-04 00:37:39.000000000 -0500 +++ /usr/src/asterisk/dns.c 2003-10-26 13:50:49.000000000 -0500 @@ -137,10 +137,8 @@ if (ntohs(ans->class) == class && ntohs(ans->rtype) == type) { if (callback) { - if ((res = callback(context, answer, ntohs(ans->size), fullanswer)) < 0) { + if ((res = callback(context, answer, ntohs(ans->size), fullanswer)) < 0) ast_log(LOG_WARNING, "Failed to parse result\n"); - return -1; - } if (res > 0) return 1; } @@ -155,13 +153,13 @@ const char *dname, int class, int type, int (*callback)(void *context, u_char *answer, int len, u_char *fullanswer)) { -#ifdef linux +#ifdef __Linux__ struct __res_state dnsstate; #endif char answer[MAX_SIZE]; int res, ret = -1; -#ifdef linux +#ifdef __Linux__ res_ninit(&dnsstate); res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer)); #else @@ -180,8 +178,8 @@ else ret = 1; } -#if defined(linux) - res_nclose(&dnsstate); +#if defined(__Linux__) + res_nclose(&srvstate); #else #ifndef __APPLE__ res_close(); Binary files asterisk/dns.o and /usr/src/asterisk/dns.o differ diff -ru asterisk/dsp.c /usr/src/asterisk/dsp.c --- asterisk/dsp.c 2004-03-23 18:10:35.000000000 -0500 +++ /usr/src/asterisk/dsp.c 2004-01-25 14:51:01.000000000 -0500 @@ -56,9 +56,6 @@ /* Number of goertzels for progress detect */ #define GSAMP_SIZE 183 -/* Define if you want the fax detector -- NOT RECOMMENDED IN -STABLE */ -/* #define FAX_DETECT */ - #define HZ_350 0 #define HZ_440 1 #define HZ_480 2 @@ -133,15 +130,11 @@ goertzel_state_t row_out[4]; goertzel_state_t col_out[4]; -#ifdef FAX_DETECT goertzel_state_t fax_tone; -#endif #ifdef OLD_DSP_ROUTINES goertzel_state_t row_out2nd[4]; goertzel_state_t col_out2nd[4]; -#ifdef FAX_DETECT goertzel_state_t fax_tone2nd; -#endif int hit1; int hit2; int hit3; @@ -160,9 +153,7 @@ int digit_hits[16]; -#ifdef FAX_DETECT int fax_hits; -#endif } dtmf_detect_state_t; typedef struct @@ -185,9 +176,7 @@ int current_digits; int detected_digits; int lost_digits; -#ifdef FAX_DETECT int fax_hits; -#endif } mf_detect_state_t; static float dtmf_row[] = @@ -204,9 +193,7 @@ 700.0, 900.0, 1100.0, 1300.0, 1500.0, 1700.0 }; -#ifdef FAX_DETECT static float fax_freq = 1100.0; -#endif static char dtmf_positions[] = "123A" "456B" "789C" "*0#D"; @@ -307,7 +294,6 @@ s->energy = 0.0; } -#ifdef FAX_DETECT /* Same for the fax dector */ goertzel_init (&s->fax_tone, fax_freq, 102); @@ -315,7 +301,6 @@ /* Same for the fax dector 2nd harmonic */ goertzel_init (&s->fax_tone2nd, fax_freq * 2.0, 102); #endif -#endif /* FAX_DETECT */ s->current_sample = 0; s->detected_digits = 0; @@ -363,12 +348,10 @@ float row_energy[4]; float col_energy[4]; -#ifdef FAX_DETECT float fax_energy; #ifdef OLD_DSP_ROUTINES float fax_energy_2nd; #endif -#endif /* FAX_DETECT */ float famp; float v1; int i; @@ -439,12 +422,11 @@ s->col_out[3].v2 = s->col_out[3].v3; s->col_out[3].v3 = s->col_out[3].fac*s->col_out[3].v2 - v1 + famp; -#ifdef FAX_DETECT /* Update fax tone */ v1 = s->fax_tone.v2; s->fax_tone.v2 = s->fax_tone.v3; s->fax_tone.v3 = s->fax_tone.fac*s->fax_tone.v2 - v1 + famp; -#endif /* FAX_DETECT */ + #ifdef OLD_DSP_ROUTINES v1 = s->col_out2nd[0].v2; s->col_out2nd[0].v2 = s->col_out2nd[0].v3; @@ -478,13 +460,9 @@ s->row_out2nd[3].v2 = s->row_out2nd[3].v3; s->row_out2nd[3].v3 = s->row_out2nd[3].fac*s->row_out2nd[3].v2 - v1 + famp; - -#ifdef FAX_DETECT - /* Update fax tone */ - v1 = s->fax_tone.v2; + v1 = s->fax_tone.v2; s->fax_tone2nd.v2 = s->fax_tone2nd.v3; s->fax_tone2nd.v3 = s->fax_tone2nd.fac*s->fax_tone2nd.v2 - v1 + famp; -#endif /* FAX_DETECT */ #endif } #endif @@ -500,10 +478,8 @@ continue; } -#ifdef FAX_DETECT /* Detect the fax energy, too */ fax_energy = goertzel_result(&s->fax_tone); -#endif /* We are at the end of a DTMF detection block */ /* Find the peak row and the peak column */ @@ -606,7 +582,6 @@ #endif } } -#ifdef FAX_DETECT #ifdef OLD_DSP_ROUTINES if (!hit && (fax_energy >= FAX_THRESHOLD) && (fax_energy > s->energy * 21.0)) { fax_energy_2nd = goertzel_result(&s->fax_tone2nd); @@ -647,7 +622,6 @@ } s->fax_hits = 0; } -#endif /* FAX_DETECT */ #ifdef OLD_DSP_ROUTINES s->hit1 = s->hit2; s->hit2 = s->hit3; @@ -667,12 +641,10 @@ goertzel_reset(&s->col_out2nd[i]); #endif } -#ifdef FAX_DETECT goertzel_reset (&s->fax_tone); #ifdef OLD_DSP_ROUTINES goertzel_reset (&s->fax_tone2nd); #endif -#endif s->energy = 0.0; s->current_sample = 0; } @@ -1661,13 +1633,9 @@ goertzel_reset(&dsp->td.dtmf.col_out2nd[i]); #endif } -#ifdef FAX_DETECT goertzel_reset (&dsp->td.dtmf.fax_tone); -#endif #ifdef OLD_DSP_ROUTINES -#ifdef FAX_DETECT goertzel_reset (&dsp->td.dtmf.fax_tone2nd); -#endif dsp->td.dtmf.hit1 = dsp->td.dtmf.hit2 = dsp->td.dtmf.hit3 = dsp->td.dtmf.hit4 = dsp->td.dtmf.mhit = 0; #else dsp->td.dtmf.hits[2] = dsp->td.dtmf.hits[1] = dsp->td.dtmf.hits[0] = dsp->td.dtmf.mhit = 0; Binary files asterisk/dsp.o and /usr/src/asterisk/dsp.o differ diff -ru asterisk/editline/config.log /usr/src/asterisk/editline/config.log --- asterisk/editline/config.log 2004-04-13 10:33:01.000000000 -0400 +++ /usr/src/asterisk/editline/config.log 2004-03-19 11:22:04.000000000 -0500 @@ -29,8 +29,8 @@ #include configure:1472: checking for issetugid configure:1500: gcc -o conftest -Wall -pipe -g3 conftest.c -ltermcap 1>&5 -/tmp/ccYcUTjf.o(.text+0x11): In function `main': -/usr/src/stable/asterisk/editline/configure:1494: undefined reference to `issetugid' +/tmp/ccR9DNIU.o(.text+0x11): In function `main': +/usr/src/asterisk/editline/configure:1494: undefined reference to `issetugid' collect2: ld returned 1 exit status configure: failed program was: #line 1477 "configure" @@ -57,8 +57,8 @@ ; return 0; } configure:1527: checking for strlcat configure:1555: gcc -o conftest -Wall -pipe -g3 conftest.c -ltermcap 1>&5 -/tmp/ccTHAcUu.o(.text+0x11): In function `main': -/usr/src/stable/asterisk/editline/configure:1549: undefined reference to `strlcat' +/tmp/ccaWqn47.o(.text+0x11): In function `main': +/usr/src/asterisk/editline/configure:1549: undefined reference to `strlcat' collect2: ld returned 1 exit status configure: failed program was: #line 1532 "configure" @@ -85,8 +85,8 @@ ; return 0; } configure:1583: checking for strlcpy configure:1611: gcc -o conftest -Wall -pipe -g3 conftest.c -ltermcap 1>&5 -/tmp/ccKs4ebI.o(.text+0x11): In function `main': -/usr/src/stable/asterisk/editline/configure:1605: undefined reference to `strlcpy' +/tmp/ccOIAQ5b.o(.text+0x11): In function `main': +/usr/src/asterisk/editline/configure:1605: undefined reference to `strlcpy' collect2: ld returned 1 exit status configure: failed program was: #line 1588 "configure" @@ -113,8 +113,8 @@ ; return 0; } configure:1639: checking for fgetln configure:1667: gcc -o conftest -Wall -pipe -g3 conftest.c -ltermcap 1>&5 -/tmp/cc5mH67S.o(.text+0x11): In function `main': -/usr/src/stable/asterisk/editline/configure:1661: undefined reference to `fgetln' +/tmp/ccfi9BRp.o(.text+0x11): In function `main': +/usr/src/asterisk/editline/configure:1661: undefined reference to `fgetln' collect2: ld returned 1 exit status configure: failed program was: #line 1644 "configure" @@ -141,8 +141,8 @@ ; return 0; } configure:1695: checking for strvis configure:1723: gcc -o conftest -Wall -pipe -g3 conftest.c -ltermcap 1>&5 -/tmp/ccOByVI8.o(.text+0x11): In function `main': -/usr/src/stable/asterisk/editline/configure:1717: undefined reference to `strvis' +/tmp/ccACVjUA.o(.text+0x11): In function `main': +/usr/src/asterisk/editline/configure:1717: undefined reference to `strvis' collect2: ld returned 1 exit status configure: failed program was: #line 1700 "configure" @@ -169,8 +169,8 @@ ; return 0; } configure:1751: checking for strunvis configure:1779: gcc -o conftest -Wall -pipe -g3 conftest.c -ltermcap 1>&5 -/tmp/ccyjCvca.o(.text+0x11): In function `main': -/usr/src/stable/asterisk/editline/configure:1773: undefined reference to `strunvis' +/tmp/ccHrNwkO.o(.text+0x11): In function `main': +/usr/src/asterisk/editline/configure:1773: undefined reference to `strunvis' collect2: ld returned 1 exit status configure: failed program was: #line 1756 "configure" Binary files asterisk/editline/editline.o_a and /usr/src/asterisk/editline/editline.o_a differ Binary files asterisk/editline/history.o_a and /usr/src/asterisk/editline/history.o_a differ Binary files asterisk/editline/libedit.a and /usr/src/asterisk/editline/libedit.a differ Binary files asterisk/editline/np/fgetln.o_a and /usr/src/asterisk/editline/np/fgetln.o_a differ Binary files asterisk/editline/np/strlcat.o_a and /usr/src/asterisk/editline/np/strlcat.o_a differ Binary files asterisk/editline/np/strlcpy.o_a and /usr/src/asterisk/editline/np/strlcpy.o_a differ Binary files asterisk/editline/np/unvis.o_a and /usr/src/asterisk/editline/np/unvis.o_a differ Binary files asterisk/editline/np/vis.o_a and /usr/src/asterisk/editline/np/vis.o_a differ Binary files asterisk/editline/readline.o_a and /usr/src/asterisk/editline/readline.o_a differ Binary files asterisk/editline/tokenizer.o_a and /usr/src/asterisk/editline/tokenizer.o_a differ diff -ru asterisk/enum.c /usr/src/asterisk/enum.c --- asterisk/enum.c 2004-03-02 22:13:11.000000000 -0500 +++ /usr/src/asterisk/enum.c 2003-11-26 14:15:56.000000000 -0500 @@ -232,10 +232,8 @@ { struct enum_context *c = (struct enum_context *)context; - if (parse_naptr(c->dst, c->dstlen, c->tech, c->techlen, answer, len, c->naptrinput)) { + if (parse_naptr(c->dst, c->dstlen, c->tech, c->techlen, answer, len, c->naptrinput)) ast_log(LOG_WARNING, "Failed to parse naptr :(\n"); - return -1; - } if (strlen(c->dst)) return 1; Binary files asterisk/enum.o and /usr/src/asterisk/enum.o differ diff -ru asterisk/file.c /usr/src/asterisk/file.c --- asterisk/file.c 2004-02-25 17:33:49.000000000 -0500 +++ /usr/src/asterisk/file.c 2004-02-18 11:33:34.000000000 -0500 @@ -287,22 +287,6 @@ } -static int exts_compare(char *exts, char *type) -{ - char *stringp = NULL, *ext; - char tmp[256]; - - strncpy(tmp, exts, sizeof(tmp) - 1); - stringp = tmp; - while ((ext = strsep(&stringp, "|"))) { - if (!strcmp(ext, type)) { - return 1; - } - } - - return 0; -} - #define ACTION_EXISTS 1 #define ACTION_DELETE 2 #define ACTION_RENAME 3 @@ -335,7 +319,7 @@ } f = formats; while(f) { - if (!fmt || exts_compare(f->exts, fmt)) { + if (!fmt || !strcasecmp(f->name, fmt)) { char *stringp=NULL; exts = strdup(f->exts); /* Try each kind of extension */ @@ -392,7 +376,7 @@ chan->vstream = s; } else { close(ret); - ast_log(LOG_WARNING, "Unable to open fd on %s\n", fn); + ast_log(LOG_WARNING, "Unable to open fd on %s\n", filename); } } else ast_log(LOG_WARNING, "Couldn't open file %s\n", fn); @@ -764,7 +748,7 @@ } f = formats; while(f) { - if (exts_compare(f->exts, type)) { + if (!strcasecmp(f->name, type)) { char *stringp=NULL; /* XXX Implement check XXX */ ext = strdup(f->exts); @@ -819,7 +803,7 @@ f = formats; while(f) { - if (exts_compare(f->exts, type)) { + if (!strcasecmp(f->name, type)) { char *stringp=NULL; /* XXX Implement check XXX */ ext = strdup(f->exts); Binary files asterisk/file.o and /usr/src/asterisk/file.o differ diff -ru asterisk/formats/CVS/Entries /usr/src/asterisk/formats/CVS/Entries --- asterisk/formats/CVS/Entries 2004-04-13 10:27:16.000000000 -0400 +++ /usr/src/asterisk/formats/CVS/Entries 2004-02-25 14:31:59.000000000 -0500 @@ -1,14 +1,14 @@ /.cvsignore/1.1/Thu May 8 03:46:43 2003//Tv1-0_stable /Makefile/1.15/Tue Nov 4 02:40:09 2003//Tv1-0_stable -/format_g723.c/1.11.2.1/Wed Feb 25 22:33:49 2004//Tv1-0_stable +/format_g723.c/1.11/Wed Aug 13 15:25:16 2003//Tv1-0_stable /format_g729.c/1.9/Wed Jan 28 21:32:48 2004//Tv1-0_stable /format_gsm.c/1.14/Tue Feb 3 16:57:00 2004//Tv1-0_stable /format_h263.c/1.4/Thu Jan 22 21:30:04 2004//Tv1-0_stable /format_jpeg.c/1.5/Mon Sep 8 16:48:07 2003//Tv1-0_stable /format_pcm.c/1.10/Mon Sep 8 16:48:07 2003//Tv1-0_stable /format_pcm_alaw.c/1.9/Wed Jan 28 21:06:03 2004//Tv1-0_stable -/format_vox.c/1.12.2.1/Thu Mar 11 19:57:34 2004//Tv1-0_stable +/format_vox.c/1.12/Thu Oct 2 23:17:32 2003//Tv1-0_stable /format_wav.c/1.15/Mon Feb 2 06:34:27 2004//Tv1-0_stable -/format_wav_gsm.c/1.16.2.2/Thu Feb 26 06:46:48 2004//Tv1-0_stable +/format_wav_gsm.c/1.16/Tue Feb 3 16:57:00 2004//Tv1-0_stable /msgsm.h/1.2/Fri Mar 7 06:00:13 2003//Tv1-0_stable D diff -ru asterisk/formats/.depend /usr/src/asterisk/formats/.depend --- asterisk/formats/.depend 2004-04-13 10:32:57.000000000 -0400 +++ /usr/src/asterisk/formats/.depend 2004-03-19 11:22:00.000000000 -0500 @@ -8,8 +8,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/channel.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/sched.h \ ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ @@ -51,8 +51,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/channel.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/sched.h \ ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ @@ -94,8 +94,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/channel.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/sched.h \ ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ @@ -137,8 +137,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/channel.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/sched.h \ ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ @@ -225,8 +225,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/channel.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/sched.h \ ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ @@ -268,8 +268,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/channel.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/sched.h \ ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ @@ -311,8 +311,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/channel.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/sched.h \ ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ @@ -354,8 +354,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/channel.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/sched.h \ ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ @@ -397,8 +397,8 @@ /usr/include/xlocale.h /usr/include/signal.h /usr/include/bits/sigset.h \ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/channel.h \ - ../include/asterisk/frame.h /usr/include/sys/types.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ + ../include/asterisk/frame.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/types.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/sys/sysmacros.h ../include/asterisk/sched.h \ ../include/asterisk/chanvars.h ../include/asterisk/linkedlists.h \ diff -ru asterisk/formats/format_g723.c /usr/src/asterisk/formats/format_g723.c --- asterisk/formats/format_g723.c 2004-02-25 17:33:49.000000000 -0500 +++ /usr/src/asterisk/formats/format_g723.c 2003-08-13 11:25:16.000000000 -0400 @@ -47,7 +47,7 @@ static char *name = "g723sf"; static char *desc = "G.723.1 Simple Timestamp File Format"; -static char *exts = "g723|g723sf"; +static char *exts = "g723"; static struct ast_filestream *g723_open(int fd) { Binary files asterisk/formats/format_g729.o and /usr/src/asterisk/formats/format_g729.o differ Binary files asterisk/formats/format_g729.so and /usr/src/asterisk/formats/format_g729.so differ Binary files asterisk/formats/format_gsm.o and /usr/src/asterisk/formats/format_gsm.o differ Binary files asterisk/formats/format_gsm.so and /usr/src/asterisk/formats/format_gsm.so differ Binary files asterisk/formats/format_h263.o and /usr/src/asterisk/formats/format_h263.o differ Binary files asterisk/formats/format_h263.so and /usr/src/asterisk/formats/format_h263.so differ Binary files asterisk/formats/format_jpeg.o and /usr/src/asterisk/formats/format_jpeg.o differ Binary files asterisk/formats/format_jpeg.so and /usr/src/asterisk/formats/format_jpeg.so differ Binary files asterisk/formats/format_pcm_alaw.o and /usr/src/asterisk/formats/format_pcm_alaw.o differ Binary files asterisk/formats/format_pcm_alaw.so and /usr/src/asterisk/formats/format_pcm_alaw.so differ Binary files asterisk/formats/format_pcm.o and /usr/src/asterisk/formats/format_pcm.o differ Binary files asterisk/formats/format_pcm.so and /usr/src/asterisk/formats/format_pcm.so differ diff -ru asterisk/formats/format_vox.c /usr/src/asterisk/formats/format_vox.c --- asterisk/formats/format_vox.c 2004-03-11 14:57:34.000000000 -0500 +++ /usr/src/asterisk/formats/format_vox.c 2003-10-02 19:17:32.000000000 -0400 @@ -33,6 +33,7 @@ #endif #define BUF_SIZE 80 /* 160 samples */ +#define BUF_SHIFT 5 struct ast_filestream { void *reserved[AST_RESERVED_POINTERS]; @@ -41,7 +42,7 @@ struct ast_frame fr; /* Frame information */ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */ char empty; /* Empty character */ - unsigned char buf[BUF_SIZE]; /* Output Buffer */ + unsigned char buf[BUF_SIZE + BUF_SHIFT]; /* Output Buffer */ int lasttimeout; struct timeval last; short signal; /* Signal level (file side) */ @@ -58,6 +59,143 @@ static char *desc = "Dialogic VOX (ADPCM) File Format"; static char *exts = "vox"; +/* + * Step size index shift table + */ + +static short indsft[8] = { -1, -1, -1, -1, 2, 4, 6, 8 }; + +/* + * Step size table, where stpsz[i]=floor[16*(11/10)^i] + */ + +static short stpsz[49] = { + 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, + 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279, + 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, + 1060, 1166, 1282, 1411, 1552 +}; + +/* + * Nibble to bit map + */ + +static short nbl2bit[16][4] = { + {1, 0, 0, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}, {1, 0, 1, 1}, + {1, 1, 0, 0}, {1, 1, 0, 1}, {1, 1, 1, 0}, {1, 1, 1, 1}, + {-1, 0, 0, 0}, {-1, 0, 0, 1}, {-1, 0, 1, 0}, {-1, 0, 1, 1}, + {-1, 1, 0, 0}, {-1, 1, 0, 1}, {-1, 1, 1, 0}, {-1, 1, 1, 1} +}; + +/* + * Decode(encoded) + * Decodes the encoded nibble from the adpcm file. + * + * Results: + * Returns the encoded difference. + * + * Side effects: + * Sets the index to the step size table for the next encode. + */ + +static inline void +decode (unsigned char encoded, short *ssindex, short *signal, unsigned char *rkey, unsigned char *next) +{ + short diff, step; + step = stpsz[*ssindex]; + + diff = step * nbl2bit[encoded][1] + + (step >> 1) * nbl2bit[encoded][2] + + (step >> 2) * nbl2bit[encoded][3] + + (step >> 3); + if (nbl2bit[encoded][2] && (step & 0x1)) + diff++; + diff *= nbl2bit[encoded][0]; + + if ( *next & 0x1 ) + *signal -= 8; + else if ( *next & 0x2 ) + *signal += 8; + + *signal += diff; + + if (*signal > 2047) + *signal = 2047; + else if (*signal < -2047) + *signal = -2047; + + *next = 0; + if( encoded & 0x7 ) + *rkey = 0; + else if ( ++(*rkey) == 24 ) { + *rkey = 0; + if (*signal > 0) + *next = 0x1; + else if (*signal < 0) + *next = 0x2; + } + + *ssindex = *ssindex + indsft[(encoded & 7)]; + if (*ssindex < 0) + *ssindex = 0; + else if (*ssindex > 48) + *ssindex = 48; +} + +/* + * Adpcm + * Takes a signed linear signal and encodes it as ADPCM + * For more information see http://support.dialogic.com/appnotes/adpcm.pdf + * + * Results: + * Foo. + * + * Side effects: + * signal gets updated with each pass. + */ + +static inline unsigned char +adpcm (short csig, short *ssindex, short *signal) +{ + short diff, step; + unsigned char encoded; + unsigned char zero_count, next_flag; + step = stpsz[*ssindex]; + /* + * Clip csig if too large or too small + */ + + csig >>= 4; + + diff = csig - *signal; + + if (diff < 0) + { + encoded = 8; + diff = -diff; + } + else + encoded = 0; + if (diff >= step) + { + encoded |= 4; + diff -= step; + } + step >>= 1; + if (diff >= step) + { + encoded |= 2; + diff -= step; + } + step >>= 1; + if (diff >= step) + encoded |= 1; + + decode (encoded, ssindex, signal, &zero_count, &next_flag); + + return (encoded); +} + static struct ast_filestream *vox_open(int fd) { /* We don't have any header to read or anything really, but @@ -125,19 +263,31 @@ static struct ast_frame *vox_read(struct ast_filestream *s, int *whennext) { int res; + int x; /* Send a frame from the file to the appropriate channel */ s->fr.frametype = AST_FRAME_VOICE; s->fr.subclass = AST_FORMAT_ADPCM; s->fr.offset = AST_FRIENDLY_OFFSET; s->fr.mallocd = 0; s->fr.data = s->buf; - if ((res = read(s->fd, s->buf, BUF_SIZE)) < 1) { + if ((res = read(s->fd, s->buf + BUF_SHIFT, BUF_SIZE)) < 1) { if (res) ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno)); return NULL; } + /* Store index, then signal */ + s->buf[0] = s->ssindex & 0xff; + s->buf[1] = (s->signal >> 8) & 0xff; + s->buf[2] = s->signal & 0xff; + s->buf[3] = s->zero_count; + s->buf[4] = s->next_flag; + /* Do the decoder to be sure we get the right stuff in the signal and index fields. */ + for (x=BUF_SHIFT;xbuf[x] >> 4, &s->ssindex, &s->signal, &s->zero_count, &s->next_flag); + decode (s->buf[x] & 0xf, &s->ssindex, &s->signal, &s->zero_count, &s->next_flag); + } s->fr.samples = res * 2; - s->fr.datalen = res; + s->fr.datalen = res + BUF_SHIFT; *whennext = s->fr.samples; return &s->fr; } @@ -153,7 +303,11 @@ ast_log(LOG_WARNING, "Asked to write non-ADPCM frame (%d)!\n", f->subclass); return -1; } - if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) { + if (f->datalen < BUF_SHIFT) { + ast_log(LOG_WARNING, "Invalid frame of data (< %d bytes long) from %s\n", BUF_SHIFT, f->src); + return -1; + } + if ((res = write(fs->fd, f->data + BUF_SHIFT, f->datalen - BUF_SHIFT)) != f->datalen - BUF_SHIFT) { ast_log(LOG_WARNING, "Bad write (%d/%d): %s\n", res, f->datalen, strerror(errno)); return -1; } Binary files asterisk/formats/format_vox.o and /usr/src/asterisk/formats/format_vox.o differ Binary files asterisk/formats/format_vox.so and /usr/src/asterisk/formats/format_vox.so differ diff -ru asterisk/formats/format_wav_gsm.c /usr/src/asterisk/formats/format_wav_gsm.c --- asterisk/formats/format_wav_gsm.c 2004-02-26 01:46:48.000000000 -0500 +++ /usr/src/asterisk/formats/format_wav_gsm.c 2004-02-03 11:57:00.000000000 -0500 @@ -68,7 +68,7 @@ static char *name = "wav49"; static char *desc = "Microsoft WAV format (Proprietary GSM)"; -static char *exts = "WAV|wav49"; +static char *exts = "WAV"; #if __BYTE_ORDER == __LITTLE_ENDIAN #define htoll(b) (b) @@ -481,7 +481,7 @@ static int wav_seek(struct ast_filestream *fs, long sample_offset, int whence) { off_t offset=0,distance,cur,min,max; - min = 60; + min = 52; cur = lseek(fs->fd, 0, SEEK_CUR); max = lseek(fs->fd, 0, SEEK_END); /* I'm getting sloppy here, I'm only going to go to even splits of the 2 Binary files asterisk/formats/format_wav_gsm.o and /usr/src/asterisk/formats/format_wav_gsm.o differ Binary files asterisk/formats/format_wav_gsm.so and /usr/src/asterisk/formats/format_wav_gsm.so differ Binary files asterisk/formats/format_wav.o and /usr/src/asterisk/formats/format_wav.o differ Binary files asterisk/formats/format_wav.so and /usr/src/asterisk/formats/format_wav.so differ Binary files asterisk/frame.o and /usr/src/asterisk/frame.o differ Binary files asterisk/fskmodem.o and /usr/src/asterisk/fskmodem.o differ Binary files asterisk/image.o and /usr/src/asterisk/image.o differ diff -ru asterisk/include/asterisk/adsi.h /usr/src/asterisk/include/asterisk/adsi.h --- asterisk/include/asterisk/adsi.h 2004-03-20 12:27:27.000000000 -0500 +++ /usr/src/asterisk/include/asterisk/adsi.h 2002-05-04 17:06:49.000000000 -0400 @@ -96,8 +96,8 @@ #define ADSI_INFO_PAGE 0x0 #define ADSI_COMM_PAGE 0x1 -#define ADSI_KEY_APPS 20 /* 16 to 33 reserved for applications */ - /* Changed to 20 by MDH */ +#define ADSI_KEY_APPS 16 /* 16 to 33 reserved for applications */ + /* Justification */ #define ADSI_JUST_LEFT 0x2 #define ADSI_JUST_RIGHT 0x1 diff -ru asterisk/include/asterisk/channel.h /usr/src/asterisk/include/asterisk/channel.h --- asterisk/include/asterisk/channel.h 2004-02-27 01:16:07.000000000 -0500 +++ /usr/src/asterisk/include/asterisk/channel.h 2004-01-16 18:40:37.000000000 -0500 @@ -843,8 +843,6 @@ c->blocking = -1; \ } } -extern unsigned int ast_get_group(char *s); - #if defined(__cplusplus) || defined(c_plusplus) } #endif diff -ru asterisk/include/asterisk/cli.h /usr/src/asterisk/include/asterisk/cli.h --- asterisk/include/asterisk/cli.h 2004-04-06 03:42:20.000000000 -0400 +++ /usr/src/asterisk/include/asterisk/cli.h 2003-09-10 01:24:49.000000000 -0400 @@ -31,8 +31,6 @@ #define AST_MAX_ARGS 64 -#define AST_CLI_COMPLETE_EOF "_EOF_" - //! A command line entry */ struct ast_cli_entry { /*! Null terminated list of the words of the command */ diff -ru asterisk/include/asterisk/config.h /usr/src/asterisk/include/asterisk/config.h --- asterisk/include/asterisk/config.h 2004-03-02 02:58:29.000000000 -0500 +++ /usr/src/asterisk/include/asterisk/config.h 2003-04-25 16:33:27.000000000 -0400 @@ -87,14 +87,6 @@ */ int ast_true(char *val); -//! Make sure something is false -/*! - * Determine falseness of a boolean value. - * This function checks to see whether a string passed to it is an indication of a negatirve value. It checks to see if the string is "no", "false", "n", "f", and "0". - * Returns 0 if the value of s is a NULL pointer, 0 on "truth", and -1 on falsehood. - */ -int ast_false(char *val); - //! Check for category duplicates /*! * \param config which config to use diff -ru asterisk/include/asterisk/CVS/Entries /usr/src/asterisk/include/asterisk/CVS/Entries --- asterisk/include/asterisk/CVS/Entries 2004-04-13 10:27:17.000000000 -0400 +++ /usr/src/asterisk/include/asterisk/CVS/Entries 2004-02-25 14:32:00.000000000 -0500 @@ -1,5 +1,5 @@ /acl.h/1.4/Wed Jun 11 12:26:19 2003//Tv1-0_stable -/adsi.h/1.3.2.1/Sat Mar 20 17:27:27 2004//Tv1-0_stable +/adsi.h/1.3/Sat May 4 21:06:49 2002//Tv1-0_stable /aes.h/1.2/Wed Jan 7 20:45:50 2004//Tv1-0_stable /alaw.h/1.1/Sun Dec 9 00:41:43 2001//Tv1-0_stable /app.h/1.5/Wed Mar 26 00:15:11 2003//Tv1-0_stable @@ -9,34 +9,34 @@ /callerid.h/1.5/Fri Nov 29 16:43:28 2002//Tv1-0_stable /causes.h/1.3/Sat Oct 25 18:00:00 2003//Tv1-0_stable /cdr.h/1.6/Sun Jan 11 03:23:05 2004//Tv1-0_stable -/channel.h/1.38.2.1/Fri Feb 27 06:16:07 2004//Tv1-0_stable +/channel.h/1.38/Fri Jan 16 23:40:37 2004//Tv1-0_stable /channel_pvt.h/1.12/Sat Jun 28 16:40:02 2003//Tv1-0_stable /chanvars.h/1.2/Tue Oct 22 15:31:47 2002//Tv1-0_stable -/cli.h/1.5.2.1/Tue Apr 6 07:42:20 2004//Tv1-0_stable -/config.h/1.7.2.1/Tue Mar 2 07:58:29 2004//Tv1-0_stable +/cli.h/1.5/Wed Sep 10 05:24:49 2003//Tv1-0_stable +/config.h/1.7/Fri Apr 25 20:33:27 2003//Tv1-0_stable /crypto.h/1.1/Tue Dec 25 21:12:07 2001//Tv1-0_stable /cvsid.h/1.2/Tue Jan 27 00:30:03 2004//Tv1-0_stable /dlfcn-compat.h/1.1/Sun Oct 26 18:50:49 2003//Tv1-0_stable /dns.h/1.1/Sat Sep 27 00:37:07 2003//Tv1-0_stable /dsp.h/1.1/Fri Jan 10 22:58:35 2003//Tv1-0_stable /enum.h/1.2/Thu May 1 04:29:25 2003//Tv1-0_stable -/file.h/1.15.2.1/Wed Feb 25 22:33:49 2004//Tv1-0_stable -/frame.h/1.27.2.2/Tue Mar 2 22:54:54 2004//Tv1-0_stable +/file.h/1.15/Fri Dec 19 18:06:29 2003//Tv1-0_stable +/frame.h/1.27.2.1/Mon Feb 16 15:04:52 2004//Tv1-0_stable /fskmodem.h/1.1/Sat Mar 24 02:45:02 2001//Tv1-0_stable /image.h/1.2/Wed Oct 31 17:05:44 2001//Tv1-0_stable /indications.h/1.3/Wed Aug 13 15:25:16 2003//Tv1-0_stable /io.h/1.5/Sun Oct 26 18:50:49 2003//Tv1-0_stable /linkedlists.h/1.3/Thu Jan 29 16:14:25 2004//Tv1-0_stable /localtime.h/1.2/Mon Oct 27 20:00:41 2003//Tv1-0_stable -/lock.h/1.6.2.3/Thu Apr 1 06:35:17 2004//Tv1-0_stable +/lock.h/1.6/Tue Aug 26 03:56:58 2003//Tv1-0_stable /logger.h/1.8/Tue Jan 27 00:23:39 2004//Tv1-0_stable -/manager.h/1.7.2.1/Mon Mar 1 21:12:49 2004//Tv1-0_stable +/manager.h/1.7/Mon Sep 8 16:44:36 2003//Tv1-0_stable /md5.h/1.2/Tue Dec 25 21:12:07 2001//Tv1-0_stable /module.h/1.9/Wed Aug 13 15:25:16 2003//Tv1-0_stable /monitor.h/1.2/Tue Feb 3 16:57:00 2004//Tv1-0_stable /musiconhold.h/1.1/Thu May 9 16:55:13 2002//Tv1-0_stable -/options.h/1.7.2.1/Sat Mar 20 21:13:30 2004//Tv1-0_stable -/parking.h/1.5.2.1/Fri Feb 27 06:16:07 2004//Tv1-0_stable +/options.h/1.7/Fri May 2 15:37:34 2003//Tv1-0_stable +/parking.h/1.5/Wed Jul 2 14:06:12 2003//Tv1-0_stable /pbx.h/1.23/Sat Oct 25 17:50:06 2003//Tv1-0_stable /poll-compat.h/1.1/Sun Oct 26 18:50:49 2003//Tv1-0_stable /privacy.h/1.1/Fri Jan 17 03:46:33 2003//Tv1-0_stable diff -ru asterisk/include/asterisk/file.h /usr/src/asterisk/include/asterisk/file.h --- asterisk/include/asterisk/file.h 2004-02-25 17:33:49.000000000 -0500 +++ /usr/src/asterisk/include/asterisk/file.h 2003-12-19 13:06:29.000000000 -0500 @@ -142,19 +142,19 @@ //! Starts reading from a file /*! - * \param filename the name of the file to read from - * \param type format of file you wish to read from + * \param filename the name of the file to write to + * \param type format of file you wish to write out to * \param comment comment to go with - * \param flags file flags + * \param oflags output file flags * \param check (unimplemented, hence negligible) * \param mode Open mode - * Open an incoming file stream. flags are flags for the open() command, and - * if check is non-zero, then it will not read a file if there are any files that + * Open an incoming file stream. oflags are flags for the open() command, and + * if check is non-zero, then it will not write a file if there are any files that * start with that name and have an extension * Please note, this is a blocking function. Program execution will not return until ast_waitstream completes it's execution. * Returns a struct ast_filestream on success, NULL on failure */ -struct ast_filestream *ast_readfile(char *filename, char *type, char *comment, int flags, int check, mode_t mode); +struct ast_filestream *ast_readfile(char *filename, char *type, char *comment, int oflags, int check, mode_t mode); //! Starts writing a file /*! @@ -170,7 +170,7 @@ * Please note, this is a blocking function. Program execution will not return until ast_waitstream completes it's execution. * Returns a struct ast_filestream on success, NULL on failure */ -struct ast_filestream *ast_writefile(char *filename, char *type, char *comment, int flags, int check, mode_t mode); +struct ast_filestream *ast_writefile(char *filename, char *type, char *comment, int oflags, int check, mode_t mode); //! Writes a frame to a stream /*! diff -ru asterisk/include/asterisk/frame.h /usr/src/asterisk/include/asterisk/frame.h --- asterisk/include/asterisk/frame.h 2004-03-02 17:54:54.000000000 -0500 +++ /usr/src/asterisk/include/asterisk/frame.h 2004-03-12 12:01:09.000000000 -0500 @@ -20,8 +20,6 @@ extern "C" { #endif -#include - /* * Autodetect system endianess */ @@ -54,6 +52,8 @@ #error Need to know endianess #endif /* __BYTE_ORDER */ +#include + //! Data structure associated with a single frame of data /* A frame of data read used to communicate between between channels and applications */ diff -ru asterisk/include/asterisk/lock.h /usr/src/asterisk/include/asterisk/lock.h --- asterisk/include/asterisk/lock.h 2004-04-01 01:35:17.000000000 -0500 +++ /usr/src/asterisk/include/asterisk/lock.h 2004-03-19 11:21:14.000000000 -0500 @@ -20,11 +20,11 @@ #define AST_PTHREADT_STOP (pthread_t) -2 #ifdef DEBUG_THREADS - #ifdef THREAD_CRASH #define DO_THREAD_CRASH do { *((int *)(0)) = 1; } while(0) #endif + #include #include #include @@ -32,12 +32,12 @@ // #define AST_MUTEX_INITIALIZER PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP // #define AST_MUTEX_KIND PTHREAD_MUTEX_RECURSIVE_NP -#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP -#define AST_MUTEX_INITIALIZER { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, NULL, 0, NULL, 0 } -#else #ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP #define AST_MUTEX_INITIALIZER { PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP, NULL, 0, NULL, 0 } #else +#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +#define AST_MUTEX_INITIALIZER { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, NULL, 0, NULL, 0 } +#else #define AST_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, NULL, 0, NULL, 0 } #endif #endif @@ -164,7 +164,7 @@ #define pthread_mutex_init use_ast_pthread_mutex_init_instead_of_pthread_mutex_init #define pthread_mutex_destroy use_ast_pthread_mutex_destroy_instead_of_pthread_mutex_destroy -#else /* DEBUG_THREADS */ +#else #define AST_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER #ifdef PTHREAD_MUTEX_FAST_NP @@ -182,7 +182,7 @@ #define ast_pthread_mutex_init(t,a) pthread_mutex_init(t,a) #define ast_mutex_destroy(t) pthread_mutex_destroy(t) -#endif /* DEBUG_THREADS */ +#endif #endif Only in /usr/src/asterisk/include/asterisk: lock.h.bak diff -ru asterisk/include/asterisk/manager.h /usr/src/asterisk/include/asterisk/manager.h --- asterisk/include/asterisk/manager.h 2004-03-01 16:12:49.000000000 -0500 +++ /usr/src/asterisk/include/asterisk/manager.h 2003-09-08 12:44:36.000000000 -0400 @@ -66,7 +66,7 @@ int writeperm; char inbuf[MAX_LEN]; int inlen; - int send_events; + struct mansession *next; }; @@ -84,8 +84,6 @@ struct manager_action *next; }; -int ast_carefulwrite(int fd, char *s, int len, int timeoutms); - /* External routines may register/unregister manager callbacks this way */ int ast_manager_register( char *action, int authority, int (*func)(struct mansession *s, struct message *m), char *synopsis); diff -ru asterisk/include/asterisk/options.h /usr/src/asterisk/include/asterisk/options.h --- asterisk/include/asterisk/options.h 2004-03-20 16:13:30.000000000 -0500 +++ /usr/src/asterisk/include/asterisk/options.h 2003-05-02 11:37:34.000000000 -0400 @@ -29,7 +29,6 @@ extern char defaultlanguage[]; extern time_t ast_startuptime; extern time_t ast_lastreloadtime; -extern int ast_mainpid; #define VERBOSE_PREFIX_1 " " #define VERBOSE_PREFIX_2 " == " diff -ru asterisk/include/asterisk/parking.h /usr/src/asterisk/include/asterisk/parking.h --- asterisk/include/asterisk/parking.h 2004-02-27 01:16:07.000000000 -0500 +++ /usr/src/asterisk/include/asterisk/parking.h 2003-07-02 10:06:12.000000000 -0400 @@ -48,6 +48,8 @@ extern int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, int allowredirect_in, int allowredirect_out, int allowdisconnect); +extern unsigned int ast_get_group(char *s); + extern int ast_pickup_call(struct ast_channel *chan); Binary files asterisk/indications.o and /usr/src/asterisk/indications.o differ Binary files asterisk/io.o and /usr/src/asterisk/io.o differ Binary files asterisk/loader.o and /usr/src/asterisk/loader.o differ diff -ru asterisk/logger.c /usr/src/asterisk/logger.c --- asterisk/logger.c 2004-04-13 00:46:23.000000000 -0400 +++ /usr/src/asterisk/logger.c 2004-02-03 11:43:07.000000000 -0500 @@ -49,7 +49,6 @@ static ast_mutex_t msglist_lock = AST_MUTEX_INITIALIZER; static ast_mutex_t loglock = AST_MUTEX_INITIALIZER; -static int pending_logger_reload = 0; static struct msglist { char *msg; @@ -229,6 +228,7 @@ FILE *myf; int x; + ast_mutex_lock(&loglock); if (eventlog) fclose(eventlog); @@ -295,7 +295,6 @@ } else ast_log(LOG_ERROR, "Unable to create event log: %s\n", strerror(errno)); init_logger_chain(); - pending_logger_reload = 0; return -1; } @@ -346,8 +345,10 @@ logger_rotate_help }; static int handle_SIGXFSZ(int sig) { - /* Indicate need to reload */ - pending_logger_reload = 1; + reload_logger(1); + ast_log(LOG_EVENT,"Rotated Logs Per SIGXFSZ\n"); + if (option_verbose) + ast_verbose("Rotated Logs Per SIGXFSZ\n"); return 0; } @@ -398,7 +399,7 @@ levels[level], (long)pthread_self(), file, line, function); } vsnprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), fmt, args); - syslog(syslog_level_map[level], "%s", buf); + syslog(syslog_level_map[level], buf); } /* @@ -472,7 +473,7 @@ va_start(ap, fmt); vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); - fputs(buf, chan->fileptr); + fprintf(chan->fileptr, buf); fflush(chan->fileptr); } chan = chan->next; @@ -486,18 +487,12 @@ va_start(ap, fmt); vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); - fputs(buf, stdout); + fprintf(stdout, buf); } } ast_mutex_unlock(&loglock); /* end critical section */ - if (pending_logger_reload) { - reload_logger(1); - ast_log(LOG_EVENT,"Rotated Logs Per SIGXFSZ\n"); - if (option_verbose) - ast_verbose("Rotated Logs Per SIGXFSZ\n"); - } } extern void ast_verbose(const char *fmt, ...) Binary files asterisk/logger.o and /usr/src/asterisk/logger.o differ diff -ru asterisk/Makefile /usr/src/asterisk/Makefile --- asterisk/Makefile 2004-03-31 17:43:10.000000000 -0500 +++ /usr/src/asterisk/Makefile 2004-02-25 14:34:08.000000000 -0500 @@ -26,7 +26,7 @@ endif endif # Pentium Pro Optimize -#PROC=i686 +PROC=i686 # Pentium & VIA processors optimize #PROC=i586 @@ -102,7 +102,7 @@ MODULES_DIR=$(ASTLIBDIR)/modules AGI_DIR=$(ASTVARLIBDIR)/agi-bin -INCLUDE=-Iinclude -I../include +INCLUDE=-Iinclude -I../include CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY CFLAGS+=$(OPTIMIZE) CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi) diff -ru asterisk/manager.c /usr/src/asterisk/manager.c --- asterisk/manager.c 2004-04-05 15:40:40.000000000 -0400 +++ /usr/src/asterisk/manager.c 2004-02-07 02:14:13.000000000 -0500 @@ -43,7 +43,6 @@ static int asock = -1; static pthread_t t; static ast_mutex_t sessionlock = AST_MUTEX_INITIALIZER; -static int block_sockets = 0; static struct permalias { int num; @@ -63,33 +62,6 @@ static struct manager_action *first_action = NULL; static ast_mutex_t actionlock = AST_MUTEX_INITIALIZER; -int ast_carefulwrite(int fd, char *s, int len, int timeoutms) -{ - /* Try to write string, but wait no more than ms milliseconds - before timing out */ - int res=0; - struct timeval tv; - fd_set fds; - while(len) { - res = write(fd, s, len); - if ((res < 0) && (errno != EAGAIN)) { - return -1; - } - if (res < 0) res = 0; - len -= res; - s += res; - tv.tv_sec = timeoutms / 1000; - tv.tv_usec = timeoutms % 1000; - FD_ZERO(&fds); - FD_SET(fd, &fds); - /* Wait until writable again */ - res = select(fd + 1, NULL, &fds, NULL, &tv); - if (res < 1) - return -1; - } - return res; -} - static int handle_showmancmds(int fd, int argc, char *argv[]) { struct manager_action *cur = first_action; @@ -227,24 +199,6 @@ return ret; } -static int set_eventmask(struct mansession *s, char *eventmask) -{ - if (!eventmask) - return -1; - if (!strcasecmp(eventmask, "on") || ast_true(eventmask)) { - ast_mutex_lock(&s->lock); - s->send_events = 1; - ast_mutex_unlock(&s->lock); - return 1; - } else if (!strcasecmp(eventmask, "off") || ast_false(eventmask)) { - ast_mutex_lock(&s->lock); - s->send_events = 0; - ast_mutex_unlock(&s->lock); - return 0; - } - return -1; -} - static int authenticate(struct mansession *s, struct message *m) { struct ast_config *cfg; @@ -253,8 +207,7 @@ char *pass = astman_get_header(m, "Secret"); char *authtype = astman_get_header(m, "AuthType"); char *key = astman_get_header(m, "Key"); - char *events = astman_get_header(m, "Events"); - + cfg = ast_load("manager.conf"); if (!cfg) return -1; @@ -319,8 +272,6 @@ s->readperm = get_perm(ast_variable_retrieve(cfg, cat, "read")); s->writeperm = get_perm(ast_variable_retrieve(cfg, cat, "write")); ast_destroy(cfg); - if (events) - set_eventmask(s, events); return 0; } ast_log(LOG_NOTICE, "%s tried to authenticate with non-existant user '%s'\n", inet_ntoa(s->sin.sin_addr), user); @@ -334,21 +285,6 @@ return 0; } -static int action_events(struct mansession *s, struct message *m) -{ - char *mask = astman_get_header(m, "EventMask"); - int res; - - res = set_eventmask(s, mask); - if (res > 0) - astman_send_response(s, m, "Events On", NULL); - else if (res == 0) - astman_send_response(s, m, "Events Off", NULL); - else - astman_send_response(s, m, "EventMask parse error", NULL); - return 0; -} - static int action_logoff(struct mansession *s, struct message *m) { astman_send_response(s, m, "Goodbye", "Thanks for all the fish."); @@ -522,12 +458,7 @@ if (strlen(app)) { res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 0, strlen(callerid) ? callerid : NULL, variable, account); } else { - if (exten && context && pi) - res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 0, strlen(callerid) ? callerid : NULL, variable, account); - else { - astman_send_error(s, m, "Originate with 'Exten' requires 'Context' and 'Priority'"); - return 0; - } + res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 0, strlen(callerid) ? callerid : NULL, variable, account); } if (!res) astman_send_ack(s, m, "Originate successfully queued"); @@ -822,15 +753,11 @@ } memset(s, 0, sizeof(struct mansession)); memcpy(&s->sin, &sin, sizeof(sin)); - - if(! block_sockets) { - /* For safety, make sure socket is non-blocking */ - flags = fcntl(as, F_GETFL); - fcntl(as, F_SETFL, flags | O_NONBLOCK); - } + /* For safety, make sure socket is non-blocking */ + flags = fcntl(as, F_GETFL); + fcntl(as, F_SETFL, flags | O_NONBLOCK); ast_mutex_init(&s->lock); s->fd = as; - s->send_events = 1; ast_mutex_lock(&sessionlock); s->next = sessions; sessions = s; @@ -851,14 +778,14 @@ ast_mutex_lock(&sessionlock); s = sessions; while(s) { - if (((s->readperm & category) == category) && s->send_events) { + if ((s->readperm & category) == category) { ast_mutex_lock(&s->lock); if (!s->blocking) { ast_cli(s->fd, "Event: %s\r\n", event); va_start(ap, fmt); vsnprintf(tmp, sizeof(tmp), fmt, ap); va_end(ap); - ast_carefulwrite(s->fd,tmp,strlen(tmp),100); + write(s->fd, tmp, strlen(tmp)); ast_cli(s->fd, "\r\n"); } ast_mutex_unlock(&s->lock); @@ -944,7 +871,6 @@ if (!registered) { /* Register default actions */ ast_manager_register( "Ping", 0, action_ping, "Ping" ); - ast_manager_register( "Events", 0, action_events, "Contol Event Flow" ); ast_manager_register( "Logoff", 0, action_logoff, "Logoff Manager" ); ast_manager_register( "Hangup", EVENT_FLAG_CALL, action_hangup, "Hangup Channel" ); ast_manager_register( "Status", EVENT_FLAG_CALL, action_status, "Status" ); @@ -972,21 +898,11 @@ if (val) enabled = ast_true(val); - val = ast_variable_retrieve(cfg, "general", "block-sockets"); - if(val) - block_sockets = ast_true(val); - - if ((val = ast_variable_retrieve(cfg, "general", "port"))) { - if (sscanf(val, "%d", &portno) != 1) { - ast_log(LOG_WARNING, "Invalid port number '%s'\n", val); - portno = DEFAULT_MANAGER_PORT; - } - } else if ((val = ast_variable_retrieve(cfg, "general", "portno"))) { + if ((val = ast_variable_retrieve(cfg, "general", "portno"))) { if (sscanf(val, "%d", &portno) != 1) { ast_log(LOG_WARNING, "Invalid port number '%s'\n", val); portno = DEFAULT_MANAGER_PORT; } - ast_log(LOG_NOTICE, "Use of portno in manager.conf deprecated. Please use 'port=%s' instead.\n", val); } ba.sin_family = AF_INET; @@ -999,7 +915,7 @@ memset(&ba.sin_addr, 0, sizeof(ba.sin_addr)); } } - + if ((asock > -1) && ((portno != oldportno) || !enabled)) { #if 0 /* Can't be done yet */ Binary files asterisk/manager.o and /usr/src/asterisk/manager.o differ diff -ru asterisk/md5.c /usr/src/asterisk/md5.c --- asterisk/md5.c 2004-03-26 03:38:03.000000000 -0500 +++ /usr/src/asterisk/md5.c 2002-06-29 18:09:03.000000000 -0400 @@ -1,12 +1,6 @@ /* MD5 checksum routines used for authentication. Not covered by GPL, but in the public domain as per the copyright below */ -#if defined( __FreeBSD__ ) || defined( __OpenBSD__ ) -# include -#elif defined( BSD ) && ( BSD >= 199103 ) -# include -#else -# include -#endif + # if __BYTE_ORDER == __BIG_ENDIAN || BYTE_ORDER == BIG_ENDIAN # define HIGHFIRST 1 # endif Binary files asterisk/md5.o and /usr/src/asterisk/md5.o differ diff -ru asterisk/pbx/CVS/Entries /usr/src/asterisk/pbx/CVS/Entries --- asterisk/pbx/CVS/Entries 2004-04-13 10:27:17.000000000 -0400 +++ /usr/src/asterisk/pbx/CVS/Entries 2004-02-25 14:32:00.000000000 -0500 @@ -5,6 +5,6 @@ /pbx_kdeconsole.cc/1.2/Sat Dec 11 20:09:45 1999//Tv1-0_stable /pbx_kdeconsole.h/1.2/Sat Dec 11 20:09:45 1999//Tv1-0_stable /pbx_kdeconsole_main.cc/1.2/Sat Dec 11 20:09:45 1999//Tv1-0_stable -/pbx_spool.c/1.5.2.5/Mon Apr 5 18:03:49 2004//Tv1-0_stable +/pbx_spool.c/1.5/Wed Jan 28 21:32:48 2004//Tv1-0_stable /pbx_wilcalu.c/1.11/Wed Jan 28 21:32:48 2004//Tv1-0_stable D diff -ru asterisk/pbx/.depend /usr/src/asterisk/pbx/.depend --- asterisk/pbx/.depend 2004-04-13 10:32:48.000000000 -0400 +++ /usr/src/asterisk/pbx/.depend 2004-03-19 11:21:52.000000000 -0500 @@ -42,8 +42,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -79,8 +79,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ Binary files asterisk/pbx/pbx_config.o and /usr/src/asterisk/pbx/pbx_config.o differ Binary files asterisk/pbx/pbx_config.so and /usr/src/asterisk/pbx/pbx_config.so differ diff -ru asterisk/pbx/pbx_spool.c /usr/src/asterisk/pbx/pbx_spool.c --- asterisk/pbx/pbx_spool.c 2004-04-05 14:03:49.000000000 -0400 +++ /usr/src/asterisk/pbx/pbx_spool.c 2004-01-28 16:32:48.000000000 -0500 @@ -50,8 +50,6 @@ int retrytime; /* How long to wait for an answer */ int waittime; - /* PID which is currently calling */ - int callingpid; /* What to connect to outgoing */ char tech[256]; @@ -97,13 +95,9 @@ lineno++; if (!feof(f)) { /* Trim comments */ - c = buf; - while ((c = strchr(c, '#'))) { - if ((c == buf) || (*(c-1) == ' ') || (*(c-1) == '\t')) - *c = '\0'; - else - c++; - } + c = strchr(buf, '#'); + if (c) + *c = '\0'; c = strchr(buf, ';'); if (c) *c = '\0'; @@ -163,15 +157,6 @@ } } else if (!strcasecmp(buf, "retry")) { o->retries++; - } else if (!strcasecmp(buf, "startretry")) { - if (sscanf(c, "%d", &o->callingpid) != 1) { - ast_log(LOG_WARNING, "Unable to retrieve calling PID!\n"); - o->callingpid = 0; - } - } else if (!strcasecmp(buf, "endretry") || !strcasecmp(buf, "abortretry")) { - o->callingpid = 0; - o->retries++; - } else if (!strcasecmp(buf, "delayedretry")) { } else if (!strcasecmp(buf, "setvar")) { /* JDG variable support */ strncat(o->variable, c, sizeof(o->variable) - strlen(o->variable) - 1); strncat(o->variable, "|", sizeof(o->variable) - strlen(o->variable) - 1); @@ -197,27 +182,6 @@ return 0; } -static void safe_append(struct outgoing *o, time_t now, char *s) -{ - int fd; - FILE *f; - struct utimbuf tbuf; - fd = open(o->fn, O_WRONLY|O_APPEND); - if (fd > -1) { - f = fdopen(fd, "a"); - if (f) { - fprintf(f, "%s: %ld %d (%ld)\n", s, (long)ast_mainpid, o->retries, (long) now); - fclose(f); - } else - close(fd); - /* Update the file time */ - tbuf.actime = now; - tbuf.modtime = now + o->retrytime; - if (utime(o->fn, &tbuf)) - ast_log(LOG_WARNING, "Unable to set utime on %s: %s\n", o->fn, strerror(errno)); - } -} - static void *attempt_thread(void *data) { struct outgoing *o = data; @@ -237,9 +201,6 @@ /* Max retries exceeded */ ast_log(LOG_EVENT, "Queued call to %s/%s expired without completion after %d attempt(s)\n", o->tech, o->dest, o->retries - 1); unlink(o->fn); - } else { - /* Notate that the call is still active */ - safe_append(o, time(NULL), "EndRetry"); } } else { ast_log(LOG_NOTICE, "Call completed to %s/%s\n", o->tech, o->dest); @@ -265,6 +226,7 @@ static int scan_service(char *fn, time_t now, time_t atime) { struct outgoing *o; + struct utimbuf tbuf; FILE *f; o = malloc(sizeof(struct outgoing)); if (o) { @@ -272,29 +234,27 @@ f = fopen(fn, "r+"); if (f) { if (!apply_outgoing(o, fn, f)) { + /* Update the file time */ + tbuf.actime = atime; + tbuf.modtime = now + o->retrytime; + if (utime(o->fn, &tbuf)) + ast_log(LOG_WARNING, "Unable to set utime on %s: %s\n", fn, strerror(errno)); + /* Increment retries */ + o->retries++; #if 0 - printf("Filename: %s, Retries: %d, max: %d\n", fn, o->retries, o->maxretries); + printf("Retries: %d, max: %d\n", o->retries, o->maxretries); #endif - fclose(f); - if (o->retries <= o->maxretries) { - if (o->callingpid && (o->callingpid == ast_mainpid)) { - safe_append(o, time(NULL), "DelayedRetry"); - ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn); - } else { - /* Increment retries */ - o->retries++; - /* If someone else was calling, they're presumably gone now - so abort their retry and continue as we were... */ - if (o->callingpid) - safe_append(o, time(NULL), "AbortRetry"); - - safe_append(o, now, "StartRetry"); - launch_service(o); - } + if (o->retries <= o->maxretries + 1) { + /* Add a retry line at the end */ + fseek(f, 0L, SEEK_END); + fprintf(f, "Retry: %d (%ld)\n", o->retries, (long) now); + fclose(f); now += o->retrytime; + launch_service(o); return now; } else { ast_log(LOG_EVENT, "Queued call to %s/%s expired without completion after %d attempt(s)\n", o->tech, o->dest, o->retries - 1); + fclose(f); free(o); unlink(fn); return 0; Binary files asterisk/pbx/pbx_spool.o and /usr/src/asterisk/pbx/pbx_spool.o differ Binary files asterisk/pbx/pbx_spool.so and /usr/src/asterisk/pbx/pbx_spool.so differ Binary files asterisk/pbx/pbx_wilcalu.o and /usr/src/asterisk/pbx/pbx_wilcalu.o differ Binary files asterisk/pbx/pbx_wilcalu.so and /usr/src/asterisk/pbx/pbx_wilcalu.so differ diff -ru asterisk/pbx.c /usr/src/asterisk/pbx.c --- asterisk/pbx.c 2004-03-19 01:35:51.000000000 -0500 +++ /usr/src/asterisk/pbx.c 2004-02-23 00:37:01.000000000 -0500 @@ -338,8 +338,8 @@ { "Wait", pbx_builtin_wait, "Waits for some time", -" Wait(seconds): Waits for a specified number of seconds, then returns 0.\n" -"seconds can be passed with fractions of a second. (eg: 1.5 = 1.5 seconds)\n" }, +" Wait(seconds): Waits for a specified number of seconds, then returns 0.\n" }, + }; /* Lock for the application list */ @@ -751,20 +751,7 @@ headp=&c->varshead; *ret=NULL; /* Now we have the variable name on cp3 */ - if (!strncasecmp(var,"LEN(",4)) { - int len=strlen(var); - int len_len=4; - if (strrchr(var,')')) { - char cp3[80]; - strncpy(cp3, var, sizeof(cp3) - 1); - cp3[len-len_len-1]='\0'; - sprintf(workspace,"%d",strlen(cp3)); - *ret = workspace; - } else { - /* length is zero */ - *ret = "0"; - } - } else if ((first=strchr(var,':'))) { + if ((first=strchr(var,':'))) { strncpy(tmpvar, var, sizeof(tmpvar) - 1); first = strchr(tmpvar, ':'); if (!first) @@ -939,6 +926,17 @@ } } } + if (!(*ret) && !strncasecmp(var,"LEN(",4)) { + int len=strlen(var); + int len_len=4; + if (len > (len_len+1) && !strncasecmp(var,"LEN(",len_len) && strchr(var+len_len+2,')')) { + char cp3[80]; + strncpy(cp3, var, sizeof(cp3) - 1); + cp3[len-len_len-1]='\0'; + sprintf(workspace,"%d",strlen(cp3)); + *ret = workspace; + } else ast_log(LOG_NOTICE, "Wrong use of LEN(VARIABLE)\n"); + } } } @@ -2932,12 +2930,12 @@ #if 1 s1 = s1 * 30 + s2/2; if ((s1 < 0) || (s1 >= 24*30)) { - ast_log(LOG_WARNING, "%s isn't a valid start time. Assuming no time.\n", times); + ast_log(LOG_WARNING, "%s isn't a valid star time. Assuming no time.\n", times); return; } e1 = e1 * 30 + e2/2; - if ((e1 < 0) || (e1 >= 24*30)) { - ast_log(LOG_WARNING, "%s isn't a valid end time. Assuming no time.\n", e); + if ((e1 < 0) || (e2 >= 24*30)) { + ast_log(LOG_WARNING, "%s isn't a valid start time. Assuming no time.\n", times); return; } /* Go through the time and enable each appropriate bit */ @@ -3305,7 +3303,7 @@ /* ... go to last sw and check if context is already swd too... */ i = con->alts; while (i) { - if (!strcasecmp(i->name, new_sw->name) && !strcasecmp(i->data, new_sw->data)) { + if (!strcasecmp(i->name, new_sw->name)) { free(new_sw); ast_mutex_unlock(&con->lock); errno = EEXIST; @@ -3537,13 +3535,12 @@ tmpchan->priority = priority; else tmpchan->priority = chan->priority; + if (needlock) + ast_mutex_unlock(&chan->lock); /* Masquerade into temp channel */ ast_channel_masquerade(tmpchan, chan); - if (needlock) - ast_mutex_unlock(&chan->lock); - /* Make the masquerade happen by reading a frame from the tmp channel */ f = ast_read(tmpchan); if (f) @@ -4286,8 +4283,8 @@ { int ms; /* Wait for "n" seconds */ - if (data && atof((char *)data)) { - ms = atof((char *)data) * 1000; + if (data && atoi((char *)data)) { + ms = atoi((char *)data) * 1000; return ast_safe_sleep(chan, ms); } return 0; @@ -4314,7 +4311,7 @@ static int pbx_builtin_atimeout(struct ast_channel *chan, void *data) { int x = atoi((char *) data); - /* Set the absolute maximum time how long a call can be connected */ + /* Set the timeout for how long to wait between digits */ ast_channel_setwhentohangup(chan,x); if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "Set Absolute Timeout to %d\n", x); Binary files asterisk/pbx.o and /usr/src/asterisk/pbx.o differ Binary files asterisk/privacy.o and /usr/src/asterisk/privacy.o differ diff -ru asterisk/res/CVS/Entries /usr/src/asterisk/res/CVS/Entries --- asterisk/res/CVS/Entries 2004-04-13 10:27:17.000000000 -0400 +++ /usr/src/asterisk/res/CVS/Entries 2004-02-25 14:32:00.000000000 -0500 @@ -5,5 +5,5 @@ /res_indications.c/1.4.2.1/Wed Feb 11 00:17:30 2004//Tv1-0_stable /res_monitor.c/1.7.2.1/Fri Feb 6 05:51:35 2004//Tv1-0_stable /res_musiconhold.c/1.19/Sun Jan 11 09:23:26 2004//Tv1-0_stable -/res_parking.c/1.16.2.2/Mon Mar 1 20:33:09 2004//Tv1-0_stable +/res_parking.c/1.16/Tue Feb 3 16:57:00 2004//Tv1-0_stable D diff -ru asterisk/res/.depend /usr/src/asterisk/res/.depend --- asterisk/res/.depend 2004-04-13 10:32:44.000000000 -0400 +++ /usr/src/asterisk/res/.depend 2004-03-19 11:21:47.000000000 -0500 @@ -195,8 +195,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ @@ -251,8 +251,8 @@ /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ /usr/include/bits/sigthread.h ../include/asterisk/file.h \ ../include/asterisk/channel.h ../include/asterisk/frame.h \ - /usr/include/sys/types.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/sys/sysmacros.h \ ../include/asterisk/sched.h ../include/asterisk/chanvars.h \ ../include/asterisk/linkedlists.h /usr/include/unistd.h \ Binary files asterisk/res/res_adsi.o and /usr/src/asterisk/res/res_adsi.o differ Binary files asterisk/res/res_adsi.so and /usr/src/asterisk/res/res_adsi.so differ Binary files asterisk/res/res_crypto.o and /usr/src/asterisk/res/res_crypto.o differ Binary files asterisk/res/res_crypto.so and /usr/src/asterisk/res/res_crypto.so differ Binary files asterisk/res/res_indications.o and /usr/src/asterisk/res/res_indications.o differ Binary files asterisk/res/res_indications.so and /usr/src/asterisk/res/res_indications.so differ Binary files asterisk/res/res_monitor.o and /usr/src/asterisk/res/res_monitor.o differ Binary files asterisk/res/res_monitor.so and /usr/src/asterisk/res/res_monitor.so differ Binary files asterisk/res/res_musiconhold.o and /usr/src/asterisk/res/res_musiconhold.o differ Binary files asterisk/res/res_musiconhold.so and /usr/src/asterisk/res/res_musiconhold.so differ diff -ru asterisk/res/res_parking.c /usr/src/asterisk/res/res_parking.c --- asterisk/res/res_parking.c 2004-03-01 15:33:09.000000000 -0500 +++ /usr/src/asterisk/res/res_parking.c 2004-02-03 11:57:00.000000000 -0500 @@ -164,6 +164,7 @@ "From: %s\r\n" "Timeout: %ld\r\n" "CallerID: %s\r\n" + "\r\n" ,pu->parkingnum, pu->chan->name, peer->name ,(long)pu->start.tv_sec + (long)(pu->parkingtime/1000) - (long)time(NULL) ,(pu->chan->callerid ? pu->chan->callerid : "") @@ -748,6 +749,40 @@ return res; } +unsigned int ast_get_group(char *s) +{ + char *copy; + char *piece; + char *c=NULL; + int start=0, finish=0,x; + unsigned int group = 0; + copy = ast_strdupa(s); + if (!copy) { + ast_log(LOG_ERROR, "Out of memory\n"); + return 0; + } + c = copy; + + while((piece = strsep(&c, ","))) { + if (sscanf(piece, "%d-%d", &start, &finish) == 2) { + /* Range */ + } else if (sscanf(piece, "%d", &start)) { + /* Just one */ + finish = start; + } else { + ast_log(LOG_ERROR, "Syntax error parsing '%s' at '%s'. Using '0'\n", s,piece); + return 0; + } + for (x=start;x<=finish;x++) { + if ((x > 31) || (x < 0)) { + ast_log(LOG_WARNING, "Ignoring invalid group %d\n", x); + } else + group |= (1 << x); + } + } + return group; +} + int unload_module(void) { STANDARD_HANGUP_LOCALUSERS; Binary files asterisk/res/res_parking.o and /usr/src/asterisk/res/res_parking.o differ Binary files asterisk/res/res_parking.so and /usr/src/asterisk/res/res_parking.so differ diff -ru asterisk/rtp.c /usr/src/asterisk/rtp.c --- asterisk/rtp.c 2004-03-15 11:37:35.000000000 -0500 +++ /usr/src/asterisk/rtp.c 2004-02-18 16:38:18.000000000 -0500 @@ -75,7 +75,6 @@ struct sockaddr_in them; struct timeval rxcore; struct timeval txcore; - struct timeval dtmfmute; struct ast_smoother *smoother; int *ioid; unsigned short seqno; @@ -164,17 +163,7 @@ static struct ast_frame *send_dtmf(struct ast_rtp *rtp) { - struct timeval tv; - static struct ast_frame null_frame = { AST_FRAME_NULL, }; - gettimeofday(&tv, NULL); - if ((tv.tv_sec < rtp->dtmfmute.tv_sec) || - ((tv.tv_sec == rtp->dtmfmute.tv_sec) && (tv.tv_usec < rtp->dtmfmute.tv_usec))) { - ast_log(LOG_DEBUG, "Ignore potential DTMF echo from '%s'\n", inet_ntoa(rtp->them.sin_addr)); - rtp->resp = 0; - rtp->dtmfduration = 0; - return &null_frame; - } - ast_log(LOG_DEBUG, "Sending dtmf: %d (%c), at %s\n", rtp->resp, rtp->resp, inet_ntoa(rtp->them.sin_addr)); + ast_log(LOG_DEBUG, "Sending dtmf: %d (%c)\n", rtp->resp, rtp->resp); rtp->f.frametype = AST_FRAME_DTMF; rtp->f.subclass = rtp->resp; rtp->f.datalen = 0; @@ -400,11 +389,6 @@ ast_log(LOG_DEBUG, "RTP NAT: Using address %s:%d\n", inet_ntoa(rtp->them.sin_addr), ntohs(rtp->them.sin_port)); } } - /* Ignore if the other side hasn't been given an address - yet. */ - if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port) - return &null_frame; - /* Get fields */ seqno = ntohl(rtpheader[0]); payloadtype = (seqno & 0x7f0000) >> 16; @@ -878,13 +862,6 @@ if (!rtp->them.sin_addr.s_addr) return 0; - gettimeofday(&rtp->dtmfmute, NULL); - rtp->dtmfmute.tv_usec += (500 * 1000); - if (rtp->dtmfmute.tv_usec > 1000000) { - rtp->dtmfmute.tv_usec -= 1000000; - rtp->dtmfmute.tv_sec += 1; - } - ms = calc_txstamp(rtp); /* Default prediction */ pred = rtp->lastts + ms * 8; @@ -907,8 +884,8 @@ if (x ==0) { /* Clear marker bit and increment seqno */ rtpheader[0] = htonl((2 << 30) | (101 << 16) | (rtp->seqno++)); - /* Make duration 800 (100ms) */ - rtpheader[3] |= htonl((800)); + /* Make duration 240 */ + rtpheader[3] |= htonl((240)); /* Set the End bit for the last 3 */ rtpheader[3] |= htonl((1 << 23)); } Binary files asterisk/rtp.o and /usr/src/asterisk/rtp.o differ diff -ru asterisk/sample.call /usr/src/asterisk/sample.call --- asterisk/sample.call 2004-03-26 03:04:25.000000000 -0500 +++ /usr/src/asterisk/sample.call 2002-10-29 00:38:33.000000000 -0500 @@ -42,8 +42,3 @@ #SetVar: file1=/tmp/to #SetVar: file2=/tmp/msg #SetVar: timestamp=20021023104500 - -# -# You may specify an account to be passed to CDRs -# -#Account: markster Binary files asterisk/say.o and /usr/src/asterisk/say.o differ Binary files asterisk/sched.o and /usr/src/asterisk/sched.o differ diff -ru asterisk/srv.c /usr/src/asterisk/srv.c --- asterisk/srv.c 2004-03-02 22:13:11.000000000 -0500 +++ /usr/src/asterisk/srv.c 2003-10-27 15:00:41.000000000 -0500 @@ -79,10 +79,8 @@ { struct srv_context *c = (struct srv_context *)context; - if (parse_srv(c->host, c->hostlen, c->port, answer, len, fullanswer)) { + if (parse_srv(c->host, c->hostlen, c->port, answer, len, fullanswer)) ast_log(LOG_WARNING, "Failed to parse srv\n"); - return -1; - } if (strlen(c->host)) return 1; Binary files asterisk/srv.o and /usr/src/asterisk/srv.o differ Binary files asterisk/stdtime/libtime.a and /usr/src/asterisk/stdtime/libtime.a differ Binary files asterisk/stdtime/localtime.o and /usr/src/asterisk/stdtime/localtime.o differ Binary files asterisk/tdd.o and /usr/src/asterisk/tdd.o differ Binary files asterisk/term.o and /usr/src/asterisk/term.o differ diff -ru asterisk/translate.c /usr/src/asterisk/translate.c --- asterisk/translate.c 2004-03-20 05:56:09.000000000 -0500 +++ /usr/src/asterisk/translate.c 2003-08-16 11:47:53.000000000 -0400 @@ -29,6 +29,13 @@ #include #include +/* Uncomment the EXPERIMENTAL_TRANSLATION to enable a more complicated, but probably more + correct way of handling full duplex translation */ + +/* +#define EXPERIMENTAL_TRANSLATION +*/ + /* This could all be done more efficiently *IF* we chained packets together by default, but it would also complicate virtually every application. */ @@ -70,11 +77,10 @@ void ast_translator_free_path(struct ast_trans_pvt *p) { - struct ast_trans_pvt *pl, *pn; - pn = p; - while(pn) { - pl = pn; - pn = pn->next; + struct ast_trans_pvt *pl; + while(p) { + pl = p; + p = p->next; if (pl->state && pl->step->destroy) pl->step->destroy(pl->state); free(pl); @@ -258,16 +264,17 @@ for (x=-1;x= 0 && y >= 0 && tr_matrix[x][y].step) - snprintf(line + strlen(line), sizeof(line) - strlen(line), " %5d", tr_matrix[x][y].cost >= 99999 ? tr_matrix[x][y].cost-99999 : tr_matrix[x][y].cost); + /* Skip MP3 (y = 4) as Destination format */ + if (y != 4 && x >= 0 && y >= 0 && tr_matrix[x][y].step) + snprintf(line + strlen(line), sizeof(line) - strlen(line), " %6d", tr_matrix[x][y].cost); else - if (((x == -1 && y >= 0) || (y == -1 && x >= 0))) { + if ((y != 4) && ((x == -1 && y >= 0) || (y == -1 && x >= 0))) { snprintf(line + strlen(line), sizeof(line) - strlen(line), - " %5s", ast_getformatname(1<<(x+y+1)) ); - } else if (x != -1 && y != -1 ) { - snprintf(line + strlen(line), sizeof(line) - strlen(line), " -"); - } else { - snprintf(line + strlen(line), sizeof(line) - strlen(line), " "); + " %6s", ast_getformatname(1<<(x+y+1)) ); + } else if (x != -1 && y != -1 && y != 4) { + snprintf(line + strlen(line), sizeof(line) - strlen(line), " -"); + } else if (y != 4) { + snprintf(line + strlen(line), sizeof(line) - strlen(line), " "); } } snprintf(line + strlen(line), sizeof(line) - strlen(line), "\n"); Binary files asterisk/translate.o and /usr/src/asterisk/translate.o differ Binary files asterisk/ulaw.o and /usr/src/asterisk/ulaw.o differ diff -ru asterisk/.version /usr/src/asterisk/.version --- asterisk/.version 2004-04-13 10:34:09.000000000 -0400 +++ /usr/src/asterisk/.version 2004-02-25 14:35:41.000000000 -0500 @@ -1 +1 @@ -CVS-04/13/04-10:34:09 +CVS-02/25/04-14:35:41