FreeTDM - Using ftdm_channel_wait with FTDM_EVENTS
Dear guys, I'm new to the list so first of all let me thank the FreeSWITCH developers for their great work. But now I must come to the point. I have an A104 Sangoma board and I'm developing an application based on FreeTDM library. I've started by using and modifying the examples "freeswitch/libs/freetdm/src/test*.c" and now I'm able to retreive and send the audio data from/to the board. I'm using the "ftdm_channel_wait" to know when I can read/write from the freetdm's queues and all seems to work well. But I have a big issue when I try to use "ftdm_channel_wait" with the flag "FTDM_EVENTS" (flags=(ftdm_wait_flags_t)FTDM_EVENTS). Basically, what happen is that the "ftdm_channel_wait(ftdmchan,&flags,-1)" never exits even if the channel receives DTMF or is been hung-up. I've also tried to use "ftdm_channel_command(ftdmchan,FTDM_COMMAND_ENABLE_DTMF_DETECT,NULL)" before the "ftdm_channel_wait" but nothing changed. Now, my questions are the following: 1. What kind of events can cause the exit of "ftdm_channel_wait" function? I've seen the "ftdm_event_type_t" that defines "FTDM_EVENT_DTMF" and "FTDM_EVENT_OOB". Is it the answer to my question? 2. Is there something that I need to do before call "ftdm_channel_wait" to enable the "events generation"? I hope to be in the right place for these questions. Otherwise, please let me know where I can find someone that can help me. I haven't put a lot in this mail because I wasn't really sure if this is the right mail-list but, of course, if you need more information and details to help me don't esitate to ask. Excuse me for my bad english. Have a nice day! Andrea
Hello, I think your question would be better suited to the freeswitch-dev mailing list given that is about C development with FreeSWITCH APIs, but I'll answer here anyways. 1. What kind of events can cause the exit of "ftdm_channel_wait" function?
I've seen the "ftdm_event_type_t" that defines "FTDM_EVENT_DTMF" and "FTDM_EVENT_OOB". Is it the answer to my question?
Events such as CAS/RBS events and DTMF events if you have hardware DTMF enabled (and your hardware supports it). Given that you are using Sangoma hardware, it should work if you have a hardware DTMF enabled in the wanpipe configuration files (ie /etc/wanpipe/wanpipe1.conf)
2. Is there something that I need to do before call "ftdm_channel_wait" to enable the "events generation"?
Did you call ftdm_span_start() to start the signaling thread on the span? Cheers, Moy *Moises Silva **Manager, Software Engineering*** msilva@sangoma.com Sangoma Technologies 100 Renfrew Drive, Suite 100, Markham, ON L3R 9R6 Canada t. +1 800 388 2475 (N. America) t. +1 905 474 1990 x128 f. +1 905 474 9223 **<http://www.sangoma.com/contact?utm_source=signature&utm_medium=email&utm_campaign=email+signatures> Products<http://sangoma.com/products?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures> | Solutions<http://sangoma.com/solutions?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures> | Events<http://sangoma.com/about_us/events?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures> | Contact<http://www.sangoma.com/contact?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures> | Wiki<http://wiki.sangoma.com/?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures> | Facebook<http://www.facebook.com/pages/Sangoma-VoIP-Cards/43578453335?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures> | Twitter<http://www.twitter.com/sangoma?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures>`| | YouTube<http://www.youtube.com/sangomatechnologies?utm_source=signature&utm_medium=email&utm_campaign=email%2Bsignatures>
Hello everybody and many thanks to Moy for its useful reply!
1. What kind of events can cause the exit of "ftdm_channel_wait" function? I've seen the "ftdm_event_type_t" that defines "FTDM_EVENT_DTMF" and "FTDM_EVENT_OOB". Is it the answer to my question?
Events such as CAS/RBS events and DTMF events if you have hardware DTMF enabled (and your hardware supports it). Given that you are using Sangoma hardware, it should work if you have a hardware DTMF enabled in the wanpipe configuration files (ie /etc/wanpipe/wanpipe1.conf)
I'm using an E1 PRI so, if I've correctly understood, CAS/RBS events don't exist. Regarding DTMF I've found some TDMV_HW_DTMF=NO in my wanpipe*.conf, now I will correct them to TDMV_HW_DTMF=YES and try again.
2. Is there something that I need to do before call "ftdm_channel_wait" to enable the "events generation"? Did you call ftdm_span_start() to start the signaling thread on the span?
Yes, of course! :) Thanks again. Best regards! Andrea
participants (2)
-
Andrea Coslovich
-
Moises Silva