From: Olle Johansson Date: Sat, 5 May 2007 08:05:38 +0000 (+0000) Subject: - Adding some missing spaces X-Git-Tag: 1.6.0-beta1~3^2~2740 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d326d84ae0791b670a8855de3731f3dde025f0f3;p=thirdparty%2Fasterisk.git - 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 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index d4f2558f8a..41234b8e22 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; jexten); 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; jexten); 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)) { */