[asterisk-commits] russell: branch russell/res_monkeys r79723 - in /team/russell/res_monkeys: ./...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Aug 16 12:41:15 CDT 2007
Author: russell
Date: Thu Aug 16 12:41:14 2007
New Revision: 79723
URL: http://svn.digium.com/view/asterisk?view=rev&rev=79723
Log:
resolve conflict, reset automerge
Added:
team/russell/res_monkeys/include/asterisk/extconf.h
- copied unchanged from r79719, trunk/include/asterisk/extconf.h
team/russell/res_monkeys/include/asterisk/pval.h
- copied unchanged from r79719, trunk/include/asterisk/pval.h
team/russell/res_monkeys/pbx/ael/ael-test/ael-vtest21/
- copied from r79719, trunk/pbx/ael/ael-test/ael-vtest21/
team/russell/res_monkeys/pbx/ael/ael-test/ael-vtest21/extensions.ael
- copied unchanged from r79719, trunk/pbx/ael/ael-test/ael-vtest21/extensions.ael
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-vtest21
- copied unchanged from r79719, trunk/pbx/ael/ael-test/ref.ael-vtest21
team/russell/res_monkeys/res/ael/
- copied from r79719, trunk/res/ael/
team/russell/res_monkeys/res/ael/ael.flex
- copied unchanged from r79719, trunk/res/ael/ael.flex
team/russell/res_monkeys/res/ael/ael.tab.c
- copied unchanged from r79719, trunk/res/ael/ael.tab.c
team/russell/res_monkeys/res/ael/ael.tab.h
- copied unchanged from r79719, trunk/res/ael/ael.tab.h
team/russell/res_monkeys/res/ael/ael.y
- copied unchanged from r79719, trunk/res/ael/ael.y
team/russell/res_monkeys/res/ael/ael_lex.c
- copied unchanged from r79719, trunk/res/ael/ael_lex.c
team/russell/res_monkeys/res/ael/pval.c
- copied unchanged from r79719, trunk/res/ael/pval.c
team/russell/res_monkeys/res/res_ael_share.c
- copied unchanged from r79719, trunk/res/res_ael_share.c
team/russell/res_monkeys/utils/conf2ael.c
- copied unchanged from r79719, trunk/utils/conf2ael.c
team/russell/res_monkeys/utils/extconf.c
- copied unchanged from r79719, trunk/utils/extconf.c
team/russell/res_monkeys/utils/pval.c
- copied unchanged from r79719, trunk/utils/pval.c
Removed:
team/russell/res_monkeys/pbx/ael/ael.flex
team/russell/res_monkeys/pbx/ael/ael.tab.c
team/russell/res_monkeys/pbx/ael/ael.tab.h
team/russell/res_monkeys/pbx/ael/ael.y
team/russell/res_monkeys/pbx/ael/ael_lex.c
Modified:
team/russell/res_monkeys/ (props changed)
team/russell/res_monkeys/CHANGES
team/russell/res_monkeys/UPGRADE.txt
team/russell/res_monkeys/apps/app_queue.c
team/russell/res_monkeys/apps/app_speech_utils.c
team/russell/res_monkeys/apps/app_voicemail.c
team/russell/res_monkeys/channels/chan_gtalk.c
team/russell/res_monkeys/channels/chan_h323.c
team/russell/res_monkeys/channels/chan_iax2.c
team/russell/res_monkeys/channels/chan_jingle.c
team/russell/res_monkeys/channels/chan_local.c
team/russell/res_monkeys/channels/chan_mgcp.c
team/russell/res_monkeys/channels/chan_misdn.c
team/russell/res_monkeys/channels/chan_oss.c
team/russell/res_monkeys/channels/chan_phone.c
team/russell/res_monkeys/channels/chan_sip.c
team/russell/res_monkeys/channels/chan_skinny.c
team/russell/res_monkeys/channels/chan_zap.c
team/russell/res_monkeys/channels/misdn/ie.c
team/russell/res_monkeys/channels/misdn/isdn_msg_parser.c
team/russell/res_monkeys/include/asterisk/ael_structs.h
team/russell/res_monkeys/include/asterisk/ast_expr.h
team/russell/res_monkeys/include/asterisk/channel.h
team/russell/res_monkeys/include/asterisk/pbx.h
team/russell/res_monkeys/include/asterisk/speech.h
team/russell/res_monkeys/main/channel.c
team/russell/res_monkeys/main/pbx.c
team/russell/res_monkeys/main/rtp.c
team/russell/res_monkeys/pbx/Makefile
team/russell/res_monkeys/pbx/ael/ael-test/ael-test5/extensions.ael
team/russell/res_monkeys/pbx/ael/ael-test/ael-test6/extensions.ael
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-ntest10
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test1
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test11
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test14
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test15
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test16
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test19
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test2
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test3
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test4
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test5
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test6
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-test7
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-vtest13
team/russell/res_monkeys/pbx/ael/ael-test/ref.ael-vtest17
team/russell/res_monkeys/pbx/pbx_ael.c
team/russell/res_monkeys/pbx/pbx_dundi.c
team/russell/res_monkeys/res/Makefile
team/russell/res_monkeys/res/res_features.c
team/russell/res_monkeys/res/res_jabber.c
team/russell/res_monkeys/res/res_musiconhold.c
team/russell/res_monkeys/res/res_odbc.c
team/russell/res_monkeys/res/res_speech.c
team/russell/res_monkeys/utils/Makefile
team/russell/res_monkeys/utils/ael_main.c
team/russell/res_monkeys/utils/check_expr.c
Propchange: team/russell/res_monkeys/
------------------------------------------------------------------------------
automerge = *
Propchange: team/russell/res_monkeys/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/russell/res_monkeys/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Aug 16 12:41:14 2007
@@ -1,1 +1,1 @@
-/trunk:1-79172
+/trunk:1-79722
Modified: team/russell/res_monkeys/CHANGES
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/CHANGES?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/CHANGES (original)
+++ team/russell/res_monkeys/CHANGES Thu Aug 16 12:41:14 2007
@@ -21,6 +21,7 @@
are currently active on the system.
* Added a "ListAllVoicemailUsers" action that allows you to get a list of all
the voicemail users setup.
+ * Added 'DBDel' and 'DBDelTree' manager commands.
Dialplan functions
------------------
@@ -144,6 +145,7 @@
position changes frequently.
* Added additional information to EXITWITHTIMEOUT and EXITWITHKEY events in the
queue log.
+ * Added ability for non-realtime queues to have realtime members
MeetMe Changes
--------------
@@ -185,6 +187,12 @@
by saying "local myvar=someval;" or using Set() in this
fashion: Set(LOCAL(myvar)=someval); ("local" is now
an AEL keyword).
+ * utils/conf2ael introduced. Will convert an extensions.conf
+ file into extensions.ael. Very crude and unfinished, but
+ will be improved as time goes by. Should be useful for a
+ first pass at conversion.
+ * aelparse will now read extensions.conf to see if a referenced
+ macro or context is there before issueing a warning.
Zaptel channel driver (chan_zap) Changes
----------------------------------------
@@ -245,7 +253,6 @@
* Added G729 passthrough support to chan_phone for Sigma Designs boards.
* Added 's' option to Page application.
* Added 'E' and 'V' commands to ExternalIVR.
- * Added 'DBDel' and 'DBDelTree' manager commands.
* Added 'o' and 'X' options to Chanspy.
* Added a new CDR module, cdr_sqlite3_custom.
* The cdr_manager module has a [mappings] feature, like cdr_custom,
Modified: team/russell/res_monkeys/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/UPGRADE.txt?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/UPGRADE.txt (original)
+++ team/russell/res_monkeys/UPGRADE.txt Thu Aug 16 12:41:14 2007
@@ -16,6 +16,10 @@
best to insert a Return() app call at the end of your macro if you did
not include it, but really, you should make sure that all execution
paths within your macros end in "return;".
+
+* The conf2ael program is 'introduced' in this release; it is in a rather
+ crude state, but deemed useful for making a first pass at converting
+ extensions.conf code into AEL. More intelligence will come with time.
Core:
Modified: team/russell/res_monkeys/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/apps/app_queue.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/apps/app_queue.c (original)
+++ team/russell/res_monkeys/apps/app_queue.c Thu Aug 16 12:41:14 2007
@@ -410,6 +410,7 @@
static AST_LIST_HEAD_STATIC(queues, call_queue);
+static void update_realtime_members(struct call_queue *q);
static int set_member_paused(const char *queuename, const char *interface, int paused);
static void set_queue_result(struct ast_channel *chan, enum queue_result res)
@@ -1254,6 +1255,8 @@
ast_variables_destroy(queue_vars);
AST_LIST_UNLOCK(&queues);
+ } else {
+ update_realtime_members(q);
}
return q;
}
Modified: team/russell/res_monkeys/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/apps/app_speech_utils.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/apps/app_speech_utils.c (original)
+++ team/russell/res_monkeys/apps/app_speech_utils.c Thu Aug 16 12:41:14 2007
@@ -701,6 +701,7 @@
/* We sort of make a results entry */
speech->results = ast_calloc(1, sizeof(*speech->results));
if (speech->results != NULL) {
+ ast_speech_dtmf(speech, dtmf);
speech->results->score = 1000;
speech->results->text = ast_strdup(dtmf);
speech->results->grammar = ast_strdup("dtmf");
Modified: team/russell/res_monkeys/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/apps/app_voicemail.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/apps/app_voicemail.c (original)
+++ team/russell/res_monkeys/apps/app_voicemail.c Thu Aug 16 12:41:14 2007
@@ -1793,7 +1793,7 @@
bio.iocp = BASEMAXINLINE;
if (!(fi = fopen(filename, "rb"))) {
- ast_log(LOG_WARNING, "Failed to open log file: %s: %s\n", filename, strerror(errno));
+ ast_log(LOG_WARNING, "Failed to open file: %s: %s\n", filename, strerror(errno));
return -1;
}
@@ -5961,7 +5961,7 @@
if (!res && vms->oldmessages) {
lastnum = get_lastdigits(vms->oldmessages);
- dcnum = vms->newmessages - lastnum;
+ dcnum = vms->oldmessages - lastnum;
if (dcnum)
res = say_and_wait(chan, dcnum, chan->language);
if (!res && lastnum) {
Modified: team/russell/res_monkeys/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_gtalk.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_gtalk.c (original)
+++ team/russell/res_monkeys/channels/chan_gtalk.c Thu Aug 16 12:41:14 2007
@@ -979,9 +979,7 @@
cid = data;
}
cid = strsep(&cid, "@");
- tmp->cid.cid_num = ast_strdup(cid);
tmp->cid.cid_ani = ast_strdup(cid);
- tmp->cid.cid_name = ast_strdup(i->them);
if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
tmp->cid.cid_dnid = ast_strdup(i->exten);
tmp->priority = 1;
Modified: team/russell/res_monkeys/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_h323.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_h323.c (original)
+++ team/russell/res_monkeys/channels/chan_h323.c Thu Aug 16 12:41:14 2007
@@ -1079,9 +1079,7 @@
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
- ch->cid.cid_num = ast_strdup(cid_num);
ch->cid.cid_ani = ast_strdup(cid_num);
- ch->cid.cid_name = ast_strdup(cid_name);
if (pvt->cd.redirect_reason >= 0) {
ch->cid.cid_rdnis = ast_strdup(pvt->cd.redirect_number);
Modified: team/russell/res_monkeys/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_iax2.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_iax2.c (original)
+++ team/russell/res_monkeys/channels/chan_iax2.c Thu Aug 16 12:41:14 2007
@@ -1184,6 +1184,10 @@
return csub;
}
+/*!
+ * \note This funtion calls realtime_peer -> reg_source_db -> iax2_poke_peer -> find_callno,
+ * so do not call it with a pvt lock held.
+ */
static struct iax2_peer *find_peer(const char *name, int realtime)
{
struct iax2_peer *peer = NULL;
@@ -1397,6 +1401,8 @@
* However, it's too late to change that now. Instead, we need to come up with
* a better way of indexing active calls so that these frequent lookups are not
* so expensive.
+ *
+ * \note Calling this function while holding another pvt lock can cause a deadlock.
*/
static int find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int lockpeer, int sockfd)
{
@@ -2674,6 +2680,10 @@
return 0;
}
+/*!
+ * \note This function calls reg_source_db -> iax2_poke_peer -> find_callno,
+ * so do not call this with a pvt lock held.
+ */
static struct iax2_peer *realtime_peer(const char *peername, struct sockaddr_in *sin)
{
struct ast_variable *var;
@@ -3569,8 +3579,6 @@
/* Don't use ast_set_callerid() here because it will
* generate a NewCallerID event before the NewChannel event */
- tmp->cid.cid_num = ast_strdup(i->cid_num);
- tmp->cid.cid_name = ast_strdup(i->cid_name);
if (!ast_strlen_zero(i->ani))
tmp->cid.cid_ani = ast_strdup(i->ani);
else
@@ -5331,10 +5339,11 @@
}
/* SLD: first call to lookup peer during registration */
+ ast_mutex_unlock(&iaxsl[callno]);
p = find_peer(peer, 1);
-
- if (!p) {
- if (authdebug)
+ ast_mutex_lock(&iaxsl[callno]);
+ if (!p || !iaxs[callno]) {
+ if (authdebug && !p)
ast_log(LOG_NOTICE, "No registration for peer '%s' (from %s)\n", peer, ast_inet_ntoa(sin->sin_addr));
return -1;
}
@@ -5441,8 +5450,8 @@
if (ast_test_flag(p, IAX_TEMPONLY))
destroy_peer(p);
+
return 0;
-
}
static int authenticate(const char *challenge, const char *secret, const char *keyn, int authmethods, struct iax_ie_data *ied, struct sockaddr_in *sin, ast_aes_encrypt_key *ecx, ast_aes_decrypt_key *dcx)
@@ -5498,6 +5507,10 @@
return res;
}
+/*!
+ * \note This function calls realtime_peer -> reg_source_db -> iax2_poke_peer -> find_callno,
+ * so do not call this function with a pvt lock held.
+ */
static int authenticate_reply(struct chan_iax2_pvt *p, struct sockaddr_in *sin, struct iax_ies *ies, const char *override, const char *okey)
{
struct iax2_peer *peer = NULL;
@@ -5505,7 +5518,8 @@
int res = -1;
int authmethods = 0;
struct iax_ie_data ied;
-
+ uint16_t callno = p->callno;
+
memset(&ied, 0, sizeof(ied));
if (ies->username)
@@ -5542,10 +5556,23 @@
if (!peer) {
/* We checked our list and didn't find one. It's unlikely, but possible,
that we're trying to authenticate *to* a realtime peer */
- if ((peer = realtime_peer(p->peer, NULL))) {
+ const char *peer_name = ast_strdupa(p->peer);
+ ast_mutex_unlock(&iaxsl[callno]);
+ if ((peer = realtime_peer(peer_name, NULL))) {
+ ast_mutex_lock(&iaxsl[callno]);
+ if (!(p = iaxs[callno])) {
+ if (ast_test_flag(peer, IAX_TEMPONLY))
+ destroy_peer(peer);
+ return -1;
+ }
res = authenticate(p->challenge, peer->secret,peer->outkey, authmethods, &ied, sin, &p->ecx, &p->dcx);
if (ast_test_flag(peer, IAX_TEMPONLY))
destroy_peer(peer);
+ }
+ if (!peer) {
+ ast_mutex_lock(&iaxsl[callno]);
+ if (!(p = iaxs[callno]))
+ return -1;
}
}
}
@@ -5969,7 +5996,7 @@
}
}
-static int update_registry(const char *name, struct sockaddr_in *sin, int callno, char *devtype, int fd, unsigned short refresh)
+static int update_registry(struct sockaddr_in *sin, int callno, char *devtype, int fd, unsigned short refresh)
{
/* Called from IAX thread only, with proper iaxsl lock */
struct iax_ie_data ied;
@@ -5977,12 +6004,23 @@
int msgcount;
char data[80];
int version;
+ const char *peer_name;
memset(&ied, 0, sizeof(ied));
+ peer_name = ast_strdupa(iaxs[callno]->peer);
+
/* SLD: Another find_peer call during registration - this time when we are really updating our registration */
- if (!(p = find_peer(name, 1))) {
- ast_log(LOG_WARNING, "No such peer '%s'\n", name);
+ ast_mutex_unlock(&iaxsl[callno]);
+ if (!(p = find_peer(peer_name, 1))) {
+ ast_mutex_lock(&iaxsl[callno]);
+ ast_log(LOG_WARNING, "No such peer '%s'\n", peer_name);
+ return -1;
+ }
+ ast_mutex_lock(&iaxsl[callno]);
+ if (!iaxs[callno]) {
+ if (ast_test_flag(p, IAX_TEMPONLY))
+ destroy_peer(p);
return -1;
}
@@ -5990,9 +6028,9 @@
if (sin->sin_addr.s_addr) {
time_t nowtime;
time(&nowtime);
- realtime_update_peer(name, sin, nowtime);
+ realtime_update_peer(peer_name, sin, nowtime);
} else {
- realtime_update_peer(name, sin, 0);
+ realtime_update_peer(peer_name, sin, 0);
}
}
if (inaddrcmp(&p->addr, sin)) {
@@ -6022,8 +6060,11 @@
}
/* Make sure our call still exists, an INVAL at the right point may make it go away */
- if (!iaxs[callno])
+ if (!iaxs[callno]) {
+ if (ast_test_flag(p, IAX_TEMPONLY))
+ destroy_peer(p);
return 0;
+ }
/* Store socket fd */
p->sockfd = fd;
@@ -6095,13 +6136,24 @@
return send_command_final(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_REGACK, 0, ied.buf, ied.pos, -1);
}
-static int registry_authrequest(const char *name, int callno)
+static int registry_authrequest(int callno)
{
struct iax_ie_data ied;
struct iax2_peer *p;
char challenge[10];
+ const char *peer_name;
+
+ peer_name = ast_strdupa(iaxs[callno]->peer);
+
/* SLD: third call to find_peer in registration */
- p = find_peer(name, 1);
+ ast_mutex_unlock(&iaxsl[callno]);
+ p = find_peer(peer_name, 1);
+ ast_mutex_lock(&iaxsl[callno]);
+ if (!iaxs[callno]) {
+ if (p && ast_test_flag(p, IAX_TEMPONLY))
+ destroy_peer(p);
+ return -1;
+ }
if (p) {
memset(&ied, 0, sizeof(ied));
iax_ie_append_short(&ied, IAX_IE_AUTHMETHODS, p->authmethods);
@@ -6112,12 +6164,12 @@
/* snprintf(iaxs[callno]->challenge, sizeof(iaxs[callno]->challenge), "%d", (int)ast_random()); */
iax_ie_append_str(&ied, IAX_IE_CHALLENGE, iaxs[callno]->challenge);
}
- iax_ie_append_str(&ied, IAX_IE_USERNAME, name);
+ iax_ie_append_str(&ied, IAX_IE_USERNAME, peer_name);
if (ast_test_flag(p, IAX_TEMPONLY))
destroy_peer(p);
return send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_REGAUTH, 0, ied.buf, ied.pos, -1);;
}
- ast_log(LOG_WARNING, "No such peer '%s'\n", name);
+ ast_log(LOG_WARNING, "No such peer '%s'\n", peer_name);
return 0;
}
@@ -6211,7 +6263,6 @@
{
/* Schedule sending the authentication failure in one second, to prevent
guessing */
- ast_mutex_lock(&iaxsl[callno]);
if (iaxs[callno]) {
iaxs[callno]->authfail = failcode;
if (delayreject) {
@@ -6221,7 +6272,6 @@
} else
auth_reject((void *)(long)callno);
}
- ast_mutex_unlock(&iaxsl[callno]);
return 0;
}
@@ -7449,8 +7499,15 @@
/* Ignore if it's already up */
if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD))
break;
- if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr)
+ if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
check_provisioning(&sin, fd, ies.serviceident, ies.provver);
+ ast_mutex_lock(&iaxsl[fr->callno]);
+ if (!iaxs[fr->callno]) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
+ return 1;
+ }
+ }
/* If we're in trunk mode, do it now, and update the trunk number in our frame before continuing */
if (ast_test_flag(iaxs[fr->callno], IAX_TRUNK)) {
int new_callno;
@@ -7840,6 +7897,10 @@
ast_log(LOG_WARNING,
"I don't know how to authenticate %s to %s\n",
ies.username ? ies.username : "<unknown>", ast_inet_ntoa(iaxs[fr->callno]->addr.sin_addr));
+ }
+ if (!iaxs[fr->callno]) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
+ return 1;
}
break;
case IAX_COMMAND_AUTHREP:
@@ -8101,21 +8162,44 @@
if (delayreject)
send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
if (register_verify(fr->callno, &sin, &ies)) {
+ if (!iaxs[fr->callno]) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
+ return 1;
+ }
/* Send delayed failure */
auth_fail(fr->callno, IAX_COMMAND_REGREJ);
break;
+ }
+ if (!iaxs[fr->callno]) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
+ return 1;
}
if ((ast_strlen_zero(iaxs[fr->callno]->secret) && ast_strlen_zero(iaxs[fr->callno]->inkeys)) ||
ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_AUTHENTICATED | IAX_STATE_UNCHANGED)) {
if (f.subclass == IAX_COMMAND_REGREL)
memset(&sin, 0, sizeof(sin));
- if (update_registry(iaxs[fr->callno]->peer, &sin, fr->callno, ies.devicetype, fd, ies.refresh))
+ if (update_registry(&sin, fr->callno, ies.devicetype, fd, ies.refresh))
ast_log(LOG_WARNING, "Registry error\n");
- if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr)
+ if (!iaxs[fr->callno]) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
+ return 1;
+ }
+ if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
check_provisioning(&sin, fd, ies.serviceident, ies.provver);
+ ast_mutex_lock(&iaxsl[fr->callno]);
+ if (!iaxs[fr->callno]) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
+ return 1;
+ }
+ }
break;
}
- registry_authrequest(iaxs[fr->callno]->peer, fr->callno);
+ registry_authrequest(fr->callno);
+ if (!iaxs[fr->callno]) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
+ return 1;
+ }
break;
case IAX_COMMAND_REGACK:
if (iax2_ack_registry(&ies, &sin, fr->callno))
@@ -10479,6 +10563,9 @@
}
}
+ if (ast_test_flag(peer, IAX_TEMPONLY))
+ destroy_peer(peer);
+
return 0;
}
Modified: team/russell/res_monkeys/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_jingle.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_jingle.c (original)
+++ team/russell/res_monkeys/channels/chan_jingle.c Thu Aug 16 12:41:14 2007
@@ -827,9 +827,7 @@
ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
/* Don't use ast_set_callerid() here because it will
* generate an unnecessary NewCallerID event */
- tmp->cid.cid_num = ast_strdup(i->cid_num);
tmp->cid.cid_ani = ast_strdup(i->cid_num);
- tmp->cid.cid_name = ast_strdup(i->cid_name);
if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
tmp->cid.cid_dnid = ast_strdup(i->exten);
tmp->priority = 1;
Modified: team/russell/res_monkeys/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_local.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_local.c (original)
+++ team/russell/res_monkeys/channels/chan_local.c Thu Aug 16 12:41:14 2007
@@ -453,8 +453,6 @@
ast_mutex_lock(&p->lock);
- p->chan->cid.cid_num = ast_strdup(p->owner->cid.cid_num);
- p->chan->cid.cid_name = ast_strdup(p->owner->cid.cid_name);
p->chan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis);
p->chan->cid.cid_ani = ast_strdup(p->owner->cid.cid_ani);
p->chan->cid.cid_pres = p->owner->cid.cid_pres;
Modified: team/russell/res_monkeys/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_mgcp.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_mgcp.c (original)
+++ team/russell/res_monkeys/channels/chan_mgcp.c Thu Aug 16 12:41:14 2007
@@ -1495,9 +1495,7 @@
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
- tmp->cid.cid_num = ast_strdup(i->cid_num);
tmp->cid.cid_ani = ast_strdup(i->cid_num);
- tmp->cid.cid_name = ast_strdup(i->cid_name);
if (!i->adsi)
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
Modified: team/russell/res_monkeys/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_misdn.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_misdn.c (original)
+++ team/russell/res_monkeys/channels/chan_misdn.c Thu Aug 16 12:41:14 2007
@@ -2319,6 +2319,15 @@
bc = p->bc;
+ if (bc) {
+ const char *tmp=pbx_builtin_getvar_helper(ast,"MISDN_USERUSER");
+ if (tmp) {
+ ast_log(LOG_NOTICE, "MISDN_USERUSER: %s\n", tmp);
+ strcpy(bc->uu, tmp);
+ bc->uulen=strlen(bc->uu);
+ }
+ }
+
MISDN_ASTERISK_TECH_PVT(ast) = NULL;
p->ast = NULL;
@@ -3206,16 +3215,10 @@
else
chan_misdn_log(1, 0, "misdn_new: no exten given.\n");
- if (callerid) {
- char *cid_name, *cid_num;
-
- ast_callerid_parse(callerid, &cid_name, &cid_num);
+ if (callerid)
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
- tmp->cid.cid_num = ast_strdup(cid_num);
tmp->cid.cid_ani = ast_strdup(cid_num);
- tmp->cid.cid_name = ast_strdup(cid_name);
- }
if (pipe(chlist->pipe) < 0)
ast_log(LOG_ERROR, "Pipe failed\n");
Modified: team/russell/res_monkeys/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_oss.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_oss.c (original)
+++ team/russell/res_monkeys/channels/chan_oss.c Thu Aug 16 12:41:14 2007
@@ -1036,9 +1036,7 @@
ast_string_field_set(c, language, o->language);
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
- c->cid.cid_num = ast_strdup(o->cid_num);
c->cid.cid_ani = ast_strdup(o->cid_num);
- c->cid.cid_name = ast_strdup(o->cid_name);
if (!ast_strlen_zero(ext))
c->cid.cid_dnid = ast_strdup(ext);
Modified: team/russell/res_monkeys/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_phone.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_phone.c (original)
+++ team/russell/res_monkeys/channels/chan_phone.c Thu Aug 16 12:41:14 2007
@@ -890,9 +890,7 @@
/* Don't use ast_set_callerid() here because it will
* generate a NewCallerID event before the NewChannel event */
- tmp->cid.cid_num = ast_strdup(i->cid_num);
tmp->cid.cid_ani = ast_strdup(i->cid_num);
- tmp->cid.cid_name = ast_strdup(i->cid_name);
i->owner = tmp;
ast_module_ref(ast_module_info->self);
Modified: team/russell/res_monkeys/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_sip.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_sip.c (original)
+++ team/russell/res_monkeys/channels/chan_sip.c Thu Aug 16 12:41:14 2007
@@ -4622,9 +4622,7 @@
/* Don't use ast_set_callerid() here because it will
* generate an unnecessary NewCallerID event */
- tmp->cid.cid_num = ast_strdup(i->cid_num);
tmp->cid.cid_ani = ast_strdup(i->cid_num);
- tmp->cid.cid_name = ast_strdup(i->cid_name);
if (!ast_strlen_zero(i->rdnis))
tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
@@ -18627,7 +18625,7 @@
ast_string_field_build(p, our_contact, "Transfer <sip:%s@%s%s%s>", extension, host, port ? ":" : "", port ? port : "");
transmit_response_reliable(p, "302 Moved Temporarily", &p->initreq);
- sip_scheddestroy(p, 32000); /* Make sure we stop send this reply. */
+ sip_scheddestroy(p, SIP_TRANS_TIMEOUT); /* Make sure we stop send this reply. */
sip_alreadygone(p);
/* hangup here */
return 0;
Modified: team/russell/res_monkeys/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_skinny.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_skinny.c (original)
+++ team/russell/res_monkeys/channels/chan_skinny.c Thu Aug 16 12:41:14 2007
@@ -3229,9 +3229,7 @@
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
- tmp->cid.cid_num = ast_strdup(l->cid_num);
tmp->cid.cid_ani = ast_strdup(l->cid_num);
- tmp->cid.cid_name = ast_strdup(l->cid_name);
tmp->priority = 1;
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
Modified: team/russell/res_monkeys/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/chan_zap.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/chan_zap.c (original)
+++ team/russell/res_monkeys/channels/chan_zap.c Thu Aug 16 12:41:14 2007
@@ -5616,16 +5616,12 @@
/* Don't use ast_set_callerid() here because it will
* generate a needless NewCallerID event */
#ifdef PRI_ANI
- tmp->cid.cid_num = ast_strdup(i->cid_num);
- tmp->cid.cid_name = ast_strdup(i->cid_name);
if (!ast_strlen_zero(i->cid_ani))
tmp->cid.cid_ani = ast_strdup(i->cid_ani);
else
tmp->cid.cid_ani = ast_strdup(i->cid_num);
#else
- tmp->cid.cid_num = ast_strdup(i->cid_num);
tmp->cid.cid_ani = ast_strdup(i->cid_num);
- tmp->cid.cid_name = ast_strdup(i->cid_name);
#endif
tmp->cid.cid_pres = i->callingpres;
tmp->cid.cid_ton = i->cid_ton;
@@ -6083,6 +6079,7 @@
ast_hangup(chan);
return NULL;
} else if (res) {
+ ast_debug(1,"waitfordigit returned '%c' (%d), timeout = %d\n", res, res, timeout);
exten[len++]=res;
exten[len] = '\0';
}
Modified: team/russell/res_monkeys/channels/misdn/ie.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/misdn/ie.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/misdn/ie.c (original)
+++ team/russell/res_monkeys/channels/misdn/ie.c Thu Aug 16 12:41:14 2007
@@ -1348,7 +1348,7 @@
if (MISDN_IE_DEBG) printf(" protocol=%d user-user%s\n", protocol, debug);
- l = user_len;
+ l = user_len+1;
p = msg_put(msg, l+3);
if (nt)
*ntmode = p+1;
@@ -1356,7 +1356,7 @@
qi->QI_ELEMENT(useruser) = p - (unsigned char *)qi - sizeof(Q931_info_t);
p[0] = IE_USER_USER;
p[1] = l;
- p[2] = 0x80 + protocol;
+ p[2] = protocol;
memcpy(p+3, user, user_len);
}
#endif
Modified: team/russell/res_monkeys/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/channels/misdn/isdn_msg_parser.c?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/channels/misdn/isdn_msg_parser.c (original)
+++ team/russell/res_monkeys/channels/misdn/isdn_msg_parser.c Thu Aug 16 12:41:14 2007
@@ -797,6 +797,12 @@
enc_ie_cause(&disconnect->CAUSE, msg, (nt)?1:0, bc->out_cause,nt,bc);
if (nt) enc_ie_progress(&disconnect->PROGRESS, msg, 0, nt?1:5, 8 ,nt,bc);
+
+ if (bc->uulen) {
+ int protocol=4;
+ enc_ie_useruser(&disconnect->USER_USER, msg, protocol, bc->uu, bc->uulen, nt,bc);
+ cb_log(1,bc->port,"ENCODING USERUESRINFO:%s\n",bc->uu);
+ }
#ifdef DEBUG
printf("Building DISCONNECT Msg\n");
@@ -867,6 +873,12 @@
if (bc->out_cause>= 0)
enc_ie_cause(&release->CAUSE, msg, nt?1:0, bc->out_cause, nt,bc);
+
+ if (bc->uulen) {
+ int protocol=4;
+ enc_ie_useruser(&release->USER_USER, msg, protocol, bc->uu, bc->uulen, nt,bc);
+ cb_log(1,bc->port,"ENCODING USERUESRINFO:%s\n",bc->uu);
+ }
#ifdef DEBUG
printf("Building RELEASE Msg\n");
@@ -917,6 +929,12 @@
release_complete=(RELEASE_COMPLETE_t*)((msg->data+HEADER_LEN));
enc_ie_cause(&release_complete->CAUSE, msg, nt?1:0, bc->out_cause, nt,bc);
+
+ if (bc->uulen) {
+ int protocol=4;
+ enc_ie_useruser(&release_complete->USER_USER, msg, protocol, bc->uu, bc->uulen, nt,bc);
+ cb_log(1,bc->port,"ENCODING USERUESRINFO:%s\n",bc->uu);
+ }
#ifdef DEBUG
printf("Building RELEASE_COMPLETE Msg\n");
Modified: team/russell/res_monkeys/include/asterisk/ael_structs.h
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/include/asterisk/ael_structs.h?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/include/asterisk/ael_structs.h (original)
+++ team/russell/res_monkeys/include/asterisk/ael_structs.h Thu Aug 16 12:41:14 2007
@@ -25,6 +25,8 @@
#ifndef _ASTERISK_AEL_STRUCTS_H
#define _ASTERISK_AEL_STRUCTS_H
+#include "pval.h"
+
#if !defined(SOLARIS) && !defined(__CYGWIN__)
/* #include <err.h> */
#else
@@ -46,118 +48,15 @@
# endif
-typedef enum {
- PV_WORD, /* an ident, string, name, label, etc. A user-supplied string. */ /* 0 */
- PV_MACRO, /* 1 */
- PV_CONTEXT, /* 2 */
- PV_MACRO_CALL, /* 3 */
- PV_APPLICATION_CALL, /* 4 */
- PV_CASE, /* 5 */
- PV_PATTERN, /* 6 */
- PV_DEFAULT, /* 7 */
- PV_CATCH, /* 8 */
- PV_SWITCHES, /* 9 */
- PV_ESWITCHES, /* 10 */
- PV_INCLUDES, /* 11 */
- PV_STATEMENTBLOCK, /* 12 */
- PV_VARDEC, /* you know, var=val; */ /* 13 */
- PV_GOTO, /* 14 */
- PV_LABEL, /* 15 */
- PV_FOR, /* 16 */
- PV_WHILE, /* 17 */
- PV_BREAK, /* 18 */
- PV_RETURN, /* 19 */
- PV_CONTINUE, /* 20 */
- PV_IF, /* 21 */
- PV_IFTIME, /* 22 */
- PV_RANDOM, /* 23 */
- PV_SWITCH, /* 24 */
- PV_EXTENSION, /* 25 */
- PV_IGNOREPAT, /* 26 */
- PV_GLOBALS, /* 27 */
- PV_LOCALVARDEC, /* you know, local var=val; */ /* 28 */
-
-} pvaltype;
-
-/* why this horrible mess? It's always been a tradeoff-- tons of structs,
- each storing it's specific lists of goodies, or a 'simple' single struct,
- with lots of fields, that catches all uses at once. Either you have a long
- list of struct names and subnames, or you have a long list of field names,
- and where/how they are used. I'm going with a single struct, using unions
- to reduce storage. Some simple generalizations, and a long list of types,
- and a book about what is used with what types.... Sorry!
-*/
-
-struct pval
-{
- pvaltype type;
- int startline;
- int endline;
- int startcol;
- int endcol;
- char *filename;
-
- union
- {
- char *str; /* wow, used almost everywhere! */
- struct pval *list; /* used in SWITCHES, ESWITCHES, INCLUDES, STATEMENTBLOCK, GOTO */
- struct pval *statements;/* used in EXTENSION */
- char *for_init; /* used in FOR */
- } u1;
- struct pval *u1_last; /* to build in-order lists -- looks like we only need one */
-
- union
- {
- struct pval *arglist; /* used in macro_call, application_call, MACRO def, also attached to PWORD, the 4 timevals for includes */
- struct pval *statements; /* used in case, default, catch, while's statement, CONTEXT elements, GLOBALS */
- char *val; /* used in VARDEC */
- char *for_test; /* used in FOR */
- int label_in_case; /* a boolean for LABELs */
- struct pval *goto_target; /* used in GOTO */
- } u2;
-
- union
- {
- char *for_inc; /* used in FOR */
- struct pval *else_statements; /* used in IF */
- struct pval *macro_statements; /* used in MACRO */
- int abstract; /* used for context */
- char *hints; /* used in EXTENSION */
- int goto_target_in_case; /* used in GOTO */
- struct ael_extension *compiled_label;
- } u3;
-
- union
- {
- struct pval *for_statements; /* used in PV_FOR */
- int regexten; /* used in EXTENSION */
- } u4;
-
- struct pval *next; /* the pval at the end of this ptr will ALWAYS be of the same type as this one!
- EXCEPT for objects of the different types, that are in the same list, like contexts & macros, etc */
-
- struct pval *dad; /* the 'container' of this struct instance */
- struct pval *prev; /* the opposite of the 'next' pointer */
-} ;
-
-
-typedef struct pval pval;
-
#if 0
+#endif
+void ael2_semantic_check(pval *item, int *errs, int *warns, int *notes);
pval *npval(pvaltype type, int first_line, int last_line, int first_column, int last_column);
-void linku1(pval *head, pval *tail);
-void print_pval_list(FILE *f, pval *item, int depth);
-void print_pval(FILE *f, pval *item, int depth);
-void ael2_semantic_check(pval *item, int *errs, int *warns, int *notes);
-struct pval *find_label_in_current_context(char *exten, char *label);
-struct pval *find_label_in_current_extension(char *label);
-int count_labels_in_current_context(char *label);
-struct pval *find_label_in_current_db(char *context, char *exten, char *label);
+pval *linku1(pval *head, pval *tail);
void ael2_print(char *fname, pval *tree);
-#endif
struct pval *ael2_parse(char *fname, int *errs); /* in ael.flex */
void destroy_pval(pval *item);
-
+
extern char *prev_word; /* in ael.flex */
#ifndef YY_TYPEDEF_YY_SCANNER_T
Modified: team/russell/res_monkeys/include/asterisk/ast_expr.h
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/include/asterisk/ast_expr.h?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/include/asterisk/ast_expr.h (original)
+++ team/russell/res_monkeys/include/asterisk/ast_expr.h Thu Aug 16 12:41:14 2007
@@ -19,7 +19,6 @@
#ifndef _ASTERISK_EXPR_H
#define _ASTERISK_EXPR_H
#ifndef STANDALONE
-#include "asterisk/channel.h"
#endif
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
Modified: team/russell/res_monkeys/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/include/asterisk/channel.h?view=diff&rev=79723&r1=79722&r2=79723
==============================================================================
--- team/russell/res_monkeys/include/asterisk/channel.h (original)
+++ team/russell/res_monkeys/include/asterisk/channel.h Thu Aug 16 12:41:14 2007
@@ -1473,7 +1473,7 @@
\param reason The integer argument, usually taken from AST_CONTROL_ macros
\return char pointer explaining the code
*/
-char *ast_channel_reason2str(int reason);
+const char *ast_channel_reason2str(int reason);
#if defined(__cplusplus) || defined(c_plusplus)
}
Modified: team/russell/res_monkeys/include/asterisk/pbx.h
URL: http://svn.digium.com/view/asterisk/team/russell/res_monkeys/include/asterisk/pbx.h?view=diff&rev=79723&r1=79722&r2=79723
[... 9272 lines stripped ...]
More information about the asterisk-commits
mailing list