Alerting App aways play the same msg audio

39 views
Skip to first unread message

Rafael Soares

unread,
Oct 5, 2011, 11:09:16 AM10/5/11
to mobicent...@googlegroups.com
Hello guys!

I'm playing with RHQ and alerting app on Mobicents. The RHQ integration works fine but sounds like the audio played on incoming call is always the same. I mean, It not say the real message fired on RHQ Alert. I tried with http://localhost:8080/alerting-app/send-alert-test.html sample with different text messages but no success too. The audio is the same even for different text msg.

I'm using mss-1.6.0.FINAL-jboss-jdk6-5.1.0.GA bundle with sip servlet server and media server. I'm using is Twinkle for tests.

Any idea?

Thanks.
____________________________
Rafael Torres Coelho Soares
rafa...@gmail.com
http://rafaeltuelho.wordpress.com
Brasília - DF - Brasil

Jean Deruelle

unread,
Oct 5, 2011, 11:49:57 AM10/5/11
to mobicent...@googlegroups.com
Hey Rafael,

Yes this is normal, because RHT alerting text was kind of cryptic and the application was a PoC demo, we played the same message always however you can remove that limitation and play the real RHQ message by removing line 84 of PhoneAlertServlet (http://code.google.com/p/mobicents/source/browse/tags/servers/sip-servlets/release-1.6.0.FINAL/sip-servlets-examples/alerting-app/sip-servlets/src/main/java/org/mobicents/servlet/sip/alerting/PhoneAlertServlet.java#84)
Regarding the SMS, you need to configure a provider, I tried multiple ones with varied success but the one I got most success with even when presenting abroad was Esendex (http://www.esendex.us/), you need to configure your settings in sip.xml, http://code.google.com/p/mobicents/source/browse/tags/servers/sip-servlets/release-1.6.0.FINAL/sip-servlets-examples/alerting-app/sip-servlets/src/main/sipapp/WEB-INF/web.xml
or you can add your own provider to integrate with your favorite SMS provider.

Jean

Rafael Soares

unread,
Oct 5, 2011, 1:42:38 PM10/5/11
to mobicent...@googlegroups.com
Hi.

Thanks for pointing that! I commented out that line. But now when the message comes from RHQ the media-server cant convert it to audio. :-(

The following error appears on media-server log:

"14:20:54,448 WARN  [MgcpMessageParser] Unrecognized parameter: ))
14:20:54,448 INFO  [NotificationRequestAction] Request TX= 278561039, Endpoint = /mobicents/media/IVR/6...@127.0.0.1:2427
14:20:54,448 ERROR [MgcpController] Unexpected error during processing,Caused by
java.lang.StringIndexOutOfBoundsException: String index out of range: -4
    at java.lang.String.substring(String.java:1937)
    at org.mobicents.media.server.ctrl.mgcp.evt.ann.AnnSignalFactory$TTSAnnSignal.<init>(AnnSignalFactory.java:106)
    at org.mobicents.media.server.ctrl.mgcp.evt.ann.AnnSignalFactory.getInstance(AnnSignalFactory.java:80)
    at org.mobicents.media.server.ctrl.mgcp.evt.MgcpPackage.getGenerator(MgcpPackage.java:165)
    at org.mobicents.media.server.ctrl.mgcp.NotificationRequestAction.call(NotificationRequestAction.java:197)
    at org.mobicents.media.server.ctrl.mgcp.NotificationRequestAction.call(NotificationRequestAction.java:51)
    at org.mobicents.media.server.ctrl.mgcp.MgcpController.processMgcpCommandEvent(MgcpController.java:226)
    at org.mobicents.protocols.mgcp.stack.JainMgcpStackProviderImpl.processMgcpCommandEvent(JainMgcpStackProviderImpl.java:246)
    at org.mobicents.protocols.mgcp.stack.TransactionHandler.receiveRequest(TransactionHandler.java:600)
    at org.mobicents.protocols.mgcp.stack.MessageHandler.scheduleMessages(MessageHandler.java:196)
    at org.mobicents.protocols.mgcp.stack.JainMgcpStackImpl.run(JainMgcpStackImpl.java:327)
14:21:03,436 ERROR [JainMgcpStackProviderImpl] The TransactionHandler not found for TransactionHandle 278431951 May be the Tx timed out. Event = 400 0The transaction could not be executed due to a transient error."


Message sent by RHQ mobicents-plugin:

"2011-10-05 14:20:50,177 INFO  [org.rhq.enterprise.server.plugins.alertMobicents.MobicentsSender] Mobicents alert [VOICE] to baseUrl [http://localhost:8080/alerting-app/call?alertId=10372&tel=sip%3Atuelho%40127.0.0.1%3A5090] with message:
alertText=Alert on resource rsoares[jonserver]. Cause is
  - Condition 1: Used Memory > 2.8GB
  - Date/Time: 2011/10/05 14:20:20 BRT
  - Details: 5.2GB
"


If I copy exactly the same message and past it on http://localhost:8080/alerting-app/send-alert-test.html the audio works fine.

The message that arrives to sip servlet Server is (from server's log):

"14:19:56,018 INFO  [PhoneCallSipServlet] Playing Alerting TTS
14:19:56,018 INFO  [MediaConnectionListener] Playing alert announcement : data:ts%28Alert+on+resource+rsoares%5Bjonserver%5D.+Cause+is+%0A++-+Condition+1%3A+Used+Memory+%3E+2.8GB%0A++-+Date%2FTime%3A+2011%2F10%2F05+14%3A19%3A20+BRT%0A++-+Details%3A+5.2GB%0A%29
14:19:56,018 INFO  [MediaConnectionListener] Waiting for DTMF at the same time..
14:20:00,018 WARN  [TransactionHandler] message =
RQNT 278431944 /mobicents/media/IVR/6...@127.0.0.1:2427  MGCP 1.0
N:loca...@127.0.0.1:2828
X:5
S:AU/ann@12(ts(Alert on resource rsoares[jonserver]. Cause is
  - Condition 1: Used Memory > 2.8GB
  - Date/Time: 2011/10/05 14:19:20 BRT
  - Details: 5.2GB
))
R:D/dtmf0@12 (N),D/dtmf1@12 (N),D/dtmf2@12 (N),D/dtmf3@12 (N),D/dtmf4@12 (N),D/dtmf5@12 (N),D/dtmf6@12 (N),D/dtmf7@12 (N),D/dtmf8@12 (N),D/dtmf9@12 (N),D/dtmfA@12 (N),D/dtmfB@12 (N),D/dtmfC@12 (N),D/dtmfD@12 (N),D/dtmfStar@12 (N),D/dtmfHash@12 (N),AU/oc@12 (N),AU/of@12 (N)

 local Tx ID = 278431944 Remote Tx ID = 278448535 Sending the Command 2
14:20:05,045 ERROR [MediaGroupRequestTx] No response from MGW. Tx timed out for RQNT Tx 278448535 For Command sent RQNT 278448535 /mobicents/media/IVR/6...@127.0.0.1:2427 MGCP 1.0
N: loca...@127.0.0.1:2828
R: D/dtmf0@12(N),D/dtmf1@12(N),D/dtmf2@12(N),D/dtmf3@12(N),D/dtmf4@12(N),D/dtmf5@12(N),D/dtmf6@12(N),D/dtmf7@12(N),D/dtmf8@12(N),D/dtmf9@12(N),D/dtmfA@12(N),D/dtmfB@12(N),D/dtmfC@12(N),D/dtmfD@12(N),D/dtmfStar@12(N),D/dtmfHash@12(N),AU/oc@12(N),AU/of@12(N)
X: 5
S: AU/ann(ts(Alert on resource rsoares[jonserver]. Cause is
  - Condition 1: Used Memory > 2.8GB
  - Date/Time: 2011/10/05 14:19:20 BRT
  - Details: 5.2GB
))@12"


Sounds like when the msg comes from RHQ it have some especial characters... Im not sure. I'm looking  the code on sip servlet code to investigate.

Any light?

Thanks.
______________
Rafael Soares

Jean Deruelle

unread,
Oct 5, 2011, 3:00:17 PM10/5/11
to mobicent...@googlegroups.com
In the case that works :
14:19:56,018 INFO  [MediaConnectionListener] Playing alert announcement : data:ts%28Alert+on+resource+rsoares%5Bjonserver%5D.+Cause+is+%0A++-+Condition+1%3A+Used+Memory+%3E+2.8GB%0A++-+Date%2FTime%3A+2011%2F10%2F05+14%3A19%3A20+BRT%0A++-+Details%3A+5.2GB%0A%29

Notice how the text has been converted to replace all special chars through java.net.URI.create("data:" + URLEncoder.encode("ts("+ alertText +")", "UTF-8"))); at line 94.  
You may want to check that in the case that don't work if the [MediaConnectionListener] Playing alert announcement : log is the exact same one. This should help you findiing out which char is different somehow and make it fail. If I recall correctly comma were not parsed correctly by the TTS engine or something.

Jean

Rafael Soares

unread,
Oct 6, 2011, 10:07:08 PM10/6/11
to mobicent...@googlegroups.com
Analyzing both cases I found the difference that causes the error on TTS engine.

1) Text (encoded to UTF-8) that works passed using /alerting-app/send-alert-test.html form page:
   data:ts%28Alert+on+resource+rsoares%5Bjonserver%5D.+Cause+is++++-+Condition+1%3A+Used+Memory+%3E+2.8GB+++-+Date%2FTime%3A+2011%2F10%2F06+22%3A08%3A41+BRT+++-+Details%3A+5.4GB%29

2) Text (encoded to UTF-8) that doesn't works passed using RHQ Alert:
   data:ts%28Alert+on+resource+rsoares%5Bjonserver%5D.+Cause+is+%0A++-+Condition+1%3A+Used+Memory+%3E+2.8GB%0A++-+Date%2FTime%3A+2011%2F10%2F06+22%3A08%3A41+BRT%0A++-+Details%3A+5.4GB%0A%29

I think the problem is on '\n' char sent by RHQ. Because in the case 1) you copy/past in a HTML input text field and the text lost '\n' chars. This is the only difference I found comparing both text snippets.

