summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2007-05-05 08:05:38 +0000
committerOlle Johansson <oej@edvina.net>2007-05-05 08:05:38 +0000
commitd326d84ae0791b670a8855de3731f3dde025f0f3 (patch)
tree876d8f6c7a6ba2bb24acb56085aaf8c5b637cb6e /channels/chan_sip.c
parentf1ca07ea8b67608cd268323ea3a4f7b925c35994 (diff)
- Adding some missing spaces
- Correcting error messages - Disabling code that doesn't do anything - Making sure we always respond to this request, happily git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d4f2558f8..41234b8e2 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11642,41 +11642,54 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
ast_cdr_setuserfield(ast_bridged_channel(p->owner), c);
transmit_response(p, "200 OK", req);
} else {
- transmit_response(p, "403 Unauthorized", req);
+ transmit_response(p, "403 Forbidden", req);
}
return;
} else if (!ast_strlen_zero(c = get_header(req, "Record"))) {
+ /* INFO messages generated by some phones to start/stop recording
+ on phone calls.
+ OEJ: I think this should be something that is enabled/disabled
+ 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 = ast_find_call_feature("automon");
+ int j;
+ struct ast_frame f = { AST_FRAME_DTMF, };
if (!feat || ast_strlen_zero(feat->exten)) {
ast_log(LOG_WARNING,"Recording requested, but no One Touch Monitor registered. (See features.conf)\n");
- transmit_response(p, "415 Unsupported media type", req);
+ /* 403 means that we don't support this feature, so don't request it again */
+ transmit_response(p, "403 Forbidden", req);
return;
- } else {
- int j;
- struct ast_frame f = { AST_FRAME_DTMF, };
- f.len = 100;
- for (j=0; j<strlen(feat->exten); j++) {
- f.subclass = feat->exten[j];
- ast_queue_frame(p->owner, &f);
- if (sipdebug)
- ast_verbose("* DTMF-relay event received: %c\n", f.subclass);
- }
+ }
+ /* OEJ: Why is the DTMF code included in the record section? */
+ f.len = 100;
+ for (j=0; j<strlen(feat->exten); j++) {
+ f.subclass = feat->exten[j];
+ ast_queue_frame(p->owner, &f);
+ if (sipdebug)
+ ast_verbose("* DTMF-relay event received: %c\n", f.subclass);
}
-
- if (strcasecmp(c,"on")== 0) {
-
- ast_log(LOG_NOTICE,"Got a Request to Record the channel!\n");
+#ifdef DISABLED_CODE
+ /* And feat isn't used here - Is this code tested at all???
+ We just send a reply ...
+ */
+ if (strcasecmp(c, "on")== 0) {
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Got a Request to Record the channel!\n");
transmit_response(p, "200 OK", req);
return;
- } else if (strcasecmp(c,"off")== 0) {
-
- ast_log(LOG_NOTICE,"Got a Request to Stop Recording the channel\n");
+ } else if (strcasecmp(c, "off")== 0) {
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Got a Request to Stop Recording the channel\n");
transmit_response(p, "200 OK", req);
return;
}
+#endif
+ transmit_response(p, "200 OK", req);
+ return;
}
/* Other type of INFO message, not really understood by Asterisk */
/* if (get_msg_text(buf, sizeof(buf), req)) { */