RestComm / media-core

RMS - Restcomm Media Server for Real Time Cloud Communications
http://www.restcomm.com/
GNU Affero General Public License v3.0
160 stars 124 forks source link

Implement MGCP EndSignal #220

Closed hrosa closed 7 years ago

hrosa commented 8 years ago

Implement MGCP EndSignal

deruelle commented 7 years ago

how hard would it be to implement this on RMS 4 or 5 ?

hrosa commented 7 years ago

EndSignal is already implemented @deruelle This ticket is for new MGCP stack only.

deruelle commented 7 years ago

so this means we could implement https://github.com/RestComm/Restcomm-Connect/issues/1268#issuecomment-231397668 ?

I see your comment saying "Unfortunately, our MGCP EndSignal implementation doesn't do what is supposed to." How hard would it be to fix it for 5.1 or 4.1 ?

hrosa commented 7 years ago

@deruelle Im trying to think hard what I meant with that, but RestComm is currently using EndSignal to terminate background music on conferences.

deruelle commented 7 years ago

right the infinite playing and end of it is already working for Music on Hold right ? So we could implement continuous silence in conference for everyone to avoid drops ?

hrosa commented 7 years ago

@deruelle correct, I see no blocker here

hrosa commented 7 years ago

Concurrent issue may arise when canceling ongoing signal.

00:35:53,424 INFO [PlayAnnouncement] Playing announcement http://localhost:8080/restcomm/cache/ACae6e420f425248d6a26948c17a9e2acf/b6bb5e73650bc7a93cb31f8dc2c02648a7008decf368f36ba5cf8b4d78c7fc0a.wav 00:35:53,503 INFO [RtpHandler] Restarting jitter buffer 00:35:53,503 WARN [RtpHandler] Dropping packet because payload type (126) is unknown. 00:35:55,988 INFO [AudioPlayerImpl] End of file reached 00:35:55,989 INFO [PlayAnnouncement] Announcement http://localhost:8080/restcomm/cache/ACae6e420f425248d6a26948c17a9e2acf/b6bb5e73650bc7a93cb31f8dc2c02648a7008decf368f36ba5cf8b4d78c7fc0a.wav has completed. 00:35:56,000 INFO [PlayAnnouncement] Playing announcement http://localhost:8080/restcomm/cache/ACae6e420f425248d6a26948c17a9e2acf/629398c3a7f1631358da125632cabe4a56baf080d8255eef4854b261393e399e.wav 00:35:59,087 INFO [AudioPlayerImpl] End of file reached 00:35:59,088 INFO [PlayAnnouncement] Announcement http://localhost:8080/restcomm/cache/ACae6e420f425248d6a26948c17a9e2acf/629398c3a7f1631358da125632cabe4a56baf080d8255eef4854b261393e399e.wav has completed. 00:35:59,136 INFO [GenericMgcpEndpoint] Canceling signal pa on endpoint mobicents/ivr/2@127.0.0.1 00:35:59,138 INFO [PlayAnnouncement] Playing announcement http://localhost:8080/restcomm/music/rock/nickleus_-_original_guitar_song_200907251723.wav

00:36:03,556 INFO [PlayAnnouncement] Playing announcement http://localhost:8080/restcomm/cache/ACae6e420f425248d6a26948c17a9e2acf/5565e1cbe4b2301792dc1b262ae1772c7b8f3f8ffb99719c3461dc5dc5852ccf.wav 00:36:03,630 INFO [RtpHandler] Restarting jitter buffer 00:36:05,527 INFO [AudioPlayerImpl] End of file reached 00:36:05,528 INFO [PlayAnnouncement] Announcement http://localhost:8080/restcomm/cache/ACae6e420f425248d6a26948c17a9e2acf/5565e1cbe4b2301792dc1b262ae1772c7b8f3f8ffb99719c3461dc5dc5852ccf.wav has completed. 00:36:05,538 INFO [PlayAnnouncement] Playing announcement http://localhost:8080/restcomm/cache/ACae6e420f425248d6a26948c17a9e2acf/8980ffae14c7df0cf344954932721b40fcfe87ac8a2d3ae8cc4e620b1494b56f.wav 00:36:08,647 INFO [AudioPlayerImpl] End of file reached 00:36:08,647 INFO [PlayAnnouncement] Announcement http://localhost:8080/restcomm/cache/ACae6e420f425248d6a26948c17a9e2acf/8980ffae14c7df0cf344954932721b40fcfe87ac8a2d3ae8cc4e620b1494b56f.wav has completed. 00:36:08,668 INFO [GenericMgcpEndpoint] Canceling signal pa on endpoint mobicents/ivr/2@127.0.0.1 00:36:08,670 INFO [GenericMgcpEndpoint] Canceling signal pa on endpoint mobicents/ivr/2@127.0.0.1 00:36:08,675 INFO [GenericMgcpEndpoint] Canceling signal AU/pa on endpoint mobicents/ivr/2@127.0.0.1 00:36:08,675 INFO [PlayAnnouncement] Announcement http://localhost:8080/restcomm/music/rock/nickleus_-_original_guitar_song_200907251723.wav has completed. 00:36:08,675 INFO [PlayAnnouncement] Announcement http://localhost:8080/restcomm/audio/beep.wav has completed. java.lang.NullPointerException at org.mobicents.media.control.mgcp.endpoint.GenericMgcpEndpoint.onEvent(GenericMgcpEndpoint.java:436) at org.mobicents.media.control.mgcp.pkg.AbstractMgcpSignal.notify(AbstractMgcpSignal.java:96) at org.mobicents.media.control.mgcp.pkg.au.PlayAnnouncement.fireOF(PlayAnnouncement.java:254) at org.mobicents.media.control.mgcp.pkg.au.PlayAnnouncement.execute(PlayAnnouncement.java:206) at org.mobicents.media.control.mgcp.endpoint.GenericMgcpEndpoint.executeTimeoutSignal(GenericMgcpEndpoint.java:358) at org.mobicents.media.control.mgcp.endpoint.GenericMgcpEndpoint.requestNotification(GenericMgcpEndpoint.java:318) at org.mobicents.media.control.mgcp.command.RequestNotificationCommand.executeCommand(RequestNotificationCommand.java:167) at org.mobicents.media.control.mgcp.command.RequestNotificationCommand.call(RequestNotificationCommand.java:184) at org.mobicents.media.control.mgcp.command.RequestNotificationCommand.call(RequestNotificationCommand.java:55) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:108) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:41) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:77) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

hrosa commented 7 years ago

Implemented MGCP EndSignal and MgcpEndpoint supports it: https://github.com/RestComm/mediaserver/commit/24e37ee6bf9e0d49302d9c15d350729b4af39797

Need to improve concurrency model for signal handling to prevent issues like in previous comment.