summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-10-06 21:09:05 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-10-06 21:09:05 +0000
commit63b165dbb98c65a3e0b6271d9221e045685bd986 (patch)
treee9c0dfb82bcb18454c0f9a712acbe7933fc7ad81 /channels
parent9b0a2e5231dcff56f68b5e629f059260885665e0 (diff)
Merged revisions 146799 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r146799 | tilghman | 2008-10-06 15:52:04 -0500 (Mon, 06 Oct 2008) | 8 lines Dialplan functions should not actually return 0, unless they have modified the workspace. To signal an error (and no change to the workspace), -1 should be returned instead. (closes issue #13340) Reported by: kryptolus Patches: 20080827__bug13340__2.diff.txt uploaded by Corydon76 (license 14) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c4
-rw-r--r--channels/chan_sip.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 2714bb95a..9282aed89 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -11899,7 +11899,11 @@ static int function_iaxpeer(struct ast_channel *chan, const char *cmd, char *dat
}
if((codec = ast_codec_pref_index(&peer->prefs, atoi(codecnum)))) {
ast_copy_string(buf, ast_getformatname(codec), len);
+ } else {
+ buf[0] = '\0';
}
+ } else {
+ buf[0] = '\0';
}
peer_unref(peer);
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 4bebce867..df9468462 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -14959,7 +14959,11 @@ static int function_sippeer(struct ast_channel *chan, const char *cmd, char *dat
codecnum = strsep(&codecnum, "]"); /* trim trailing ']' if any */
if((codec = ast_codec_pref_index(&peer->prefs, atoi(codecnum)))) {
ast_copy_string(buf, ast_getformatname(codec), len);
+ } else {
+ buf[0] = '\0';
}
+ } else {
+ buf[0] = '\0';
}
unref_peer(peer, "unref_peer from function_sippeer, just before return");