aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-31 16:14:18 +0000
committerautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-31 16:14:18 +0000
commit682da8bca1a8b7d4bc85b7fa025d878c308f9933 (patch)
tree622a456230a180452ff31ee764c76662207dba47
parent884e1bd51e23d3aa308b1d3a2026561c7029654c (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@66767 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_macro.c11
-rw-r--r--channels/chan_sip.c2
2 files changed, 7 insertions, 6 deletions
diff --git a/apps/app_macro.c b/apps/app_macro.c
index 75c2e3cf1..4002a8b00 100644
--- a/apps/app_macro.c
+++ b/apps/app_macro.c
@@ -266,22 +266,23 @@ static int macro_exec(struct ast_channel *chan, void *data)
while(ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) {
struct ast_context *c;
struct ast_exten *e;
+ runningapp[0] = '\0';
+ runningdata[0] = '\0';
/* What application will execute? */
if (ast_lock_contexts()) {
ast_log(LOG_WARNING, "Failed to lock contexts list\n");
- e = NULL;
} else {
for (c = ast_walk_contexts(NULL), e = NULL; c; c = ast_walk_contexts(c)) {
if (!strcmp(ast_get_context_name(c), chan->context)) {
if (ast_lock_context(c)) {
ast_log(LOG_WARNING, "Unable to lock context?\n");
- runningapp[0] = '\0';
- runningdata[0] = '\0';
} else {
e = find_matching_priority(c, chan->exten, chan->priority, chan->cid.cid_num);
- ast_copy_string(runningapp, ast_get_extension_app(e), sizeof(runningapp));
- ast_copy_string(runningdata, ast_get_extension_app_data(e), sizeof(runningdata));
+ if (e) { /* This will only be undefined for pbx_realtime, which is majorly broken. */
+ ast_copy_string(runningapp, ast_get_extension_app(e), sizeof(runningapp));
+ ast_copy_string(runningdata, ast_get_extension_app_data(e), sizeof(runningdata));
+ }
ast_unlock_context(c);
}
break;
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index f78d58583..812220415 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3081,7 +3081,7 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p
return &null_frame;
if (p->owner) {
/* We already hold the channel lock */
- if (f->frametype == AST_FRAME_VOICE) {
+ if (f && f->frametype == AST_FRAME_VOICE) {
if (f->subclass != p->owner->nativeformats) {
if (!(f->subclass & p->jointcapability)) {
ast_log(LOG_DEBUG, "Bogus frame of format '%s' received from '%s'!\n",