So I changed PhoneAlertServlet code to remove '\n' and ',' chars from alertText request param before encode to UTF-8 and convert to URI. Now it can receive the real RHQ Alert text message. :-)

        // remove '\n' and ',' chars to avoid problems with TTS
        alertText = alertText.replace('\n', ' ').replace(',', ' ');

Thanks!

_____________
Rafael Soares

Jean Deruelle

unread,
Oct 7, 2011, 5:06:10 AM10/7/11
to mobicent...@googlegroups.com
Thanks Rafael.

I committed your one line patch to trunk so that you or others don't have to worry about it on future usage.
I would be interested to hear more about your usage of this application (if you can't disclose publicly feel free to ping me directly over chat) and if you would like to take it further and contribute to it ?

Jean

Rafael Soares

unread,
Oct 7, 2011, 9:09:40 AM10/7/11
to mobicent...@googlegroups.com, Joao Paulo Viragine
Cool!

I'm preparing a RHQ Demo to shown during JBUG Brazil event (JBossInBossa 2011) on next Saturday. We'll show the RHQ integration with Mobicents using the Mobicents alert-sender plugin.

Thanks!
_____________
Rafael Soares

Jean Deruelle

unread,
Oct 7, 2011, 3:31:54 PM10/7/11
to mobicent...@googlegroups.com, Joao Paulo Viragine
Cool !

Are you aware of other talks on Mobicents there  ? I know that last year there was already one http://ensinar.wordpress.com/2010/05/08/jboss-in-bossa-apresentacao-mobicents/
Feel free to do another post to this list to advertise your talk or on twitter so that we can retweet and give you more exposure.

Jean
Reply all
Reply to author
Forward
0 new messages