Browse code

rtpengine: add play_dtmf() command

Richard Fuchs authored on 22/11/2019 14:37:02
Showing 2 changed files
... ...
@@ -138,6 +138,7 @@ static const char *command_strings[] = {
138 138
 	[OP_STOP_FORWARDING]	= "stop forwarding",
139 139
 	[OP_PLAY_MEDIA]		= "play media",
140 140
 	[OP_STOP_MEDIA]		= "stop media",
141
+	[OP_PLAY_DTMF]		= "play DTMF",
141 142
 };
142 143
 
143 144
 struct minmax_mos_stats {
... ...
@@ -197,6 +198,7 @@ static int start_forwarding_f(struct sip_msg *, char *, char *);
197 198
 static int stop_forwarding_f(struct sip_msg *, char *, char *);
198 199
 static int play_media_f(struct sip_msg *, char *, char *);
199 200
 static int stop_media_f(struct sip_msg *, char *, char *);
201
+static int play_dtmf_f(struct sip_msg *, char *, char *);
200 202
 static int rtpengine_answer1_f(struct sip_msg *, char *, char *);
201 203
 static int rtpengine_offer1_f(struct sip_msg *, char *, char *);
202 204
 static int rtpengine_delete1_f(struct sip_msg *, char *, char *);
... ...
@@ -376,6 +378,9 @@ static cmd_export_t cmds[] = {
376 378
 	{"stop_media",		(cmd_function)stop_media_f, 		0,
377 379
 		0, 0,
378 380
 		ANY_ROUTE},
381
+	{"play_dtmf",		(cmd_function)play_dtmf_f, 		1,
382
+		fixup_spve_null, 0,
383
+		ANY_ROUTE},
379 384
 	{"rtpengine_offer",	(cmd_function)rtpengine_offer1_f,	0,
380 385
 		0, 0,
381 386
 		ANY_ROUTE},
... ...
@@ -3839,6 +3844,12 @@ stop_media_f(struct sip_msg* msg, char *str1, char *str2)
3839 3844
 	return rtpengine_generic_f(msg, str1, OP_STOP_MEDIA);
3840 3845
 }
3841 3846
 
3847
+static int
3848
+play_dtmf_f(struct sip_msg* msg, char *str1, char *str2)
3849
+{
3850
+	return rtpengine_generic_f(msg, str1, OP_PLAY_DTMF);
3851
+}
3852
+
3842 3853
 static int
3843 3854
 start_forwarding_f(struct sip_msg* msg, char *str1, char *str2)
3844 3855
 {
... ...
@@ -46,6 +46,7 @@ enum rtpe_operation {
46 46
         OP_STOP_FORWARDING,
47 47
         OP_PLAY_MEDIA,
48 48
         OP_STOP_MEDIA,
49
+        OP_PLAY_DTMF,
49 50
 
50 51
         OP_ANY,
51 52
 };