sending DTMF RFC 2833

symeon.mattes symeon.mattes at gmail.com
Mon Nov 23 08:24:15 PST 2015


Hi,

I found in  gst-plugins-farsight
<http://www.freedesktop.org/software/farstream/releases/obsolete/gst-plugins-farsight/>  
in ./tests/dtmfsend.c an example of how to send dtmf signals. The code is
very similar to what I wrote before i.e.

pipeline_sending=gst_pipeline_new("sending-data"); 
    dtmf = gst_element_factory_make("rtpdtmfsrc",NULL); 
    udpsink = gst_element_factory_make("udpsink",NULL); 
   
g_object_set(G_OBJECT(udpsink),"port",remotePort.intValue,"host",remoteAddress.UTF8String,"bind-port",5004,NULL); 
    
    gst_bin_add_many(GST_BIN(pipeline_sending), dtmf,udpsink,NULL); 
gst_element_link_many(dtmf,udpsink,NULL); 

    GstStructure *structure = gst_structure_new("dtmf-event", 
                                  "type",G_TYPE_INT,1, 
                                  "number",G_TYPE_INT,4, 
                                  "volume",G_TYPE_INT,25, 
                                  "start",G_TYPE_BOOLEAN,TRUE,NULL); 
    GstEvent *event =
gst_event_new_custom(GST_EVENT_CUSTOM_UPSTREAM,structure); 
    gst_element_send_event(pipeline_sending,event);

I've tried also what olivier wrote i.e. 

    pipeline_sending=gst_pipeline_new("sending-data");
    micinput = gst_element_factory_make("osxaudiosrc","snd-microphone");
    queue[0] = gst_element_factory_make ("queue", NULL);
    audioconvert = gst_element_factory_make("audioconvert",NULL);
    audioresample = gst_element_factory_make("audioresample",NULL);
    alawenc = gst_element_factory_make("alawenc","snd-encoder");
    rtppcmapay = gst_element_factory_make("rtppcmapay",NULL);
    queue[1] = gst_element_factory_make ("queue", NULL);
    dtmf_input=gst_element_factory_make("rtpdtmfsrc",NULL);
    rtpdtmfmux=gst_element_factory_make("rtpdtmfmux",NULL);
    udpsink = gst_element_factory_make("udpsink",NULL);
   
g_object_set(G_OBJECT(udpsink),"port",remotePort.intValue,"host",remoteAddress.UTF8String,"bind-port",5004,NULL);
    
   
gst_bin_add_many(GST_BIN(pipeline_sending),micinput,queue[0],audioconvert,audioresample,alawenc,rtppcmapay,queue[1],udpsink,rtpdtmfmux,dtmf_input,NULL);
   
gst_element_link_many(micinput,audioconvert,audioresample,alawenc,rtppcmapay,queue[0],NULL);
    gst_element_link_many(rtpdtmfmux,udpsink,NULL);
    gst_element_link_many(dtmf_input,queue[1],NULL);

    
    gst_element_link_pads(queue[0],"src",rtpdtmfmux,"sink_0");
    gst_element_link_pads(queue[1],"src",rtpdtmfmux,"priority_sink_0");
    
And then I sent an event:
    GST_DEBUG_OBJECT (pipeline_sending, "sending dtmf event..");
    GstStructure *structure = gst_structure_new("dtmf-event",
                                                "type",G_TYPE_INT,1, //1
corresponds to gst rtp dtmf type event
                                                "number",G_TYPE_INT,(gint)
dtmfNumber,
                                                "volume",G_TYPE_INT,(gint)
10,
                                               
"start",G_TYPE_BOOLEAN,(gboolean) TRUE,NULL);
    GstEvent *event =
gst_event_new_custom(GST_EVENT_CUSTOM_UPSTREAM,structure);
    if (gst_element_send_event(pipeline_sending,event))
        GST_DEBUG_OBJECT (pipeline_sending, "The event has been handled..");
    else
        GST_ERROR_OBJECT (pipeline_sending, "The event was not handled.");


The gst_element_send_event seems to return true, which means that the event
has been handled. However I cannot see any dtmf rtpevent in my network
traces (I'm using wireshark). Is there any way I could debug it further? I'm
not so sure if rtpdtmfsrc or udpsrc has any issue.


Thanks in advance




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/sending-DTMF-RFC-2833-tp4674573p4674609.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list