summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2011-12-08 16:24:29 +0000
committerTerry Wilson <twilson@digium.com>2011-12-08 16:24:29 +0000
commite279b30f5a160784942f570a590c81b605849223 (patch)
tree929cdfd7ffba6ad703fd34e9a401fddc4bf98edd /channels
parent5952117559fdb6fb22c9415ba9c1a75e1d9e205b (diff)
Don't crash on INFO automon request with no channel
AST-2011-014. When automon was enabled in features.conf, it was possible to crash Asterisk by sending an INFO request if no channel had been created yet. (closes issue ASTERISK-18805) ........ Merged revisions 347530 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2 ........ Merged revisions 347531 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 347532 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 3bbe11a67..edf5018cf 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -19192,11 +19192,18 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
per device. I don't want incoming callers to record calls in my
pbx.
*/
- /* first, get the feature string, if it exists */
+
struct ast_call_feature *feat;
int j;
struct ast_frame f = { AST_FRAME_DTMF, };
+ if (!p->owner) { /* not a PBX call */
+ transmit_response(p, "481 Call leg/transaction does not exist", req);
+ sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+ return;
+ }
+
+ /* first, get the feature string, if it exists */
ast_rdlock_call_features();
feat = ast_find_call_feature("automon");
if (!feat || ast_strlen_zero(feat->exten)) {