summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorSteve Murphy <murf@digium.com>2007-05-04 16:37:23 +0000
committerSteve Murphy <murf@digium.com>2007-05-04 16:37:23 +0000
commit3ee0077f0410d80e9c4f40c5915c32d8dfed2c2c (patch)
tree807447442c345c8199708a01222b509950c043c4 /channels/chan_sip.c
parent1b15d8852d46c5810271619518dfd70488be14d0 (diff)
Added a small bit of code to support the SNOM 360's Record button. Made the find_feature func in res_features.c public, so I could use it to find the automon dial sequence as configured by the user. When the INFO packet has a Record: header with on/off, the sequence is sent as consecutive DTMF frames on the phone's channel, triggering the automon functionality. The user has to configure the automon in features.conf, and set up his dialplan accordingly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index db1b06324..919912853 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11645,6 +11645,38 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
transmit_response(p, "403 Unauthorized", req);
}
return;
+ } else if (!ast_strlen_zero(c = get_header(req, "Record"))) {
+ /* first, get the feature string, if it exists */
+ struct ast_call_feature *feat = find_feature("automon");
+
+ 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);
+ 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);
+ }
+ }
+
+ if (strcasecmp(c,"on")== 0) {
+
+ ast_log(LOG_NOTICE,"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");
+ 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)) { */