Hi :
I am trying to use JSR-309 SignalDetector to detect user Input DTMF, the digit pattern that user input can be any digit number up to ten and end with # key.
According to RFC 2897 MGCP Advanced Audio Package document which reference digit pattern syntax on section 7.1.14 of megaco document, the DigitMap Syntax can compose of
the letter "x" which is used as a wildcard , designating any event corresponding to symbols in the range "0"-"9".
the dot symbol "." stands for zero or more repetitions of the event selector (event, range of events, set of alternative events, or wildcard) that precedes it.
I am using MSS-1.8.0_Jboss5.1 and MMS-3.0.0.CR1 . My code is outline as follow:
/////////////////////////////////////////////////////////////////
MediaGroup mg = ms.createMediaGroup(MediaGroup.PLAYER_SIGNALDETECTOR);
sipSession.setAttribute("MEDIAGROUP", mg);
mySignalDetector = mg.getSignalDetector();
mySignalDetector.addListener(new MySignalDetectorListener());
Parameters collectOptions = msControlFactory.createParameters();
collectOptions.put(SignalDetector.PROMPT, URI.create(“pathToAudioWaveFile”));
collectOptions.put(SignalDetector.PATTERN[0],
"x.#");
collectOptions.put(SignalDetector.ENABLED_EVENTS, new
EventType[] SignalDetectorEvent.PATTERN_MATCHED[0]});
Parameter[] patterns =
{ SignalDetector.PATTERN[0]
};
mySignalDetector.receiveSignals(-1,
patterns, new RTC[] {MediaGroup.SIGDET_STOPPLAY},
collectOptions);
///////////////////////////////////////////////////////////////////
The captured mgcp protocol message:
RQNT 318933471 mobicents/ivr/1...@127.0.0.1:2427 MGCP 1.0
X:2
S:AU/pc(dp=x.# ip=file:///F:/voiceFiles/pressAnyDigit.wav)
R:AU/oc (N),AU/of (N)
--------------------------
200 318933471 Success
-------------------------------
The problem is Media Server does not send Notify to delivered SignalDetectorEvent, even user input DTMF that is matched with the pattern.
I try to test with each special digitMap character , such as dot symbol "."; the only letter "x"
all of following pattern are not work:
“[0-9].”
“xxxx”
I try these digit patterns, they work very well
“\\d+#”
“\d{10}”
But with these patterns :
“\d{4,10}”
“\d{10}||\d{1,9}#”
The media server throw MgcpCommandException at
org.mobicents.media.server.mgcp.tx.cmd.NotificationRequestCmd$Request.perform(NotificationRequestCmd.java:153)
The captured mgcp messages is:
RQNT 579995869 mobicents/ivr/1...@127.0.0.1:2427 MGCP 1.0
X:3
S:AU/pc(dp=\d{10}||\d{1,10}# ip=file:///F:/voiceFiles/pressAnyDigit.wav)
R:AU/oc (N),AU/of (N)
Response:
512 579995869 10}# ip=file:
The transaction could not be executed, error response code: 512
Response String: 10}# ip=file:
It is obvious that when a comma appear in the digitPattern of SignalRequests parameter, the media server would be wrong parsing dp symbol.
Is there any method to specify min-max digits without causing parsing error?
Regards,
Anake