hello,
I have done a small change about my problem of dtmf..
Index: AmDtmfDetector.h
===================================================================
--- AmDtmfDetector.h (revision 978)
+++ AmDtmfDetector.h (working copy)
@@ -127,7 +127,7 @@
* @param stop time when key was released
*/
virtual void registerKeyReleased(int event, Dtmf::EventSource source,
- const struct timeval& start, const struct timeval& stop) = 0;
+ const struct timeval& start, const struct timeval& stop, int evt) =
0;
/**
* Through this method the AmDtmfDetector receives events that was
* detected by specific detectors.
@@ -330,7 +330,7 @@
/**
* Send out pending event
*/
- void sendPending();
+ void sendPending(int evt = -1);
public:
/**
@@ -358,7 +358,9 @@
public AmKeyPressSink
{
private:
- static const int WAIT_TIMEOUT = 100; // miliseconds
+ static const int WAIT_TIMEOUT_PRESSED = 250; // miliseconds
+ static const int WAIT_TIMEOUT_RELEASED = 100; // miliseconds
+ int dtmfWaitTimeout ;
/**
* Session this class belongs to.
*/
@@ -397,7 +399,7 @@
* @param stop time when key was released
*/
void registerKeyReleased(int event, Dtmf::EventSource source,
- const struct timeval& start, const struct timeval& stop);
+ const struct timeval& start, const struct timeval& stop, int evt);
/**
* Through this method the AmDtmfDetector receives events that was
* detected by specific detectors.
Index: AmDtmfDetector.cpp
===================================================================
--- AmDtmfDetector.cpp (revision 996)
+++ AmDtmfDetector.cpp (working copy)
@@ -169,7 +169,7 @@
++stop.tv_sec;
stop.tv_usec -= 1000000;
}
- m_keysink->registerKeyReleased(evt->event(), Dtmf::SOURCE_SIP, start,
stop);
+ m_keysink->registerKeyReleased(evt->event(), Dtmf::SOURCE_SIP, start,
stop, -1 );
}
//
@@ -237,8 +237,9 @@
void AmDtmfDetector::registerKeyReleased(int event, Dtmf::EventSource
source,
const struct timeval& start,
- const struct timeval& stop)
+ const struct timeval& stop, int
evt)
{
+
// Old event has not been sent yet
// push out it now
if (m_eventPending && m_currentEvent != event)
@@ -255,6 +256,11 @@
m_sipEventReceived = true;
break;
case Dtmf::SOURCE_RTP:
+ if (evt==1)
+ {
+ dtmfWaitTimeout = WAIT_TIMEOUT_RELEASED;
+ DBG("AmRtpDtmfDetector::process: set timeout to %i \n ",
WAIT_TIMEOUT_RELEASED);
+ }
m_rtpEventReceived = true;
break;
case Dtmf::SOURCE_INBAND:
@@ -268,6 +274,8 @@
void AmDtmfDetector::registerKeyPressed(int event, Dtmf::EventSource type)
{
struct timeval tm;
+ dtmfWaitTimeout = WAIT_TIMEOUT_PRESSED;
+ DBG("registerKeyPressed: set timeout to %i \n ", WAIT_TIMEOUT_PRESSED);
gettimeofday(&tm, NULL);
if (!m_eventPending)
@@ -305,7 +313,7 @@
gettimeofday(&tm, NULL);
long delta_msec = (tm.tv_sec - m_lastReportTime.tv_sec) * 1000 +
(tm.tv_usec - m_lastReportTime.tv_usec) / 1000;
- if (delta_msec > WAIT_TIMEOUT)
+ if (delta_msec > dtmfWaitTimeout)
reportEvent();
}
}
@@ -36
2008/5/6 Stefan Sayer <[EMAIL PROTECTED]>:
>
>
> laurent schweizer wrote:
>
>> Hello Stefan,
>> I have tryed to upgrade time of WAIT_TIMEOUT to 250, but I have still
>> some problem with DTMF.
>> now my problem is that he see when you compose the same digit 2 times, he
>> see only 1 digits
>> any idee to solve this.
>>
> the WAIT_TIMEOUT should be set to 250 and decresed to e.g. 100 if packet
> with end flag (e) set is received. usually this should be done by properly
> using reportKeyPressed and reportKeyReleased methods, atm only
> reportKeyReleased is used from RTP detector.
>
> Stefan
>
> Laurent
>>
>>
>> 2008/4/13 Stefan Sayer <[EMAIL PROTECTED] <mailto:
>> [EMAIL PROTECTED]>>:
>>
>>
>> Hello Laurent,
>>
>> thanks for the trace.
>>
>> MAX_PACKET_WAIT concerns in-band DTMF. Here DTMF is as RTP payload.
>> If you filter for udp.dstport == 10040 and look at frames 8823 and
>> 8834, you will see that after the first DTMF 7 RTP packet, the other
>> side does not send anything for 200ms, and then sends very quickly 5
>> DTMF 7 RTP packets in a row.
>>
>> The DTMF detector is set to set the DTMF as detected, if it hasn't
>> received anything in a certain while, this is the WAIT_TIMEOUT
>> setting in AmDtmfDetector.h, its in milliseconds. If you set this to
>> 250 you will only detect one 7.
>>
>> The negative side of this is that after pressing a key it always
>> takes 250 ms to recognize that as key pressed (if no other key is
>> pressed).
>>
>> I might make the WAIT_TIMEOUT a config option though, and also
>> change it to make notice of the End Of Event flag and in that case
>> reduce the WAIT_TIMEOUT.
>>
>> Stefan
>>
>> laurent schweizer wrote:
>>
>> I have tryed to set a higher value for MAX_PACKET_WAIT but no
>> change.
>> attached to this email a ethereal file, the call with the DTMF
>> error is the last (start at packet number 8316 ) and I also
>> attach a text file with the logs of sems of this call.
>> as you can see the real number is 004178.... but sems receive
>> 0041778...
>> Laurent
>>
>> 2008/3/17, Stefan Sayer (JIRA) <[EMAIL PROTECTED]
>> <mailto:[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]
>>
>> <mailto:[EMAIL PROTECTED]>>>:
>>
>>
>> [
>>
>> http://tracker.iptel.org/browse/SEMS-28?page=comments#action_12708
>> ]
>>
>> Stefan Sayer commented on SEMS-28:
>> ----------------------------------
>>
>> can you add a tcpdump/ethereal trace?
>>
>> does setting AmRtpDtmfDetector::MAX_PACKET_WAIT in
>> AmDtmfDetector.h
>> to a higher value change anything on this?
>>
>> thanks
>>
>> > DTMF not correct,
>> > ------------------
>> >
>> > Key: SEMS-28
>> > URL: http://tracker.iptel.org/browse/SEMS-28
>> > Project: SEMS
>> > Issue Type: Bug
>> > Reporter: Laurent Schweizer
>> > Assigned To: Stefan Sayer
>> > Attachments: log_dtmf.txt
>> >
>> >
>> > sometimes (1 times for about 10 or 15 calls) I have a
>> composed
>> digit received as 2 digits.
>> >
>> > example for this log, I have composed the 0041787814950 and I
>> receive 00417878144950.
>> >
>> > for info, to do the test, I have stored the number in my
>> mobile
>> phone ( so he is each times composed identically )
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> If you think it was sent incorrectly contact one of the
>> administrators:
>> http://tracker.iptel.org/secure/Administrators.jspa
>> -
>> For more information on JIRA, see:
>> http://www.atlassian.com/software/jira
>>
>>
>>
>>
>>
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems