Module: kamailio
Branch: master
Commit: 120a71bec0ee7a07f5f39262a038977f27bc7073
URL:
https://github.com/kamailio/kamailio/commit/120a71bec0ee7a07f5f39262a038977…
Author: Richard Fuchs <rfuchs(a)sipwise.com>
Committer: Richard Fuchs <rfuchs(a)sipwise.com>
Date: 2019-11-22T09:37:02-05:00
rtpengine: add play_dtmf() command
---
Modified: src/modules/rtpengine/rtpengine.c
Modified: src/modules/rtpengine/rtpengine.h
---
Diff:
https://github.com/kamailio/kamailio/commit/120a71bec0ee7a07f5f39262a038977…
Patch:
https://github.com/kamailio/kamailio/commit/120a71bec0ee7a07f5f39262a038977…
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 6e436083ec..9ccf8c4a74 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -138,6 +138,7 @@ static const char *command_strings[] = {
[OP_STOP_FORWARDING] = "stop forwarding",
[OP_PLAY_MEDIA] = "play media",
[OP_STOP_MEDIA] = "stop media",
+ [OP_PLAY_DTMF] = "play DTMF",
};
struct minmax_mos_stats {
@@ -197,6 +198,7 @@ static int start_forwarding_f(struct sip_msg *, char *, char *);
static int stop_forwarding_f(struct sip_msg *, char *, char *);
static int play_media_f(struct sip_msg *, char *, char *);
static int stop_media_f(struct sip_msg *, char *, char *);
+static int play_dtmf_f(struct sip_msg *, char *, char *);
static int rtpengine_answer1_f(struct sip_msg *, char *, char *);
static int rtpengine_offer1_f(struct sip_msg *, char *, char *);
static int rtpengine_delete1_f(struct sip_msg *, char *, char *);
@@ -376,6 +378,9 @@ static cmd_export_t cmds[] = {
{"stop_media", (cmd_function)stop_media_f, 0,
0, 0,
ANY_ROUTE},
+ {"play_dtmf", (cmd_function)play_dtmf_f, 1,
+ fixup_spve_null, 0,
+ ANY_ROUTE},
{"rtpengine_offer", (cmd_function)rtpengine_offer1_f, 0,
0, 0,
ANY_ROUTE},
@@ -3839,6 +3844,12 @@ stop_media_f(struct sip_msg* msg, char *str1, char *str2)
return rtpengine_generic_f(msg, str1, OP_STOP_MEDIA);
}
+static int
+play_dtmf_f(struct sip_msg* msg, char *str1, char *str2)
+{
+ return rtpengine_generic_f(msg, str1, OP_PLAY_DTMF);
+}
+
static int
start_forwarding_f(struct sip_msg* msg, char *str1, char *str2)
{
diff --git a/src/modules/rtpengine/rtpengine.h b/src/modules/rtpengine/rtpengine.h
index b5314c2c35..1e55cf244e 100644
--- a/src/modules/rtpengine/rtpengine.h
+++ b/src/modules/rtpengine/rtpengine.h
@@ -46,6 +46,7 @@ enum rtpe_operation {
OP_STOP_FORWARDING,
OP_PLAY_MEDIA,
OP_STOP_MEDIA,
+ OP_PLAY_DTMF,
OP_ANY,
};