r2999 - in branches/rtcp_ntp: . libminisip libminisip/aec
libminisip/codecs libminisip/conf libminisip/ipsec
libminisip/mediahandler libminisip/minisip
libminisip/minisip/contactdb libminisip/minisip/gui
libminisip/minisip/ipprovider libminisip/p2t libminisip/rtp
libminisip/sdp libminisip/sip libminisip/soundcard
libminisip/spaudio libminisip/stun libminisip/video minisip
minisip/gui
mikma at minisip.org
mikma at minisip.org
Thu Dec 7 00:27:18 CET 2006
Author: mikma
Date: 2006-12-07 00:27:17 +0100 (Thu, 07 Dec 2006)
New Revision: 2999
Added:
branches/rtcp_ntp/libminisip/
branches/rtcp_ntp/libminisip/aec/
branches/rtcp_ntp/libminisip/aec/Makefile.am
branches/rtcp_ntp/libminisip/aec/aec.cxx
branches/rtcp_ntp/libminisip/aec/aec.h
branches/rtcp_ntp/libminisip/codecs/
branches/rtcp_ntp/libminisip/codecs/Codec.cxx
branches/rtcp_ntp/libminisip/codecs/Codec.h
branches/rtcp_ntp/libminisip/codecs/G711CODEC.cxx
branches/rtcp_ntp/libminisip/codecs/G711CODEC.h
branches/rtcp_ntp/libminisip/codecs/ILBCCODEC.cxx
branches/rtcp_ntp/libminisip/codecs/ILBCCODEC.h
branches/rtcp_ntp/libminisip/codecs/Makefile.am
branches/rtcp_ntp/libminisip/codecs/SPEEXCODEC.cxx
branches/rtcp_ntp/libminisip/codecs/SPEEXCODEC.h
branches/rtcp_ntp/libminisip/codecs/g711/
branches/rtcp_ntp/libminisip/codecs/ilbc/
branches/rtcp_ntp/libminisip/conf/
branches/rtcp_ntp/libminisip/conf/ConfCallback.h
branches/rtcp_ntp/libminisip/conf/ConfMember.h
branches/rtcp_ntp/libminisip/conf/ConferenceControl.cxx
branches/rtcp_ntp/libminisip/conf/ConferenceControl.h
branches/rtcp_ntp/libminisip/conf/Makefile.am
branches/rtcp_ntp/libminisip/ipsec/
branches/rtcp_ntp/libminisip/ipsec/Makefile.am
branches/rtcp_ntp/libminisip/mediahandler/
branches/rtcp_ntp/libminisip/mediahandler/AudioMedia.cxx
branches/rtcp_ntp/libminisip/mediahandler/AudioMedia.h
branches/rtcp_ntp/libminisip/mediahandler/DtmfSender.cxx
branches/rtcp_ntp/libminisip/mediahandler/DtmfSender.h
branches/rtcp_ntp/libminisip/mediahandler/KeyAgreement.cxx
branches/rtcp_ntp/libminisip/mediahandler/Makefile.am
branches/rtcp_ntp/libminisip/mediahandler/Media.cxx
branches/rtcp_ntp/libminisip/mediahandler/Media.h
branches/rtcp_ntp/libminisip/mediahandler/MediaCommandString.cxx
branches/rtcp_ntp/libminisip/mediahandler/MediaCommandString.h
branches/rtcp_ntp/libminisip/mediahandler/MediaHandler.cxx
branches/rtcp_ntp/libminisip/mediahandler/MediaHandler.h
branches/rtcp_ntp/libminisip/mediahandler/MediaStream.cxx
branches/rtcp_ntp/libminisip/mediahandler/MediaStream.h
branches/rtcp_ntp/libminisip/mediahandler/RtpReceiver.cxx
branches/rtcp_ntp/libminisip/mediahandler/RtpReceiver.h
branches/rtcp_ntp/libminisip/mediahandler/Session.cxx
branches/rtcp_ntp/libminisip/mediahandler/Session.h
branches/rtcp_ntp/libminisip/mediahandler/SessionRegistry.cxx
branches/rtcp_ntp/libminisip/mediahandler/SessionRegistry.h
branches/rtcp_ntp/libminisip/minisip/
branches/rtcp_ntp/libminisip/minisip/Bell.cxx
branches/rtcp_ntp/libminisip/minisip/Bell.h
branches/rtcp_ntp/libminisip/minisip/ConsoleDebugger.cxx
branches/rtcp_ntp/libminisip/minisip/ConsoleDebugger.h
branches/rtcp_ntp/libminisip/minisip/LocationDetector.cxx
branches/rtcp_ntp/libminisip/minisip/LocationDetector.h
branches/rtcp_ntp/libminisip/minisip/LogEntry.cxx
branches/rtcp_ntp/libminisip/minisip/LogEntry.h
branches/rtcp_ntp/libminisip/minisip/MessageRouter.cxx
branches/rtcp_ntp/libminisip/minisip/MessageRouter.h
branches/rtcp_ntp/libminisip/minisip/Minisip.cxx
branches/rtcp_ntp/libminisip/minisip/Minisip.h
branches/rtcp_ntp/libminisip/minisip/contactdb/
branches/rtcp_ntp/libminisip/minisip/contactdb/ContactDb.cxx
branches/rtcp_ntp/libminisip/minisip/contactdb/ContactDb.h
branches/rtcp_ntp/libminisip/minisip/contactdb/MXmlPhoneBookIo.cxx
branches/rtcp_ntp/libminisip/minisip/contactdb/MXmlPhoneBookIo.h
branches/rtcp_ntp/libminisip/minisip/contactdb/Makefile.am
branches/rtcp_ntp/libminisip/minisip/contactdb/PhoneBook.cxx
branches/rtcp_ntp/libminisip/minisip/contactdb/PhoneBook.h
branches/rtcp_ntp/libminisip/minisip/gui/
branches/rtcp_ntp/libminisip/minisip/gui/Gui.cxx
branches/rtcp_ntp/libminisip/minisip/gui/Gui.h
branches/rtcp_ntp/libminisip/minisip/gui/GuiCallback.cxx
branches/rtcp_ntp/libminisip/minisip/gui/GuiCallback.h
branches/rtcp_ntp/libminisip/minisip/ipprovider/
branches/rtcp_ntp/libminisip/minisip/win32/
branches/rtcp_ntp/libminisip/p2t/
branches/rtcp_ntp/libminisip/p2t/GroupListClient.cxx
branches/rtcp_ntp/libminisip/p2t/GroupListServer.cxx
branches/rtcp_ntp/libminisip/p2t/GroupListUserElement.h
branches/rtcp_ntp/libminisip/p2t/Makefile.am
branches/rtcp_ntp/libminisip/p2t/P2T.cxx
branches/rtcp_ntp/libminisip/p2t/P2T.h
branches/rtcp_ntp/libminisip/p2t/RtcpAPP.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpAPP.h
branches/rtcp_ntp/libminisip/p2t/RtcpAPPHeader.h
branches/rtcp_ntp/libminisip/p2t/RtcpReceiver.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpSender.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionGetFloor.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionGetFloor.h
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionGrantFloor.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionGrantFloor.h
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionIdleFloor.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionIdleFloor.h
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionReleaseFloor.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionReleaseFloor.h
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionTakenFloor.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionTakenFloor.h
branches/rtcp_ntp/libminisip/rtp/
branches/rtcp_ntp/libminisip/rtp/CryptoContext.cxx
branches/rtcp_ntp/libminisip/rtp/Makefile.am
branches/rtcp_ntp/libminisip/rtp/RtcpPacket.h
branches/rtcp_ntp/libminisip/rtp/RtcpReportSDES.cxx
branches/rtcp_ntp/libminisip/rtp/RtpHeader.h
branches/rtcp_ntp/libminisip/rtp/RtpPacket.cxx
branches/rtcp_ntp/libminisip/rtp/SDESItem.h
branches/rtcp_ntp/libminisip/rtp/SDES_EMAIL.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_EMAIL.h
branches/rtcp_ntp/libminisip/rtp/SDES_LOC.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_NAME.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_NAME.h
branches/rtcp_ntp/libminisip/rtp/SDES_NOTE.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_NOTE.h
branches/rtcp_ntp/libminisip/rtp/SDES_PHONE.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_TOOL.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_TOOL.h
branches/rtcp_ntp/libminisip/rtp/SRtpPacket.cxx
branches/rtcp_ntp/libminisip/sdp/
branches/rtcp_ntp/libminisip/sdp/Makefile.am
branches/rtcp_ntp/libminisip/sdp/SdpHeader.h
branches/rtcp_ntp/libminisip/sdp/SdpHeaderC.cxx
branches/rtcp_ntp/libminisip/sip/
branches/rtcp_ntp/libminisip/sip/DefaultDialogHandler.cxx
branches/rtcp_ntp/libminisip/sip/Makefile.am
branches/rtcp_ntp/libminisip/sip/PresenceMessageContent.h
branches/rtcp_ntp/libminisip/sip/Sip.cxx
branches/rtcp_ntp/libminisip/sip/SipDialogConfVoip.cxx
branches/rtcp_ntp/libminisip/sip/SipDialogPresenceClient.cxx
branches/rtcp_ntp/libminisip/sip/SipDialogPresenceServer.cxx
branches/rtcp_ntp/libminisip/sip/SipDialogSecurityConfig.cxx
branches/rtcp_ntp/libminisip/sip/SipDialogSecurityConfig.h
branches/rtcp_ntp/libminisip/sip/SipDialogVoip.cxx
branches/rtcp_ntp/libminisip/sip/SipSoftPhoneConfiguration.cxx
branches/rtcp_ntp/libminisip/sip/SipSoftPhoneConfiguration.h
branches/rtcp_ntp/libminisip/soundcard/
branches/rtcp_ntp/libminisip/soundcard/AlsaCard.cxx
branches/rtcp_ntp/libminisip/soundcard/AlsaCard.h
branches/rtcp_ntp/libminisip/soundcard/AudioMixer.cxx
branches/rtcp_ntp/libminisip/soundcard/AudioMixer.h
branches/rtcp_ntp/libminisip/soundcard/AudioMixerSimple.cxx
branches/rtcp_ntp/libminisip/soundcard/AudioMixerSimple.h
branches/rtcp_ntp/libminisip/soundcard/AudioMixerSpatial.cxx
branches/rtcp_ntp/libminisip/soundcard/AudioMixerSpatial.h
branches/rtcp_ntp/libminisip/soundcard/DirectSoundDevice.cxx
branches/rtcp_ntp/libminisip/soundcard/DirectSoundDevice.h
branches/rtcp_ntp/libminisip/soundcard/FileSoundDevice.cxx
branches/rtcp_ntp/libminisip/soundcard/FileSoundDevice.h
branches/rtcp_ntp/libminisip/soundcard/FileSoundSource.h
branches/rtcp_ntp/libminisip/soundcard/Makefile.am
branches/rtcp_ntp/libminisip/soundcard/OssSoundDevice.cxx
branches/rtcp_ntp/libminisip/soundcard/SilenceSensor.h
branches/rtcp_ntp/libminisip/soundcard/SoundDevice.cxx
branches/rtcp_ntp/libminisip/soundcard/SoundDevice.h
branches/rtcp_ntp/libminisip/soundcard/SoundIO.cxx
branches/rtcp_ntp/libminisip/soundcard/SoundIO.h
branches/rtcp_ntp/libminisip/soundcard/SoundIOPLCInterface.h
branches/rtcp_ntp/libminisip/soundcard/SoundRecorderCallback.h
branches/rtcp_ntp/libminisip/soundcard/SoundSource.cxx
branches/rtcp_ntp/libminisip/soundcard/SoundSource.h
branches/rtcp_ntp/libminisip/soundcard/WaveSoundDevice.cpp
branches/rtcp_ntp/libminisip/soundcard/WaveSoundDevice.h
branches/rtcp_ntp/libminisip/spaudio/
branches/rtcp_ntp/libminisip/spaudio/Makefile.am
branches/rtcp_ntp/libminisip/spaudio/SpAudio.cxx
branches/rtcp_ntp/libminisip/spaudio/SpAudio.h
branches/rtcp_ntp/libminisip/stun/
branches/rtcp_ntp/libminisip/stun/Makefile.am
branches/rtcp_ntp/libminisip/stun/STUN.h
branches/rtcp_ntp/libminisip/stun/STUNAttributes.h
branches/rtcp_ntp/libminisip/stun/STUNTest.cxx
branches/rtcp_ntp/libminisip/video/
branches/rtcp_ntp/libminisip/video/Makefile.am
branches/rtcp_ntp/libminisip/video/grabber/
Removed:
branches/rtcp_ntp/aec/
branches/rtcp_ntp/codecs/
branches/rtcp_ntp/conf/
branches/rtcp_ntp/ipsec/
branches/rtcp_ntp/libminisip/aec/Makefile.am
branches/rtcp_ntp/libminisip/aec/aec.cxx
branches/rtcp_ntp/libminisip/aec/aec.h
branches/rtcp_ntp/libminisip/codecs/Codec.cxx
branches/rtcp_ntp/libminisip/codecs/Codec.h
branches/rtcp_ntp/libminisip/codecs/G711CODEC.cxx
branches/rtcp_ntp/libminisip/codecs/G711CODEC.h
branches/rtcp_ntp/libminisip/codecs/ILBCCODEC.cxx
branches/rtcp_ntp/libminisip/codecs/ILBCCODEC.h
branches/rtcp_ntp/libminisip/codecs/Makefile.am
branches/rtcp_ntp/libminisip/codecs/SPEEXCODEC.cxx
branches/rtcp_ntp/libminisip/codecs/SPEEXCODEC.h
branches/rtcp_ntp/libminisip/codecs/g711/
branches/rtcp_ntp/libminisip/codecs/ilbc/
branches/rtcp_ntp/libminisip/conf/ConfCallback.h
branches/rtcp_ntp/libminisip/conf/ConfMember.h
branches/rtcp_ntp/libminisip/conf/ConferenceControl.cxx
branches/rtcp_ntp/libminisip/conf/ConferenceControl.h
branches/rtcp_ntp/libminisip/conf/Makefile.am
branches/rtcp_ntp/libminisip/ipsec/Makefile.am
branches/rtcp_ntp/libminisip/mediahandler/AudioMedia.cxx
branches/rtcp_ntp/libminisip/mediahandler/AudioMedia.h
branches/rtcp_ntp/libminisip/mediahandler/DtmfSender.cxx
branches/rtcp_ntp/libminisip/mediahandler/DtmfSender.h
branches/rtcp_ntp/libminisip/mediahandler/KeyAgreement.cxx
branches/rtcp_ntp/libminisip/mediahandler/Makefile.am
branches/rtcp_ntp/libminisip/mediahandler/Media.cxx
branches/rtcp_ntp/libminisip/mediahandler/Media.h
branches/rtcp_ntp/libminisip/mediahandler/MediaCommandString.cxx
branches/rtcp_ntp/libminisip/mediahandler/MediaCommandString.h
branches/rtcp_ntp/libminisip/mediahandler/MediaHandler.cxx
branches/rtcp_ntp/libminisip/mediahandler/MediaHandler.h
branches/rtcp_ntp/libminisip/mediahandler/MediaStream.cxx
branches/rtcp_ntp/libminisip/mediahandler/MediaStream.h
branches/rtcp_ntp/libminisip/mediahandler/RtpReceiver.cxx
branches/rtcp_ntp/libminisip/mediahandler/RtpReceiver.h
branches/rtcp_ntp/libminisip/mediahandler/Session.cxx
branches/rtcp_ntp/libminisip/mediahandler/Session.h
branches/rtcp_ntp/libminisip/mediahandler/SessionRegistry.cxx
branches/rtcp_ntp/libminisip/mediahandler/SessionRegistry.h
branches/rtcp_ntp/libminisip/minisip/contactdb/ContactDb.cxx
branches/rtcp_ntp/libminisip/minisip/contactdb/ContactDb.h
branches/rtcp_ntp/libminisip/minisip/contactdb/MXmlPhoneBookIo.cxx
branches/rtcp_ntp/libminisip/minisip/contactdb/MXmlPhoneBookIo.h
branches/rtcp_ntp/libminisip/minisip/contactdb/Makefile.am
branches/rtcp_ntp/libminisip/minisip/contactdb/PhoneBook.cxx
branches/rtcp_ntp/libminisip/minisip/contactdb/PhoneBook.h
branches/rtcp_ntp/libminisip/minisip/ipprovider/IpProvider.cxx
branches/rtcp_ntp/libminisip/minisip/ipprovider/IpProvider.h
branches/rtcp_ntp/libminisip/minisip/ipprovider/Makefile.am
branches/rtcp_ntp/libminisip/minisip/ipprovider/SimpleIpProvider.cxx
branches/rtcp_ntp/libminisip/minisip/ipprovider/SimpleIpProvider.h
branches/rtcp_ntp/libminisip/minisip/ipprovider/StunIpProvider.cxx
branches/rtcp_ntp/libminisip/minisip/ipprovider/StunIpProvider.h
branches/rtcp_ntp/libminisip/p2t/GroupListClient.cxx
branches/rtcp_ntp/libminisip/p2t/GroupListServer.cxx
branches/rtcp_ntp/libminisip/p2t/GroupListUserElement.h
branches/rtcp_ntp/libminisip/p2t/Makefile.am
branches/rtcp_ntp/libminisip/p2t/P2T.cxx
branches/rtcp_ntp/libminisip/p2t/P2T.h
branches/rtcp_ntp/libminisip/p2t/RtcpAPP.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpAPP.h
branches/rtcp_ntp/libminisip/p2t/RtcpAPPHeader.h
branches/rtcp_ntp/libminisip/p2t/RtcpReceiver.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpSender.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionGetFloor.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionGetFloor.h
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionGrantFloor.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionGrantFloor.h
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionIdleFloor.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionIdleFloor.h
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionReleaseFloor.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionReleaseFloor.h
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionTakenFloor.cxx
branches/rtcp_ntp/libminisip/p2t/RtcpTransactionTakenFloor.h
branches/rtcp_ntp/libminisip/rtp/CryptoContext.cxx
branches/rtcp_ntp/libminisip/rtp/Makefile.am
branches/rtcp_ntp/libminisip/rtp/RtcpPacket.h
branches/rtcp_ntp/libminisip/rtp/RtcpReportSDES.cxx
branches/rtcp_ntp/libminisip/rtp/RtpHeader.h
branches/rtcp_ntp/libminisip/rtp/RtpPacket.cxx
branches/rtcp_ntp/libminisip/rtp/SDESItem.h
branches/rtcp_ntp/libminisip/rtp/SDES_EMAIL.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_EMAIL.h
branches/rtcp_ntp/libminisip/rtp/SDES_LOC.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_NAME.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_NAME.h
branches/rtcp_ntp/libminisip/rtp/SDES_NOTE.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_NOTE.h
branches/rtcp_ntp/libminisip/rtp/SDES_PHONE.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_TOOL.cxx
branches/rtcp_ntp/libminisip/rtp/SDES_TOOL.h
branches/rtcp_ntp/libminisip/rtp/SRtpPacket.cxx
branches/rtcp_ntp/libminisip/sdp/Makefile.am
branches/rtcp_ntp/libminisip/sdp/SdpHeader.h
branches/rtcp_ntp/libminisip/sdp/SdpHeaderC.cxx
branches/rtcp_ntp/libminisip/sip/DefaultDialogHandler.cxx
branches/rtcp_ntp/libminisip/sip/Makefile.am
branches/rtcp_ntp/libminisip/sip/PresenceMessageContent.h
branches/rtcp_ntp/libminisip/sip/Sip.cxx
branches/rtcp_ntp/libminisip/sip/SipDialogConfVoip.cxx
branches/rtcp_ntp/libminisip/sip/SipDialogPresenceClient.cxx
branches/rtcp_ntp/libminisip/sip/SipDialogPresenceServer.cxx
branches/rtcp_ntp/libminisip/sip/SipDialogSecurityConfig.cxx
branches/rtcp_ntp/libminisip/sip/SipDialogSecurityConfig.h
branches/rtcp_ntp/libminisip/sip/SipDialogVoip.cxx
branches/rtcp_ntp/libminisip/sip/SipSoftPhoneConfiguration.cxx
branches/rtcp_ntp/libminisip/sip/SipSoftPhoneConfiguration.h
branches/rtcp_ntp/libminisip/soundcard/AlsaCard.cxx
branches/rtcp_ntp/libminisip/soundcard/AlsaCard.h
branches/rtcp_ntp/libminisip/soundcard/AudioMixer.cxx
branches/rtcp_ntp/libminisip/soundcard/AudioMixer.h
branches/rtcp_ntp/libminisip/soundcard/AudioMixerSimple.cxx
branches/rtcp_ntp/libminisip/soundcard/AudioMixerSimple.h
branches/rtcp_ntp/libminisip/soundcard/AudioMixerSpatial.cxx
branches/rtcp_ntp/libminisip/soundcard/AudioMixerSpatial.h
branches/rtcp_ntp/libminisip/soundcard/DirectSoundDevice.cxx
branches/rtcp_ntp/libminisip/soundcard/DirectSoundDevice.h
branches/rtcp_ntp/libminisip/soundcard/FileSoundDevice.cxx
branches/rtcp_ntp/libminisip/soundcard/FileSoundDevice.h
branches/rtcp_ntp/libminisip/soundcard/FileSoundSource.h
branches/rtcp_ntp/libminisip/soundcard/Makefile.am
branches/rtcp_ntp/libminisip/soundcard/OssSoundDevice.cxx
branches/rtcp_ntp/libminisip/soundcard/SilenceSensor.h
branches/rtcp_ntp/libminisip/soundcard/SoundDevice.cxx
branches/rtcp_ntp/libminisip/soundcard/SoundDevice.h
branches/rtcp_ntp/libminisip/soundcard/SoundIO.cxx
branches/rtcp_ntp/libminisip/soundcard/SoundIO.h
branches/rtcp_ntp/libminisip/soundcard/SoundIOPLCInterface.h
branches/rtcp_ntp/libminisip/soundcard/SoundRecorderCallback.h
branches/rtcp_ntp/libminisip/soundcard/SoundSource.cxx
branches/rtcp_ntp/libminisip/soundcard/SoundSource.h
branches/rtcp_ntp/libminisip/spaudio/Makefile.am
branches/rtcp_ntp/libminisip/spaudio/SpAudio.cxx
branches/rtcp_ntp/libminisip/spaudio/SpAudio.h
branches/rtcp_ntp/libminisip/stun/Makefile.am
branches/rtcp_ntp/libminisip/stun/STUN.h
branches/rtcp_ntp/libminisip/stun/STUNAttributes.h
branches/rtcp_ntp/libminisip/stun/STUNTest.cxx
branches/rtcp_ntp/libminisip/video/Makefile.am
branches/rtcp_ntp/libminisip/video/grabber/
branches/rtcp_ntp/mediahandler/
branches/rtcp_ntp/minisip/Bell.cxx
branches/rtcp_ntp/minisip/Bell.h
branches/rtcp_ntp/minisip/ConsoleDebugger.cxx
branches/rtcp_ntp/minisip/ConsoleDebugger.h
branches/rtcp_ntp/minisip/LocationDetector.cxx
branches/rtcp_ntp/minisip/LocationDetector.h
branches/rtcp_ntp/minisip/LogEntry.cxx
branches/rtcp_ntp/minisip/LogEntry.h
branches/rtcp_ntp/minisip/MessageRouter.cxx
branches/rtcp_ntp/minisip/MessageRouter.h
branches/rtcp_ntp/minisip/Minisip.cxx
branches/rtcp_ntp/minisip/Minisip.h
branches/rtcp_ntp/minisip/contactdb/
branches/rtcp_ntp/minisip/gui/Gui.cxx
branches/rtcp_ntp/minisip/gui/Gui.h
branches/rtcp_ntp/minisip/gui/GuiCallback.cxx
branches/rtcp_ntp/minisip/gui/GuiCallback.h
branches/rtcp_ntp/minisip/ipprovider/
branches/rtcp_ntp/p2t/
branches/rtcp_ntp/rtp/
branches/rtcp_ntp/sdp/
branches/rtcp_ntp/sip/
branches/rtcp_ntp/soundcard/
branches/rtcp_ntp/spaudio/
branches/rtcp_ntp/stun/
branches/rtcp_ntp/video/
Log:
Prepare merge
Copied: branches/rtcp_ntp/libminisip/aec (from rev 2997, branches/rtcp_ntp/aec)
Deleted: branches/rtcp_ntp/libminisip/aec/Makefile.am
===================================================================
--- branches/rtcp_ntp/aec/Makefile.am 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/aec/Makefile.am 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,7 +0,0 @@
-noinst_LIBRARIES = libaec.a
-
-libaec_a_SOURCES = aec.cxx
-
-
-noinst_HEADERS = aec.h
-
Copied: branches/rtcp_ntp/libminisip/aec/Makefile.am (from rev 2998, branches/rtcp_ntp/aec/Makefile.am)
Deleted: branches/rtcp_ntp/libminisip/aec/aec.cxx
===================================================================
--- branches/rtcp_ntp/aec/aec.cxx 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/aec/aec.cxx 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,224 +0,0 @@
-/* aec.cxx
- * Acoustic Echo Cancellation NLMS-pw algorithm
- * Author: Andre Adrian, DFS Deutsche Flugsicherung
- * <Andre.Adrian at dfs.de>
- *
- * Version 1.1
- */
-
-#ifdef _MSC_VER
-#define _USE_MATH_DEFINES
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include "aec.h"
-
-
-
-/* ================================================================ */
-/* Exponential Smoothing or IIR Infinite Impulse Response Filter */
-
-IIR6::IIR6()
-{
- memset(this, 0, sizeof(IIR6));
-}
-
-float IIR6::lowpass(float in)
-{
- const float AlphaLp = 0.15f; /* controls Transfer Frequence */
-
- /* Lowpass = Exponential Smoothing */
- lowpassf[0] = in;
- int i;
- for (i = 0; i < 2*POL; ++i) {
- lowpassf[i+1] += AlphaLp*(lowpassf[i] - lowpassf[i+1]);
- }
- return lowpassf[2*POL];
-}
-
-/* ================================================================ */
-
-/*
- * Algorithm: Recursive single pole FIR high-pass filter
- *
- * Reference: The Scientist and Engineer's Guide to Digital Processing
- */
-
-FIR1::FIR1()
-{
- float x = exp(-2.0 * M_PI * PreWhiteTransferFreq/8000.0f);
-
- a0 = (1.0f + x) / 2.0f;
- a1 = -(1.0f + x) / 2.0f;
- b1 = x;
- last_in = 0.0f;
- last_out = 0.0f;
-}
-
-/* ================================================================ */
-
-/* Vector Dot Product */
-float dotp(float a[], float b[]) {
- float sum0 = 0.0, sum1 = 0.0;
- int j;
-
- for (j = 0; j < NLMS_LEN; j+= 2) {
- // optimize: partial loop unrolling
- sum0 += a[j] * b[j];
- sum1 += a[j+1] * b[j+1];
- }
- return sum0+sum1;
-}
-
-AEC::AEC()
-{
- max_max_x = 0.0f;
- hangover = 0;
- memset(max_x, 0, sizeof(max_x));
- dtdCnt = dtdNdx = 0;
-
- memset(x, 0, sizeof(x));
- memset(xf, 0, sizeof(xf));
- memset(w, 0, sizeof(w));
- j = NLMS_EXT;
- lastupdate = 0;
- dotp_xf_xf = 0.0f;
-}
-
-/* Normalized Least Mean Square Algorithm pre-whitening (NLMS-pw)
- * The LMS algorithm was developed by Bernard Widrow
- * book: Widrow/Stearns, Adaptive Signal Processing, Prentice-Hall, 1985
- *
- * in mic: microphone sample (PCM as floating point value)
- * in spk: loudspeaker sample (PCM as floating point value)
- * in update: 0 for convolve only, 1 for convolve and update
- * return: echo cancelled microphone sample
- */
-float AEC::nlms_pw(float mic, float spk, int update)
-{
- float d = mic; // desired signal
- x[j] = spk;
- xf[j] = Fx.highpass(spk); // pre-whitening of x
-
- // calculate error value (mic signal - estimated mic signal from spk signal)
- float e = d - dotp(w, x + j);
-
- if (update) {
- float ef = Fe.highpass(e); // pre-whitening of e
-
- if (lastupdate) {
- // optimize: iterative dotp(xf, xf)
- dotp_xf_xf += (xf[j]*xf[j] - xf[j+NLMS_LEN-1]*xf[j+NLMS_LEN-1]);
- } else {
- dotp_xf_xf = dotp(xf+j, xf+j);
- }
-
- // calculate variable step size
- float mikro_ef = 0.5f/dotp_xf_xf * ef;
-
- // update tap weights (filter learning)
- int i;
- for (i = 0; i < NLMS_LEN; i += 2) {
- // optimize: partial loop unrolling
- w[i] += mikro_ef*xf[i+j];
- w[i+1] += mikro_ef*xf[i+j+1];
- }
- }
- lastupdate = update;
-
- if (--j < 0) {
- // optimize: decrease number of memory copies
- j = NLMS_EXT;
- memmove(x+j+1, x, (NLMS_LEN-1)*sizeof(float));
- memmove(xf+j+1, xf, (NLMS_LEN-1)*sizeof(float));
- }
-
- return e;
-}
-
-
-/* Geigel Double-Talk Detector
- *
- * in d: microphone sample (PCM as floating point value)
- * in x: loudspeaker sample (PCM as floating point value)
- * return: 0 for no talking, 1 for talking
- */
-int AEC::dtd(float d, float x)
-{
- // optimized implementation of max(|x[0]|, |x[1]|, .., |x[L-1]|):
- // calculate max of block (DTD_LEN values)
- x = fabsf(x);
- if (x > max_x[dtdNdx]) {
- max_x[dtdNdx] = x;
- if (x > max_max_x) {
- max_max_x = x;
- }
- }
- if (++dtdCnt >= DTD_LEN) {
- dtdCnt = 0;
- // calculate max of max
- max_max_x = 0.0f;
- for (int i = 0; i < NLMS_LEN/DTD_LEN; ++i) {
- if (max_x[i] > max_max_x) {
- max_max_x = max_x[i];
- }
- }
- // rotate Ndx
- if (++dtdNdx >= NLMS_LEN/DTD_LEN) dtdNdx = 0;
- max_x[dtdNdx] = 0.0f;
- }
-
- // The Geigel DTD algorithm with Hangover timer Thold
- if (fabsf(d) >= GeigelThreshold * max_max_x) {
- hangover = Thold;
- }
-
- if (hangover) --hangover;
-
- if (max_max_x < UpdateThreshold) {
- // avoid update with silence
- return 1;
- } else {
- return (hangover > 0);
- }
-}
-
-
-int AEC::doAEC(int d, int x)
-{
- float s0 = (float)d;
- float s1 = (float)x;
-
- // Mic and Spk signal remove DC (IIR highpass filter)
- s0 = dc0.highpass(s0);
- s1 = dc1.highpass(s1);
-
- // Mic Highpass Filter - telephone users are used to 300Hz cut-off
- s0 = hp0.highpass(s0);
-
- // Double Talk Detector
- int update = !dtd(s0, s1);
-
- // Acoustic Echo Cancellation
- s0 = nlms_pw(s0, s1, update);
-
- // Acoustic Echo Suppression
- if (update) {
- // Non Linear Processor (NLP): attenuate low volumes
- s0 *= NLPAttenuation;
- }
-
- // Saturation
- if (s0 > MAXPCM) {
- return (int)MAXPCM;
- } else if (s0 < -MAXPCM) {
- return (int)-MAXPCM;
- } else {
- return (int)floorf(s0+0.5);
- }
-}
-
-
Copied: branches/rtcp_ntp/libminisip/aec/aec.cxx (from rev 2998, branches/rtcp_ntp/aec/aec.cxx)
Deleted: branches/rtcp_ntp/libminisip/aec/aec.h
===================================================================
--- branches/rtcp_ntp/aec/aec.h 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/aec/aec.h 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,149 +0,0 @@
-/***************************************************************
-A.1 aec.h
-***************************************************************/
-
-#ifndef _AEC_H /* include only once */
-
-/* aec.h
- * Acoustic Echo Cancellation NLMS-pw algorithm
- * Author: Andre Adrian, DFS Deutsche Flugsicherung
- * <Andre.Adrian at dfs.de>
- *
- * Version 1.1
- */
-
-/* dB Values */
-const float M3dB = 0.71f;
-const float M6dB = 0.50f;
-
-/* dB values for 16bit PCM */
-const float M10dB_PCM = 10362.0f;
-const float M20dB_PCM = 3277.0f;
-const float M25dB_PCM = 1843.0f;
-const float M30dB_PCM = 1026.0f;
-const float M35dB_PCM = 583.0f;
-const float M40dB_PCM = 328.0f;
-const float M45dB_PCM = 184.0f;
-const float M50dB_PCM = 104.0f;
-const float M55dB_PCM = 58.0f;
-const float M60dB_PCM = 33.0f;
-
-const float MAXPCM = 32767.0f;
-
-/* Design constants (Change to fine tune the algorithms */
-
-/* For Normalized Least Means Square - Pre-whitening */
-#define NLMS_LEN (80*8) /* NLMS filter length in taps */
-const float PreWhiteTransferFreq = 4000.0f;
-
-/* for Geigel Double Talk Detector */
-const float GeigelThreshold = M6dB;
-const int Thold = 30*8; /* DTD hangover in taps */
-const float UpdateThreshold = M50dB_PCM;
-
-/* for Non Linear Processor */
-const float NLPAttenuation = M6dB;
-
-/* Below this line there are no more design constants */
-
-
-/* Exponential Smoothing or IIR Infinite Impulse Response Filter */
-class IIR {
- float lowpassf;
-
-public:
- IIR() {
- lowpassf = 0.0f;
- }
-
- float highpass(float in) {
- const float ALPHADC = 0.01f; /* controls Transfer Frequence */
-
- lowpassf += ALPHADC*(in - lowpassf);
- return in - lowpassf;
- }
-};
-
-#define POL 6 /* -6dB attenuation per octave per Pol */
-
-class IIR6 {
- float lowpassf[2*POL+1];
- float highpassf[2*POL+1];
-
-public:
- IIR6();
- float highpass(float in) {
- const float AlphaHp = 0.075; /* controls Transfer Frequence */
- const float Gain6 = 1.45f; /* gain to undo filter attenuation */
-
- /* Highpass = Signal - Lowpass. Lowpass = Exponential Smoothing */
- highpassf[0] = in;
- int i;
- for (i = 0; i < 2*POL; ++i) {
- lowpassf[i+1] += AlphaHp*(highpassf[i] - lowpassf[i+1]);
- highpassf[i+1] = highpassf[i] - lowpassf[i+1];
- }
- return Gain6*highpassf[2*POL];
- }
-
- float lowpass(float in);
-};
-
-
-/* Recursive single pole FIR Finite Impule response filter */
-class FIR1 {
- float a0, a1, b1;
- float last_in, last_out;
-
-public:
- FIR1();
- float highpass(float in) {
- float out = a0 * in + a1 * last_in + b1 * last_out;
- last_in = in;
- last_out = out;
-
- return out;
- }
-};
-
-
-#define NLMS_EXT (10*8) // Extention in taps to optimize mem copies
-#define DTD_LEN 16 // block size in taps to optimize DTD calculation
-
-
-class AEC {
- // Time domain Filters
- IIR dc0, dc1; // DC-level running average (IIR highpass)
- IIR6 hp0; // 300Hz cut-off Highpass
- FIR1 Fx, Fe; // pre-whitening Filter for x, e
-
- // Geigel DTD (Double Talk Detector)
- float max_max_x; // max(|x[0]|, .. |x[L-1]|)
- int hangover;
- float max_x[NLMS_LEN/DTD_LEN]; // optimize: less calculations for max()
- int dtdCnt;
- int dtdNdx;
-
- // NLMS-pw
- float x[NLMS_LEN+NLMS_EXT]; // tap delayed loudspeaker signal
- float xf[NLMS_LEN+NLMS_EXT]; // pre-whitening tap delayed signal
- float w[NLMS_LEN]; // tap weights
- int j; // optimize: less memory copies
- int lastupdate; // optimize: iterative dotp(x,x)
- float dotp_xf_xf; // optimize: iterative dotp(x,x)
-
-public:
- AEC();
- int dtd(float d, float x);
- float nlms_pw(float mic, float spk, int update);
-
-/* Acoustic Echo Cancellation and Suppression of one sample
- * in s0: microphone signal with echo
- * in s1: loudspeaker signal
- * return: echo cancelled microphone signal
- */
- int AEC::doAEC(int d, int x);
-};
-
-#define _AEC_H
-#endif
Copied: branches/rtcp_ntp/libminisip/aec/aec.h (from rev 2998, branches/rtcp_ntp/aec/aec.h)
Copied: branches/rtcp_ntp/libminisip/codecs (from rev 2997, branches/rtcp_ntp/codecs)
Deleted: branches/rtcp_ntp/libminisip/codecs/Codec.cxx
===================================================================
--- branches/rtcp_ntp/codecs/Codec.cxx 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/codecs/Codec.cxx 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,70 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004, 2005
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#include<config.h>
-#include"Codec.h"
-#include"G711CODEC.h"
-#include"ILBCCODEC.h"
-#include"SPEEXCODEC.h"
-#include"GsmCodec.h"
-
-MRef<CodecState *> AudioCodec::createState( uint8_t payloadType ){
- switch( payloadType ){
- case 0:
- return new G711CodecState();
-#ifdef HAS_GSM
- case 3:
- return new GsmCodecState();
-#endif
- case 97:
- return new ILBCCodecState();
-#ifdef HAS_SPEEX
- case 114:
- return new SpeexCodecState();
-#endif
- default:
- return NULL;
- }
-}
-
-MRef<AudioCodec *> AudioCodec::create( const std::string & description ){
- if( description == "G.711" ){
- return new G711Codec();
- }
-
- if( description == "iLBC" ){
- return new ILBCCodec();
- }
-
-#ifdef HAS_SPEEX
- if( description == "speex" ){
- return new SpeexCodec();
- }
-#endif
-#ifdef HAS_GSM
- if( description == "GSM" ){
- return new GsmCodec();
- }
-#endif
-
- return NULL;
-}
Copied: branches/rtcp_ntp/libminisip/codecs/Codec.cxx (from rev 2998, branches/rtcp_ntp/codecs/Codec.cxx)
Deleted: branches/rtcp_ntp/libminisip/codecs/Codec.h
===================================================================
--- branches/rtcp_ntp/codecs/Codec.h 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/codecs/Codec.h 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,126 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#ifndef CODECINTERFACE_H
-#define CODECINTERFACE_H
-
-#include<sys/types.h>
-
-#include<string>
-
-#include<libmutil/MemObject.h>
-
-using namespace std;
-
-class Codec;
-class CodecState;
-
-class Codec: public MObject{
- public:
-
- virtual MRef<CodecState *> newInstance()=0;
-
- virtual std::string getCodecName()=0;
-
- virtual std::string getCodecDescription()=0;
-
- virtual uint8_t getSdpMediaType()=0;
-
- virtual std::string getSdpMediaAttributes()=0;
-
- virtual std::string getMemObjectType(){return "Codec";}
-
-};
-
-class CodecState: public MObject{
- public:
- /**
- * @returns Number of bytes in output buffer
- */
- virtual uint32_t encode(void *in_buf, int32_t in_buf_size, void *out_buf)=0;
-
- /**
- *
- * @returns Number of frames in output buffer
- */
- virtual uint32_t decode(void *in_buf, int32_t in_buf_size, void *out_buf)=0;
-
- virtual std::string getMemObjectType(){return "CodecState";};
-
- uint8_t getSdpMediaType(){ return codec->getSdpMediaType(); };
-
- void setCodec( MRef<Codec *> c ){ codec = c; };
-
- MRef<Codec*> getCodec(){return codec;}
-
-#ifdef CODEC_ADAPT
- virtual void setBitrate(int bitrate)=0;
-
- virtual int getBitrate()=0;
-#endif
-
- private:
- MRef<Codec *> codec;
-
-};
-
-
-class AudioCodec : public Codec{
- public:
- /**
- * @returns A CODEC state for the given payloadType
- * (NULL if not handled)
- */
- static MRef<CodecState *> createState( uint8_t payloadType );
-
- /**
- * @returns A CODEC instance for the given description string
- * (NULL if not handled)
- */
- static MRef<AudioCodec *> create( const std::string& );
-
-
-
- /**
- * size of the output of the codec in bytes.
- * Returns -1 if output size may vary.
- */
-// virtual int32_t getEncodedNrBytes()=0;//
-
- virtual int32_t getInputNrSamples()=0;
-
- /**
- * @return Requested sampling freq for the CODEC
- */
- virtual int32_t getSamplingFreq()=0;
-
- /**
- * Time in milliseconds to put in each frame/packet
- */
- virtual int32_t getSamplingSizeMs()=0;
-
- //virtual std::string getMemObjectType(){return "AudioCodec";}
-
-};
-
-
-#endif
Copied: branches/rtcp_ntp/libminisip/codecs/Codec.h (from rev 2998, branches/rtcp_ntp/codecs/Codec.h)
Deleted: branches/rtcp_ntp/libminisip/codecs/G711CODEC.cxx
===================================================================
--- branches/rtcp_ntp/codecs/G711CODEC.cxx 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/codecs/G711CODEC.cxx 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,103 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#include<config.h>
-
-#include"G711CODEC.h"
-#include"g711/codec_g711.h"
-#include<libmutil/massert.h>
-#include<iostream>
-
-G711Codec::G711Codec(){
-
-}
-
-G711Codec::~G711Codec(){
-
-}
-
-uint32_t G711CodecState::encode(void *in_buf, int32_t in_buf_size, void *out_buf){
- massert(in_buf_size==2*160);
-
- short *in_data = (short*)in_buf;
- unsigned char *out_data = (unsigned char*)out_buf;
-
- for (int32_t i=0; i< 160; i++)
- out_data[i]=linear2ulaw(in_data[i]);
-
- // pn430 Added to account for change in return value
- return 160;
-}
-
-uint32_t G711CodecState::decode(void *in_buf, int32_t in_buf_size, void *out_buf){
-// massert(in_buf_size==getEncodedNrBytes());
-
- unsigned char *in_data = (unsigned char*)in_buf;
- short *out_data = (short*)out_buf;
-
- for (int32_t i=0; i< in_buf_size; i++)
- out_data[i]=ulaw2linear(in_data[i]);
-
- return in_buf_size;
-}
-
-
-int32_t G711Codec::getSamplingSizeMs(){
- return 20;
-}
-
-int32_t G711Codec::getSamplingFreq(){
- return 8000;
-}
-
-/*
-int32_t G711Codec::getEncodedNrBytes(){
- return 160;
-}
-*/
-
-int32_t G711Codec::getInputNrSamples(){
- return 160;
-}
-
-string G711Codec::getCodecName(){
- return "G.711";
-}
-
-string G711Codec::getCodecDescription(){
- return "G.711 8kHz, PCMu";
-}
-
-uint8_t G711Codec::getSdpMediaType(){
- return 0;
-}
-
-string G711Codec::getSdpMediaAttributes(){
- return "PCMU/8000/1";
-}
-
-MRef<CodecState *> G711Codec::newInstance(){
- MRef<CodecState *> ret = new G711CodecState();
- ret->setCodec( this );
- return ret;
-}
-
Copied: branches/rtcp_ntp/libminisip/codecs/G711CODEC.cxx (from rev 2998, branches/rtcp_ntp/codecs/G711CODEC.cxx)
Deleted: branches/rtcp_ntp/libminisip/codecs/G711CODEC.h
===================================================================
--- branches/rtcp_ntp/codecs/G711CODEC.h 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/codecs/G711CODEC.h 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,86 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#ifndef G711CODEC_H
-#define G711CODEC_H
-
-#include"Codec.h"
-
-class G711CodecState : public CodecState{
- public:
-
- /**
- * @returns Number of bytes in output buffer
- */
- virtual uint32_t encode(void *in_buf, int32_t in_buf_size, void *out_buf);
-
- /**
- *
- * @returns Number of frames in output buffer
- */
- virtual uint32_t decode(void *in_buf, int32_t in_buf_size, void *out_buf);
-
-#ifdef CODEC_ADAPT
- virtual void setBitrate(int bitrate){};
-
- virtual int getBitrate(){return 64000;};
-#endif
-};
-
-class G711Codec : public AudioCodec{
- public:
- virtual MRef<CodecState *> newInstance();
-
- G711Codec();
- virtual ~G711Codec();
-
- /**
- * @return Requested sampling freq for the CODEC
- */
- virtual int32_t getSamplingFreq();
-
- /**
- * Time in milliseconds to put in each frame/packet. This is 20ms for the G711 codec.
- */
- virtual int32_t getSamplingSizeMs();
-
- /**
- * size of the output of the codec in bytes. This is 160.
- */
-// virtual int32_t getEncodedNrBytes();
-
- virtual int32_t getInputNrSamples();
-
- virtual string getCodecName();
-
- virtual string getCodecDescription();
-
- virtual uint8_t getSdpMediaType();
-
- virtual string getSdpMediaAttributes();
-
- virtual std::string getMemObjectType(){return "G711Codec";}
-
-
-};
-
-#endif
Copied: branches/rtcp_ntp/libminisip/codecs/G711CODEC.h (from rev 2998, branches/rtcp_ntp/codecs/G711CODEC.h)
Deleted: branches/rtcp_ntp/libminisip/codecs/ILBCCODEC.cxx
===================================================================
--- branches/rtcp_ntp/codecs/ILBCCODEC.cxx 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/codecs/ILBCCODEC.cxx 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,133 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-
-#include"ilbc/iLBC_define.h"
-#include"ilbc/iLBC_encode.h"
-#include"ilbc/iLBC_decode.h"
-#include"ILBCCODEC.h"
-#include<libmutil/massert.h>
-
-ILBCCodecState::ILBCCodecState(){
- initEncode(&enc_inst);
- initDecode(&dec_inst, 1);
-
-}
-
-uint32_t ILBCCodecState::encode(void *in_buf, int32_t in_buf_size, void *out_buf){
- float block[160];
- //int s = in_buf_size;
- //s;//dummy op
-
- for (int32_t i=0; i<160; i++)
- block[i]=(float)(((short*)in_buf)[i]);
-
- iLBC_encode((unsigned char *)out_buf, block, &enc_inst);
- return NO_OF_BYTES;
-}
-
-uint32_t ILBCCodecState::decode(void *in_buf, int32_t in_buf_size, void *out_buf){
- float decblock[BLOCKL], dtmp;
- int32_t k;
- //int s = in_buf_size;
- //s;//dummy op
-
- iLBC_decode(decblock, (unsigned char*)in_buf, &dec_inst, 1);
-
- for(k=0;k<BLOCKL;k++){
- dtmp=decblock[k];
- if (dtmp<MIN_SAMPLE)
- dtmp=MIN_SAMPLE;
- else if (dtmp>MAX_SAMPLE)
- dtmp=MAX_SAMPLE;
- ((short*)out_buf)[k] = (short) dtmp;
- }
-
- return BLOCKL;
-}
-
-#if 0
-void ILBCCodec::decode(void *out_buf){
- float decblock[160], dtmp;
- int32_t k;
- unsigned char dummyencoded[38];
- for (k=0; k<50; k++)
- dummyencoded[k]=0;
-
- iLBC_decode(decblock, (unsigned char*)dummyencoded, &dec_inst, 0);
-
- for(k=0;k<BLOCKL;k++){
- dtmp=decblock[k];
- if (dtmp<MIN_SAMPLE)
- dtmp=MIN_SAMPLE;
- else if (dtmp>MAX_SAMPLE)
- dtmp=MAX_SAMPLE;
- ((short*)out_buf)[k] = (short) dtmp;
- }
-}
-#endif
-
-
-int32_t ILBCCodec::getSamplingSizeMs(){
- massert(BLOCKL==160);
- return 20;
-}
-
-/*
-int32_t ILBCCodec::getEncodedNrBytes(){
- massert(BLOCKL==160);
- massert(38==NO_OF_BYTES);
- return 38;
-}
-*/
-
-int32_t ILBCCodec::getInputNrSamples(){
- return 160;
-}
-
-string ILBCCodec::getCodecName(){
- return "iLBC";
-}
-
-string ILBCCodec::getCodecDescription(){
- return "iLBC - Internet Low Bit rate Codec, 13.33kb/s, 30ms blocks";
-
-}
-
-int32_t ILBCCodec::getSamplingFreq(){
- return 8000;
-}
-
-
-uint8_t ILBCCodec::getSdpMediaType(){
- return 97;
-}
-
-string ILBCCodec::getSdpMediaAttributes(){
- return "iLBC/8000";
-}
-
-MRef<CodecState *> ILBCCodec::newInstance(){
- MRef<CodecState *> ret = new ILBCCodecState();
- ret->setCodec( this );
- return ret;
-}
Copied: branches/rtcp_ntp/libminisip/codecs/ILBCCODEC.cxx (from rev 2998, branches/rtcp_ntp/codecs/ILBCCODEC.cxx)
Deleted: branches/rtcp_ntp/libminisip/codecs/ILBCCODEC.h
===================================================================
--- branches/rtcp_ntp/codecs/ILBCCODEC.h 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/codecs/ILBCCODEC.h 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,92 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#ifndef ILBCCodec_H
-#define ILBCCodec_H
-
-#include<config.h>
-
-#include"Codec.h"
-
-#include"ilbc/iLBC_define.h"
-#include"ilbc/iLBC_encode.h"
-#include"ilbc/iLBC_decode.h"
-
-
-class ILBCCodecState : public CodecState{
- public:
- ILBCCodecState();
-
- /**
- * @returns Number of bytes in output buffer
- */
- virtual uint32_t encode(void *in_buf, int32_t in_buf_size, void *out_buf);
-
- /**
- *
- * @returns Number of frames in output buffer
- */
- virtual uint32_t decode(void *in_buf, int32_t in_buf_size, void *out_buf);
-
-#ifdef CODEC_ADAPT
- virtual void setBitrate(int bitrate){};
-
- virtual int getBitrate(){return 0;};
-#endif
-
- private:
- iLBC_Enc_Inst_t enc_inst;
- iLBC_Dec_Inst_t dec_inst;
-
-};
-
-class ILBCCodec : public AudioCodec{
- public:
- virtual MRef<CodecState *> newInstance();
-
- /**
- * @return Requested sampling freq for the CODEC
- */
- virtual int32_t getSamplingFreq();
-
- /**
- * Time in milliseconds to put in each frame/packet. This is 30ms for the ILBC codec.
- */
- virtual int32_t getSamplingSizeMs();
-
- /**
- * size of the output of the codec in bytes. This is 50.
- */
-// virtual int32_t getEncodedNrBytes();
-
- virtual int32_t getInputNrSamples();
-
- virtual string getCodecName();
-
- virtual string getCodecDescription();
-
- virtual uint8_t getSdpMediaType();
-
- virtual string getSdpMediaAttributes();
-};
-
-#endif
Copied: branches/rtcp_ntp/libminisip/codecs/ILBCCODEC.h (from rev 2998, branches/rtcp_ntp/codecs/ILBCCODEC.h)
Deleted: branches/rtcp_ntp/libminisip/codecs/Makefile.am
===================================================================
--- branches/rtcp_ntp/codecs/Makefile.am 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/codecs/Makefile.am 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,21 +0,0 @@
-SUBDIRS = g711 ilbc
-
-noinst_LIBRARIES = libcodecs.a
-
-libcodecs_a_SOURCES = ILBCCODEC.cxx \
- G711CODEC.cxx \
- Codec.cxx
-
-if HAS_SPEEX
-libcodecs_a_SOURCES += SPEEXCODEC.cxx
-endif
-
-if HAS_GSM
-libcodecs_a_SOURCES += GsmCodec.cxx
-endif
-
-noinst_HEADERS = G711CODEC.h \
- ILBCCODEC.h \
- SPEEXCODEC.h \
- GsmCodec.h \
- Codec.h
Copied: branches/rtcp_ntp/libminisip/codecs/Makefile.am (from rev 2998, branches/rtcp_ntp/codecs/Makefile.am)
Deleted: branches/rtcp_ntp/libminisip/codecs/SPEEXCODEC.cxx
===================================================================
--- branches/rtcp_ntp/codecs/SPEEXCODEC.cxx 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/codecs/SPEEXCODEC.cxx 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,171 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-#include<config.h>
-
-#ifdef HAS_SPEEX
-
-#include"SPEEXCODEC.h"
-#include<iostream>
-
-#include"speex/speex.h"
-#include<libmutil/print_hex.h>
-
-SpeexCodecState::SpeexCodecState(){
- static int VBROn=1;
- static int br=8000;
-
- speex_bits_init(&bits); // both for encode and decode
-
- // Encoder Initialization
-
-
- // As a start, just use the narrow-band mode is implemented
- enc_state = speex_encoder_init(&speex_nb_mode);
-
- // This will hand in the frame size used by the encoder
- speex_encoder_ctl(enc_state,SPEEX_GET_FRAME_SIZE,&frame_size);
- //speex_encoder_ctl(enc_state,SPEEX_SET_VBR,&VBROn);
- speex_encoder_ctl(enc_state,SPEEX_SET_BITRATE,&br);
-
-
- // Decoder Initialization
-
- // As a start, just use the narrow-band mode is implemented
- dec_state = speex_decoder_init(&speex_nb_mode);
-
- // This will hand in the frame size used by the decoder
- speex_decoder_ctl(dec_state, SPEEX_GET_FRAME_SIZE, &frame_size);
- speex_decoder_ctl(enc_state,SPEEX_SET_VBR,&VBROn);
-
- output_frame = new float[160];
-
-}
-
-SpeexCodecState::~SpeexCodecState(){
-
- speex_bits_destroy(&bits);
- speex_encoder_destroy(enc_state);
- speex_decoder_destroy(dec_state);
- delete [] output_frame;
-}
-
-
-uint32_t SpeexCodecState::encode(void *in_buf, int32_t in_buf_size, void *out_buf){
-
-
- for (int i=0; i< in_buf_size; i++){
- input_frame[i]= (float) ((short*)in_buf)[i];
- }
-
-
- // now for every input frame:
- speex_bits_reset(&bits);
- speex_encode(enc_state, input_frame, &bits);
- // returns the number of bytes that need to be written
- //int bNum = speex_bits_nbytes(&bits);
- nbBytes = speex_bits_write(&bits, (char*)out_buf, MAX_NB_BYTES);
-
- //out_buf = (void *) bytes_ptr; // not sure
- //cerr << print_hex((unsigned char*)(out_buf), nbBytes)<<endl;
-
- return nbBytes;
-
-}
-
-uint32_t SpeexCodecState::decode(void *in_buf, int32_t in_buf_size, void *out_buf){
-
-
- input_bytes = (char *) in_buf; // should in_buf also be changed to short (as in encode function)? If so, then then you should have a for loop here
- //nbBytes = (int) in_buf_size;
-
-
- // for every input frame:
- speex_bits_read_from(&bits, input_bytes, in_buf_size);
- speex_decode(dec_state, &bits, output_frame);
-
- for (int i=0; i< 160; i++){
- ((short *)out_buf)[i]= (short)output_frame[i];
- }
-
- return 160;
-
-
-}
-
-void SpeexCodecState::setBitrate(int bitrate){
- static int br=bitrate;
- speex_encoder_ctl(enc_state,SPEEX_SET_BITRATE,&bitrate);
-
-}
-
-
-int32_t SpeexCodec::getSamplingSizeMs(){
- return 20;
-}
-
-int32_t SpeexCodec::getSamplingFreq(){
- return 8000;
-}
-
-
-/*
-int32_t SpeexCodec::getEncodedNrBytes(){
- return 160;
-}
-*/
-
-
-int32_t SpeexCodec::getInputNrSamples(){
- return 160;
-}
-
-string SpeexCodec::getCodecName(){
- return "SPEEX";
-}
-
-string SpeexCodec::getCodecDescription(){
- return "SPEEX 8kHz, Speex";
- // for now we are only using narrow-band (8kHz)
-
-}
-
-uint8_t SpeexCodec::getSdpMediaType(){
- return 114;
- // Speex uses Dynamic Payload Type, meaning that there isn't a fixed assigned
- // payload type number for it. So, we use an agreed number in minisip
- // for speex's payload type (114).
-}
-
-string SpeexCodec::getSdpMediaAttributes(){
- return "speex/8000/1";
- // <encoding_name>/<clock_rate>/<number_of_channels(for audio streams)>
- // Here we use the narrow-band (8000) using only one channel (non-sterio)
-}
-
-MRef<CodecState *> SpeexCodec::newInstance(){
- MRef<CodecState *> ret = new SpeexCodecState();
- ret->setCodec( this );
- return ret;
-}
-
-#endif
-
Copied: branches/rtcp_ntp/libminisip/codecs/SPEEXCODEC.cxx (from rev 2998, branches/rtcp_ntp/codecs/SPEEXCODEC.cxx)
Deleted: branches/rtcp_ntp/libminisip/codecs/SPEEXCODEC.h
===================================================================
--- branches/rtcp_ntp/codecs/SPEEXCODEC.h 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/codecs/SPEEXCODEC.h 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,104 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#ifndef SpeexCodec_H
-#define SpeexCodec_H
-
-#include"Codec.h"
-
-#ifdef HAS_SPEEX
-
-#include"speex/speex.h"
-
-#define MAX_NB_BYTES 1024
-
-class SpeexCodecState : public CodecState{
- public:
- SpeexCodecState();
- virtual ~SpeexCodecState();
-
- /**
- * @returns Number of bytes in output buffer
- */
- virtual uint32_t encode(void *in_buf, int32_t in_buf_size, void *out_buf);
-
- /**
- *
- * @returns Number of samples in output buffer
- */
- virtual uint32_t decode(void *in_buf, int32_t in_buf_size, void *out_buf);
-
- virtual void setBitrate(int bitrate);
-
- virtual int SpeexCodecState::getBitrate(){
- int br;
- speex_encoder_ctl(enc_state,SPEEX_GET_BITRATE,&br);
- return br;
- }
-
- private:
- void *enc_state;
- void *dec_state;
- SpeexBits bits;
- float input_frame[160];
- int nbBytes;
- char bytes_ptr[MAX_NB_BYTES];
- char *input_bytes;
- float *output_frame;
- int frame_size;
-};
-
-
-class SpeexCodec : public AudioCodec{
- public:
- virtual MRef<CodecState *> newInstance();
-
- /**
- * @return Requested sampling freq for the CODEC
- */
- virtual int32_t getSamplingFreq();
-
- /**
- * Time in milliseconds to put in each frame/packet. This is 20ms for the SPEEX codec.
- */
- virtual int32_t getSamplingSizeMs();
-
- /**
- * size of the output of the codec in bytes. This is 160.
- */
-// virtual int32_t getEncodedNrBytes();
-
- virtual int32_t getInputNrSamples();
-
- virtual string getCodecName();
-
- virtual string getCodecDescription();
-
- virtual uint8_t getSdpMediaType();
-
- virtual string getSdpMediaAttributes();
-
-};
-
-#endif //HAS_SPEEX
-
-#endif
Copied: branches/rtcp_ntp/libminisip/codecs/SPEEXCODEC.h (from rev 2998, branches/rtcp_ntp/codecs/SPEEXCODEC.h)
Copied: branches/rtcp_ntp/libminisip/codecs/g711 (from rev 2998, branches/rtcp_ntp/codecs/g711)
Copied: branches/rtcp_ntp/libminisip/codecs/ilbc (from rev 2998, branches/rtcp_ntp/codecs/ilbc)
Copied: branches/rtcp_ntp/libminisip/conf (from rev 2997, branches/rtcp_ntp/conf)
Deleted: branches/rtcp_ntp/libminisip/conf/ConfCallback.h
===================================================================
--- branches/rtcp_ntp/conf/ConfCallback.h 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/conf/ConfCallback.h 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,46 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#ifndef CONFCALLBACK_H
-#define CONFCALLBACK_H
-
-#include<config.h>
-
-#include "ConfMember.h"
-
-#include<libmutil/CommandString.h>
-
-//TODO: Add "enqueueCommand" functionality to this class, and make "qtgui"
-//package move to the callback as much as possible --EE
-
-class ConfCallback{
-
- public:
- //virtual void guicb_handleConfCommand(string &)=0;
- virtual void confcb_handleSipCommand(string &)=0;
- virtual void confcb_handleSipCommand(CommandString &)=0;
- virtual void confcb_handleGuiCommand(CommandString &)=0;
- virtual string confcb_doJoin(string user,minilist <ConfMember> *list, string confId)=0;
- virtual string confcb_doConnect(string user, string confId)=0;
-};
-
-#endif
Copied: branches/rtcp_ntp/libminisip/conf/ConfCallback.h (from rev 2998, branches/rtcp_ntp/conf/ConfCallback.h)
Deleted: branches/rtcp_ntp/libminisip/conf/ConfMember.h
===================================================================
--- branches/rtcp_ntp/conf/ConfMember.h 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/conf/ConfMember.h 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,32 +0,0 @@
-//
-// C++ Interface: ConfMember
-//
-// Description:
-//
-//
-// Author: Max Loubser <loubser at kth.se>, (C) 2005
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
-#ifndef _CONFMEMBER_H
-#define _CONFMEMBER_H
-
-class ConfMember {
- public:
-
- ConfMember(string the_uri, string the_callid ) {
- cerr << "creating conf member" << endl;
- uri = the_uri ;
- callid = the_callid;
- }
-
- string uri;
- string callid;
-
-
-
-};
-
-
-#endif
Copied: branches/rtcp_ntp/libminisip/conf/ConfMember.h (from rev 2998, branches/rtcp_ntp/conf/ConfMember.h)
Deleted: branches/rtcp_ntp/libminisip/conf/ConferenceControl.cxx
===================================================================
--- branches/rtcp_ntp/conf/ConferenceControl.cxx 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/conf/ConferenceControl.cxx 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,683 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#include<config.h>
-#include<assert.h>
-#include<stdio.h>
-#include<vector>
-#include"ConferenceControl.h"
-#include"../minisip/MessageRouter.h"
-#include"../minisip/gui/Gui.h"
-//#include"../minisip/gui/textui/MinisipTextUI.h"
-#include<libmutil/MemObject.h>
-#include<libmutil/trim.h>
-#include<libmutil/termmanip.h>
-#include<libmutil/CommandString.h>
-#include<libmsip/SipDialogContainer.h>
-#include<libmsip/SipCommandString.h>
-//#include"../sip/DefaultDialogHandler.h"
-
-
-//extern TextUI *debugtextui;
-
-
-
-
-
-ConferenceControl::ConferenceControl(){
-
- numPending = 0;
-}
-ConferenceControl::ConferenceControl(string configUri, string cid, bool islocal){
-
- confId=cid;
-
- uint32_t i = (uint32_t)configUri.find("@");
- assert(i!=string::npos);
- myUri=configUri.substr(0,i);
- myDomain=trim(configUri.substr(i));
- //cerr<<"my Uri and domain: "+myUri+" "+myDomain<<endl;
- incoming=islocal;
-
- numPending = 0;
-}
-minilist<ConfMember> * ConferenceControl::getConnectedList()
-{
- return &connectedList;
-}
-void ConferenceControl::setCallback(ConfCallback *cb){
- this->callback=cb;
-}
-
-ConfCallback *ConferenceControl::getCallback(){
- return callback;
-}
-void ConferenceControl::setPendingList(string user)
-{
- user=addDomainToPrefix(user);
- pendingList.push_back((ConfMember(user, "")));
- //pendingList[numPending]=user;
- numPending++;
-}
-/*string[10] ConferenceControl::getPendingList()
-{
- return pendingList;
-}*/
-void ConferenceControl::setConnectedList(string user)
-{
- connectedList.push_back((ConfMember(user, "")));
- /*
- connectedList.uris[connectedList.numUser]=user;
- connectedList.numUser++;
- */
-}
-/*string[10] ConferenceControl::getConnectedList()
-{
- return connectedList.uris;
-}*/
-
-
-void ConferenceControl::handleGuiCommand(string cmd){
-
-
- //cerr << "CC: from MR -> CC: handleGuiCommand"<< endl;
- //string uri = trim(cmd.substr(5));
- //displayMessage(cmd);
-}
-void ConferenceControl::handleGuiCommand(CommandString &command){
-
-
- //cerr << "CC: from MR -> CC: handleGuiCommand command"<< endl;
- if(command.getOp()==SipCommandString::accept_invite)
- {
- //pendingList[numPending]=command.getParam();
- //pendingListCallIds[numPending]=command.getDestinationId();
- string remote=addDomainToPrefix(command.getParam());
- pendingList.push_back((ConfMember(remote, command.getDestinationId())));
- //cerr<<"call is accepted=>pending list: "<<endl;
- //printList(&pendingList);
- numPending++;
- string users;
- for(int t=0;t<connectedList.size();t++)
-
- users=users+ ((connectedList[t]).uri) + ";"; //was connectedList.uris[t]+";";
- //cerr<<"users "+users<<endl;
- command.setParam2(users);
- command.setParam3(confId);
- //command.setParam2((string) &connectedList);
- //cerr<<"(string) &connectedList************** "+(&connectedList)<<endl;
- callback->confcb_handleSipCommand(command);
- }
- if(command.getOp()==SipCommandString::hang_up)
- {
- int t;
- for(t=0;t<connectedList.size();t++)
- {
- CommandString hup(connectedList[t].callid, SipCommandString::hang_up);
- callback->confcb_handleSipCommand(hup);
- }
- for(t=0;t<pendingList.size();t++)
- {
- CommandString hup(pendingList[t].callid, SipCommandString::hang_up);
- callback->confcb_handleSipCommand(hup);
- }
- ((MessageRouter *)(callback))->removeConferenceController(this);
- }
- if(command.getOp()=="join")
- {
- bool done=false;
- string sip_url=command.getParam();
-
- sip_url=addDomainToPrefix(sip_url);
- int t;
- for(t=0;t<connectedList.size()&&!done;t++)
-
- if(connectedList[t].uri==sip_url)
- {
- done=true;
- }
- for(t=0;t<pendingList.size()&&!done;t++)
- if(pendingList[t].uri==sip_url)
- {
- done=true;
- }
- if(done)
- {
- CommandString cmd("","error_message","user already added ");
- callback->confcb_handleGuiCommand(cmd);
- }
- else
- {
- callId = callback->confcb_doJoin(sip_url, &connectedList, confId);
-
- pendingList.push_back((ConfMember(sip_url, callId)));
- sendUpdatesToGui();
- }
-
- //cerr <<"conf "+callId<< endl;
-
- }
-
- //string uri = trim(cmd.substr(5));
- //displayMessage(cmd);
-}
-void ConferenceControl::handleGuiDoInviteCommand(string sip_url){
-
- //cerr << "CC: from MR -> CC: handleGuiDoInviteCommand"<< endl;
- /*cerr <<"conf "+sip_url<< endl;
- cerr <<"conf "+confId<< endl;
- //BM pendingList[numPending]=sip_url;
- printList(&connectedList);*/
-
- //numPending++;
-
-
-
- callId = callback->confcb_doJoin(sip_url, &connectedList, confId);
-
-
- //cerr <<"conf "+callId<< endl;
- sip_url=addDomainToPrefix(sip_url);
- pendingList.push_back((ConfMember(sip_url, callId)));
- sendUpdatesToGui();
- if (callId=="malformed"){
- //state="IDLE";
- //setPrompt(state);
- //displayMessage("The URI is not a valid SIP URI", red);
- //callId="";
- }else{
- //state="TRYING";
- //setPrompt(state);
- //cerr <<"Created call with id="+callId<<endl;
- }
- //string uri = trim(cmd.substr(5));
- //displayMessage(cmd);
-}
-void ConferenceControl::handleSipCommand(CommandString &cmd){
- //cerr << "CC: from MR -> CC: handleSipCommand"<< endl;
-
- if (cmd.getOp()=="invite_ok"){
- //state="INCALL";
- //gui->setPrompt(state);
- cerr << "CC: PROGRESS: remote participant accepted to join the conference..."<< endl;
- //cerr<<"print connected list-------------"<<endl;
- //printList(&connectedList);
- //cerr<<"print pending list-------------"<<endl;
- //printList(&pendingList);
- int i=0;
- string line="";
-
- string users=cmd.getParam();
- minilist<ConfMember> receivedList;
-
- while (users.length()!=0 &&!((uint32_t)i>(users.length()-1))){
- line+=users[i++];
- if(users[i]==';')
- {
- receivedList.push_back((ConfMember(line, "")));
- //connectedList[numConnected]=line;
- //cerr<< "CC------line: " + line << endl;
- line="";
- i++;
- }
- }
- handleOkAck(cmd.getDestinationId() ,&receivedList);
- //cerr<<"print connected list-------------"<<endl;
- //printList(&connectedList);
- //cerr<<"print pending list-------------"<<endl;
- //printList(&pendingList);
- }
- if (cmd.getOp()=="invite_ack"){
- //state="INCALL";
- //gui->setPrompt(state);
- //cerr << "CC: PROGRESS: ack received..."<< endl;
- //cerr<<"print connected list-------------"<<endl;
- //printList(&connectedList);
- //cerr<<"print pending list-------------"<<endl;
- //printList(&pendingList);
- int i=0;
- string line="";
- string users=cmd.getParam();
- //cerr<<"users-------------"+users<<endl;
- minilist<ConfMember> receivedList;
- while (users.length()!=0 &&!((uint32_t)i>(users.length()-1))){
- line+=users[i++];
- if(users[i]==';')
- {
- receivedList.push_back((ConfMember(line, "")));
- //connectedList[numConnected]=line;
- //cerr<< "CC------line: " + line << endl;
- line="";
- i++;
- }
- }
- handleOkAck(cmd.getDestinationId() ,&receivedList);
- //cerr<<"print connected list-------------"<<endl;
- //printList(&connectedList);
- //cerr<<"print pending list-------------"<<endl;
- //printList(&pendingList);
- }
- if (cmd.getOp()=="remote_ringing"){
- //state="REMOTE RINGING";
- //setPrompt(state);
- cerr << "CC: PROGRESS: the remove UA is ringing..."<< endl;
- //displayMessage("PROGRESS: the remove UA is ringing...", blue);
- }
- if (cmd.getOp()=="myuri"){
- myUri=cmd.getParam();
- //cerr << "my URI is "+myUri<< endl;
- //displayMessage("PROGRESS: the remove UA is ringing...", blue);
- }
-
-
-
- /*if (autoanswer && cmd.getOp()==SipCommandString::incoming_available){
- CommandString command(callId, SipCommandString::accept_invite);
- callback->guicb_handleCommand(command);
- state="INCALL";
- setPrompt(state);
- displayMessage("Autoanswered call from "+ cmd.getParam());
- return;
- }*/
-
- if (cmd.getOp()==SipCommandString::remote_user_not_found){
- //state="IDLE";
- //setPrompt(state);
- cerr << "CC: User "+cmd.getDestinationId()+" not found."<< endl;
- removeMember(cmd.getDestinationId());
- sendUpdatesToGui();
- //displayMessage("User "+cmd.getParam()+" not found.",red);
- callId=""; //FIXME: should check the callId of cmd.
- }
-
-
- if (cmd.getOp()==SipCommandString::security_failed){
- //state="IDLE";
- //setPrompt(state);
- cerr << "CC: Security failed with user "+cmd.getDestinationId()<< endl;
- removeMember(cmd.getDestinationId());
- sendUpdatesToGui();
- //displayMessage("User "+cmd.getParam()+" not found.",red);
- callId=""; //FIXME: should check the callId of cmd.
- }
- if (cmd.getOp()==SipCommandString::remote_unacceptable){
- //state="IDLE";
- //setPrompt(state);
- cerr << "CC: User "+cmd.getDestinationId()+" unacceptable."<< endl;
- removeMember(cmd.getDestinationId());
- sendUpdatesToGui();
- //displayMessage("User "+cmd.getParam()+" not found.",red);
- callId=""; //FIXME: should check the callId of cmd.
- }
-
-
- if (cmd.getOp()==SipCommandString::remote_cancelled_invite){
- //state="IDLE";
- //setPrompt(state);
- cerr << "CC: User "+cmd.getDestinationId()+" cancelled invite"<< endl;
- removeMember(cmd.getDestinationId());
- sendUpdatesToGui();
- //displayMessage("User "+cmd.getParam()+" not found.",red);
- callId=""; //FIXME: should check the callId of cmd.
- }
- if (cmd.getOp()=="conf_connect_received"){
- cerr << "CC: connect receieved: "+cmd.getParam()<< endl;
- string remote=addDomainToPrefix(cmd.getParam());
- pendingList.push_back((ConfMember(remote, cmd.getDestinationId())));
- //cerr<<"call is accepted=>pending list: "<<endl;
- //printList(&pendingList);
- sendUpdatesToGui();
- string users;
- for(int t=0;t<connectedList.size();t++)
-
- users=users+ ((connectedList[t]).uri) + ";"; //was connectedList.uris[t]+";";
- //cerr<<"users "+users<<endl;
- cmd.setParam2(users);
-
- cmd.setOp(SipCommandString::accept_invite);
- //command.setParam2((string) &connectedList);
- //cerr<<"(string) &connectedList************** "+(&connectedList)<<endl;
- callback->confcb_handleSipCommand(cmd);
- //displayMessage("ERROR: "+cmd.getParam(), red);
- }
-
- if (cmd.getOp()==SipCommandString::remote_hang_up){
- //state="IDLE";
- //setPrompt(state);
- removeMember(cmd.getDestinationId());
- sendUpdatesToGui();
- cerr << "CC: Remote user ended the call."<< endl;
- //displayMessage("Remote user ended the call.",red);
- callId=""; //FIXME: should check the callId of cmd.
- }
-
-
-
- if (cmd.getOp()==SipCommandString::transport_error){
- //state="IDLE";
- //setPrompt(state);
- removeMember(cmd.getDestinationId());
- sendUpdatesToGui();
- cerr << "CC: The call could not be completed because of a network error."<< endl;
- //displayMessage("The call could not be completed because of a network error.", red);
-
- }
-
-
- if (cmd.getOp()=="error_message"){
- cerr << "CC: ERROR: "+cmd.getParam()<< endl;
- //displayMessage("ERROR: "+cmd.getParam(), red);
- }
-
- if (cmd.getOp()=="remote_reject"){
- removeMember(cmd.getDestinationId());
- sendUpdatesToGui();
- cerr << "CC: The remote user rejected the call."<< endl;
- //displayMessage("The remote user rejected the call.", red);
- }
-
-
- /*if (cmd.getOp()==SipCommandString::incoming_available){
- if(!inCall){
- state="ANSWER?";
- setPrompt(state);
- callId=cmd.getDestinationId();
- displayMessage("The incoming call from "+cmd.getParam(), blue);
- }
- else{
- displayMessage("You missed call from "+cmd.getParam(), red);
- CommandString hup(cmd.getDestinationId(), SipCommandString::reject_invite);
- callback->guicb_handleCommand(hup);
-
- }
-
- }*/
-
-
-
- /****
- * p2tAddUser
- * DestinationID: CallId (SipDialogP2Tuser)
- * Param1: SIP URI
- * Description: a remote user wants to be added to a P2T Session.
- * This command is received when the SipDialogP2Tuser
- * is in the RINGING state and waits for an accept.
- ****/
- /*else if (cmd.getOp()=="p2tAddUser"){
- if(inCall==true && p2tmode==true){
- //send automatically an accept back
- CommandString command(cmd.getDestinationId(), SipCommandString::accept_invite);
- callback->guicb_handleCommand(command);
-
- if(grpList->isParticipant(cmd.getParam())==false){
- grpList->addUser(cmd.getParam());
- displayMessage("User " + cmd.getParam() + " added!", blue);
- }
-
- }
- else if(inCall==true && p2tmode==false){
- //do nothing, because
- //the user has first to accept or deny
- //a incoming P2T Session. The answer will
- //be sent there to this user
- }
- }*/
-
- /****
- * p2tRemoveUser
- * DestinationID: GroupId (SipDialogP2T)
- * Param1: SIP URI
- * Param2: reason
- * Description: a remote user wants to be added to a P2T Session.
- * This command is received when the SipDialogP2Tuser
- * is in the RINGING state and waits for an accept.
- ****/
- /*else if (cmd.getOp()=="p2tRemoveUser"){
- if(inCall==true && p2tmode==true){
- displayMessage("User " + cmd.getParam() + " removed ("+ cmd.getParam2() +").", red);
- grpList->removeUser(cmd.getParam());
- }
- }*/
-
- /****
- * p2tModifyUser
- * DestinationID: GroupId (SipDialogP2T)
- * Param1: SIP URI
- * Param2: status
- * Description: information about a state (in the floor control)
- * of a user.
- ****/
- /*else if (cmd.getOp()=="p2tModifyUser"){
- if(inCall==true && p2tmode==true){
-
- int status=0;
- for(uint32_t k=0;k<cmd.getParam2().size();k++)
- status = (status*10) + (cmd.getParam2()[k]-'0');
-
- grpList->getUser(cmd.getParam())->setStatus(status);
- }
- }*/
-
- /****
- * p2tInvitation
- * DestinationID: GroupID (SipDialogP2T)
- * Param1: Group Member List (XML-code)
- * Param2: uri inviting user
- *
- * Description: an invitation to a P2T Session
- ****/
- /*else if (cmd.getOp()=="p2tInvitation"){
- //if already in a call, send DENY back
- if(inCall){
-
- //Close SipDialogP2T
- //CommandString cmd_term(cmd.getDestinationId(), "p2tTerminate");
- //callback->guicb_handleCommand(cmd_term);
-
- //inform SipDialogP2Tuser
- //CommandString cmd_rej(cmd.getParam3(), SipCommandString::reject_invite);
- //callback->guicb_handleCommand(cmd_rej);
-
- //displayMessage("You missed P2T invitation from " + cmd.getParam2() +".", red);
- }
- //aks user to accept
- else{
- inCall=true;
- grpList = new GroupList(cmd.getParam());
- inviting_user=cmd.getParam2();
- //inviting_callId=cmd.getParam3();
- p2tGroupId=grpList->getGroupIdentity();
-
- displayMessage(inviting_user + " invited you to a P2T Session:", blue);
- showGroupList();
- displayMessage("type 'accept' or 'deny'", blue);
- state="P2T ACCEPT?";
- setPrompt("P2T ACCEPT?");
- }
-
- }*/
-
- /****
- * p2tSessionCreated
- * DestinationID:
- * Param1: GroupId (SipDialogP2T)
- * Param2:
- * Param3:
- * Description: the P2T Session is set up
- ****/
- /*else if (cmd.getOp()=="p2tSessionCreated"){
- p2tGroupId=cmd.getParam();
- displayMessage("P2T Session "+ p2tGroupId + " created", green);
- grpList->setGroupIdentity(p2tGroupId);
- state="P2T CONNECTED";
- setPrompt(state);
- }
-
- else if (cmd.getOp().substr(0,3)=="p2t"){
- displayMessage("Received: "+cmd.getOp(), blue);
- }*/
-}
-
-/**
-* Moves a member from pending to connected and look for new members
-*/
-void ConferenceControl::sendUpdatesToGui()
-{
- string connectedusers="";
- int t;
- for(t=0;t<connectedList.size();t++)
- connectedusers=connectedusers+ ((connectedList[t]).uri) + ", ";
- //cerr<<"users "+connectedusers<<endl;
- string pendingusers="";
- for(t=0;t<pendingList.size();t++)
- pendingusers=pendingusers+ ((pendingList[t]).uri) + ", ";
- //cerr<<"users "+pendingusers<<endl;
- CommandString cmd(confId,"list updated",connectedusers,pendingusers);
- callback->confcb_handleGuiCommand(cmd);
-}
-void ConferenceControl::handleOkAck(string callid, minilist<ConfMember> *list) {
- pendingToConnected(callid);
- updateLists(list);
- sendUpdatesToGui();
-}
-
-/**
-* Print a list of conference members
-*/
-void ConferenceControl::printList(minilist<ConfMember> *list) {
- for (int i = 0; i < list->size(); i++ ) {
- cerr << "Member : " + ((*list)[i]).uri << endl;
- cerr << "CallId : " + ((*list)[i]).callid << endl;
- }
-}
-
-
-/**
-* Move a member from pending to connected status
-*/
-void ConferenceControl::pendingToConnected(string memberid) {
-
- //find member in the pending list and remove it
- int i = 0;
- bool done = false;
-
- while ((!done) && (i < pendingList.size() ) ) {
-
- if (pendingList[i].callid == memberid) {
- connectedList.push_back(pendingList[i]);
- pendingList.remove(i);
- done = true;
- }
-
- i++;
- }
-
- assert(done==true);
-
-}
-void ConferenceControl::removeMember(string memberid) {
-
- //find member in the pending list and remove it
- int i = 0;
- bool done = false;
- //printList(&pendingList);
- //cerr<<"callid "+memberid<<endl;
- while ((!done) && (i < pendingList.size() ) ) {
-
- if (pendingList[i].callid == memberid) {
- pendingList.remove(i);
- done = true;
- }
-
- i++;
- }
- i=0;
- while ((!done) && (i < connectedList.size() ) ) {
-
- if (connectedList[i].callid == memberid) {
- connectedList.remove(i);
- done = true;
- }
-
- i++;
- }
-
- //assert(done==true);
-
-}
-/**
-* Check for new members to connect to
-*/
-void ConferenceControl::updateLists(minilist<ConfMember> *list) {
- bool handled = false;
-
-
- for (int i = 0; i < list->size(); i++) {
- string current = (*list)[i].uri;
-
- //check against pending list
- for (int j = 0; j < pendingList.size(); j++ ) {
- if (current == pendingList[j].uri) {
- handled = true;
- break;
- }
- }
-
- //check against connected list
- if (!handled) {
- for (int j = 0; j < connectedList.size(); j++ ) {
- if (current == connectedList[j].uri) {
- handled = true;
- break;
- }
- }
-
- }
-
- //if not found in pending or connected list then add to pending list
- if (!handled&¤t!=(myUri+myDomain)) {
- //send a connect message to the newly discovered conference members
- callId = callback->confcb_doConnect(current,confId);
- current=addDomainToPrefix(current);
- pendingList.push_back(ConfMember(current, callId ) );
-
- //cerr<<"update pending list=> "+current<<endl;
- }
-
- }
-}
-
-string ConferenceControl::addDomainToPrefix(string remoteUri)
-{
- bool done=false;
- string result=remoteUri;
- for(unsigned int i=0;i<remoteUri.length();i++)
- {
- if(remoteUri[i]=='@'){
- done=true;
- break; }
- }
- if(!done)
- result=remoteUri+myDomain;
- return result;
-}
-
Copied: branches/rtcp_ntp/libminisip/conf/ConferenceControl.cxx (from rev 2998, branches/rtcp_ntp/conf/ConferenceControl.cxx)
Deleted: branches/rtcp_ntp/libminisip/conf/ConferenceControl.h
===================================================================
--- branches/rtcp_ntp/conf/ConferenceControl.h 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/conf/ConferenceControl.h 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,126 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#ifndef _CONFERENCECONTROL_H
-#define _CONFERENCECONTROL_H
-
-#include<string>
-#include<libmutil/CommandString.h>
-//#include"../sip/SipSoftPhoneConfiguration.h"
-//#include"../minisip/gui/Gui.h"
-//#include"../../../p2t/GroupList.h"
-//#include"../../../p2t/GroupListClient.h"
-//#include"../p2t/GroupListUserElement.h"
-//#include"../p2t/P2T.h"
-//#include<libmutil/TextUI.h>
-#include<libmutil/minilist.h>
-#include "ConfCallback.h"
-
-
-#include "ConfMember.h"
-
-
-using namespace std;
-/**
- * A text user interface.
- * The interface interacts with the user via the terminal, and with the <code>Sip</code> class
- * with <code>SipSMCommands</code> via the <code>MessageRouter</code>.
- */
-typedef struct CCList {
- string uris[10];
- string callids[10];
- int numUser;
-} cclist;
-
-class ConferenceControl{
- public:
- ConferenceControl();
- ConferenceControl(string configUri, string cid, bool islocal);
- //void setGui(Gui *guiptr){gui = guiptr;};
- void handleGuiCommand(string cmd);
- void handleGuiCommand(CommandString &command);
- void handleGuiDoInviteCommand(string sip_url);
-
- void handleSipCommand(CommandString &cmd);
- //virtual void handleGuiCommand(string);
- void setCallback(ConfCallback *cb);
- void setPendingList(string user);
- //string[10] getPendingList();
- void setConnectedList(string user);
- //string[10] getConnectedList();
- ConfCallback* getCallback();
-
-
- /**
- * Moves a member from pending to connected and look for new members
- */
- void handleOkAck(string callid, minilist<ConfMember> *list);
-
- /**
- * Print a list of conference members
- */
- void printList(minilist<ConfMember> *list);
- minilist<ConfMember> * getConnectedList();
-
- //virtual void run();
- string confId;
- private:
- void sendUpdatesToGui();
- /**
- * Move a member from pending to connected status
- */
- void pendingToConnected(string memberid);
- /**
- * Check for new members to connect to
- */
- void updateLists(minilist<ConfMember> *list);
- void removeMember(string memberid);
- string addDomainToPrefix(string remoteUri);
- //Gui *gui;
- bool incoming;
- string input;
- string callId;
- string state;
- ConfCallback *callback;
- int numConnected;
- int numPending;
- //string connectedList[10];
-
-
- //string pendingList[10];
- //cclist connectedList;
-
- minilist<ConfMember> connectedList;
- minilist<ConfMember> pendingList;
- string myUri;
- string myDomain;
-
- ///a P2T Group Member List
- //MRef<GroupList*>grpList;
-
- //shows the GroupList
- //void showGroupList();
-
-
-};
-
-#endif
Copied: branches/rtcp_ntp/libminisip/conf/ConferenceControl.h (from rev 2998, branches/rtcp_ntp/conf/ConferenceControl.h)
Deleted: branches/rtcp_ntp/libminisip/conf/Makefile.am
===================================================================
--- branches/rtcp_ntp/conf/Makefile.am 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/conf/Makefile.am 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,10 +0,0 @@
-noinst_LIBRARIES = libconf.a
-
-libconf_a_SOURCES = ConferenceControl.cxx \
- ConfCallback.cxx
-
-
-noinst_HEADERS = ConferenceControl.h \
- ConfCallback.h \
- ConfMember.h
-
Copied: branches/rtcp_ntp/libminisip/conf/Makefile.am (from rev 2998, branches/rtcp_ntp/conf/Makefile.am)
Copied: branches/rtcp_ntp/libminisip/ipsec (from rev 2997, branches/rtcp_ntp/ipsec)
Deleted: branches/rtcp_ntp/libminisip/ipsec/Makefile.am
===================================================================
--- branches/rtcp_ntp/ipsec/Makefile.am 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/ipsec/Makefile.am 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,4 +0,0 @@
-noinst_LIBRARIES = libmsipipsecapi.a
-
-libmsipipsecapi_a_SOURCES = MsipIpsecAPI.cxx
-noinst_HEADERS = MsipIpsecAPI.h
Copied: branches/rtcp_ntp/libminisip/ipsec/Makefile.am (from rev 2998, branches/rtcp_ntp/ipsec/Makefile.am)
Copied: branches/rtcp_ntp/libminisip/mediahandler (from rev 2997, branches/rtcp_ntp/mediahandler)
Deleted: branches/rtcp_ntp/libminisip/mediahandler/AudioMedia.cxx
===================================================================
--- branches/rtcp_ntp/mediahandler/AudioMedia.cxx 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/mediahandler/AudioMedia.cxx 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,295 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#include"AudioMedia.h"
-#include"../rtp/RtpHeader.h"
-#include"MediaStream.h"
-#include"../soundcard/FileSoundSource.h"
-
-#include"../soundcard/resampler/Resampler.h"
-#include"../soundcard/SoundSource.h"
-
-#include"../rtp/RtpPacket.h"
-
-
-#define RINGTONE_SOURCE_ID 0x42124212
-
-#include<sys/types.h>
-#include<sys/stat.h>
-#include<fcntl.h>
-#include<errno.h>
-#include<iostream>
-#include<stdio.h>
-
-#ifdef _MSC_VER
-
-#else
-#include<sys/time.h>
-#include<unistd.h>
-#endif
-
-#include<string.h> //for memset
-
-#ifdef DEBUG_OUTPUT
-#include <libmutil/itoa.h>
-#endif
-
-class G711CODEC;
-#ifdef AEC_SUPPORT
-AEC AudioMedia::aec; //hanning
-#endif
-
-// pn430 Parameter list changed for multicodec
-//AudioMedia::AudioMedia( MRef<SoundIO *> soundIo, MRef<Codec *> codec ):
-// Media(codec),
-// soundIo(soundIo){
-AudioMedia::AudioMedia( MRef<SoundIO *> soundIo, std::list<MRef<Codec *> > codecList ):
- Media(codecList),
- soundIo(soundIo){
-
- // for audio media, we assume that we can both send and receive
- receive = true;
- send = true;
- // pn430 Changed for multicodec
- //MRef<AudioCodec *> acodec = ((AudioCodec *)*codec);
-
- // NOTE Frame size FIXED to 20 ms
- soundIo->register_recorder_receiver( this, SOUND_CARD_FREQ * 20 / 1000, false );
-
- seqNo = 0;
-
- // NOTE Sampling frequency FIXED to 8000 Hz
- resampler = Resampler::create( SOUND_CARD_FREQ, 8000, 20, 1 /*Nb channels */);
-}
-
-string AudioMedia::getSdpMediaType(){
- return "audio";
-}
-
-void AudioMedia::registerMediaSender( MRef<MediaStreamSender *> sender ){
- sendersLock.lock();
- if( senders.empty() ){
- sendersLock.unlock();
- soundIo->startRecord();
- sendersLock.lock();
- }
-
- senders.push_back( sender );
- sendersLock.unlock();
-}
-
-void AudioMedia::unRegisterMediaSender( MRef<MediaStreamSender *> sender ){
- bool emptyList;
- sendersLock.lock();
- senders.remove( sender );
- emptyList = senders.empty();
- sendersLock.unlock();
-
- if( emptyList ){
- soundIo->stopRecord();
- }
-}
-
-void AudioMedia::registerMediaSource( uint32_t ssrc ){
- MRef<AudioMediaSource *> source;
-
- source = new AudioMediaSource( ssrc, this );
- //cerr << "AudioMedia::registerMediaSource" << endl;
- soundIo->registerSource( *source );
- sources.push_back( source );
-}
-
-void AudioMedia::unRegisterMediaSource( uint32_t ssrc ){
- std::list< MRef<AudioMediaSource *> >::iterator iSource;
- //cerr << "AudioMedia::unRegisterMediaSource" << endl;
-
- soundIo->unRegisterSource( ssrc );
-
- for( iSource = sources.begin(); iSource != sources.end(); iSource ++ ){
- if( (*iSource)->getSsrc() == ssrc ){
- sources.erase( iSource );
- return;
- }
- }
-}
-
-void AudioMedia::playData( MRef<RtpPacket *> packet ){
- MRef<AudioMediaSource *> source = getSource( packet->getHeader().SSRC );
-
- if( source ){
- source->playData( packet );
- }
- //delete packet;
-
-}
-
-//this function is called from SoundIO::recorderLoop
-//the void *data is originally a short *
-void AudioMedia::srcb_handleSound( void * data, int length){
-
- resampler->resample( (short *)data, resampledData );
- sendData( (byte_t*) &resampledData, 160*sizeof(short), 0, false );
- seqNo ++;
-}
-
-#ifdef AEC_SUPPORT
-void AudioMedia::srcb_handleSound( void * data, int length, void * dataR){ //hanning
- resampler->resample( (short *)data, resampledData );
- resampler->resample( (short *)dataR, resampledDataR );
-
- for(int j=0; j<160; j++){
- resampledData[j] = (short)aec.doAEC((int)resampledData[j], (int)resampledDataR[j]);
- }
- sendData( (byte_t*) &resampledData, 160*sizeof(short), 0, false );
- seqNo ++;
-}
-#endif
-
-void AudioMedia::sendData( byte_t * data, uint32_t length, uint32_t ts, bool marker ){
-
- //all these zerodata vars are used to send silence to muted senders
- //we need a silence data vector, as we cannot simply erase the data vector,
- //as it is shared by all media stream senders ...
- static byte_t zeroData[160*sizeof(short)]; //this needs to be of _length_ length
- static bool zeroDataInit = false;
- bool encodeZeroData;
-
- uint32_t encodedLength;
-
- if( ! zeroDataInit ) {
- zeroDataInit = true;
- for( uint32_t i = 0; i<length; i++ ) zeroData[i] = 0;
- }
-
- list< MRef<MediaStreamSender *> >::iterator i;
- sendersLock.lock();
-
- for( i = senders.begin(); i != senders.end(); i++ ){
- uint32_t givenTs;
- givenTs = ts;
- encodeZeroData = false;
- //only send if active sender, or if muted only if keep-alive
- if( (*i)->isMuted () ) {
- if( (*i)->muteKeepAlive( 50 ) ) {
- encodeZeroData = true;
- //cerr << endl << "AudioMedia::sendData - sending silence sample!" << endl;
- } else {
- (*i)->increaseLastTs(); //update the lastTimeStamp ... even we don't send, we must ...
- continue;
- }
- }
-
- MRef<CodecState *> selectedCodec = (*(*i)->getSelectedCodec());
-
- //if we must send silence (zeroData), encode it ...
- if( encodeZeroData ) {
- encodedLength = selectedCodec->encode( &zeroData, length, encoded );
- } else {
- encodedLength = selectedCodec->encode( data, length, encoded );
- }
-
- (*i)->send( encoded, encodedLength, &givenTs, marker );
- }
-
- sendersLock.unlock();
-}
-
-void AudioMedia::startRinging( string ringtoneFile ){
- soundIo->registerSource( new FileSoundSource( ringtoneFile,RINGTONE_SOURCE_ID, 44100, 2, SOUND_CARD_FREQ, 20, 2, true ) );
-}
-
-void AudioMedia::stopRinging(){
- soundIo->unRegisterSource( RINGTONE_SOURCE_ID );
-}
-
-#ifdef DEBUG_OUTPUT
-string AudioMedia::getDebugString() {
- string ret;
- ret = getMemObjectType() + ": this=" + itoa((int)this);
- for( std::list< MRef<MediaStreamSender *> >::iterator it = senders.begin();
- it != senders.end(); it++ ) {
- ret += (*it)->getDebugString() + ";";
- }
- return ret;
-}
-#endif
-
-MRef<AudioMediaSource *> AudioMedia::getSource( uint32_t ssrc ){
- std::list<MRef<AudioMediaSource *> >::iterator i;
-
- for( i = sources.begin(); i != sources.end(); i++ ){
- if( (*i)->getSsrc() == ssrc ){
- return (*i);
- }
- }
- return NULL;
-}
-
-
-AudioMediaSource::AudioMediaSource( uint32_t ssrc, MRef<Media *> media ):
- BasicSoundSource( ssrc,
- NULL, //plc
- 0/*position*/,
- SOUND_CARD_FREQ,
- 20, //duration in ms
- 2 //number of channels (numChannels)
- //buffer size defaults to 16000 * numChannels
- ),
- media(media),
- ssrc(ssrc)
-{
-}
-
-void AudioMediaSource::playData( MRef<RtpPacket *> rtpPacket ){
- RtpHeader hdr = rtpPacket->getHeader();
- MRef<CodecState *> codec = findCodec( hdr.getPayloadType() );
-
- if( codec ){
- uint32_t outputSize = codec->decode( rtpPacket->getContent(), rtpPacket->getContentLength(), codecOutput );
-
- pushSound( codecOutput,
- outputSize, hdr.getSeqNo() );
-
- }
-}
-
-MRef<CodecState *> AudioMediaSource::findCodec( uint8_t payloadType ){
- std::list< MRef<CodecState *> >::iterator iCodec;
- MRef<CodecState *> newCodecInstance;
-
- for( iCodec = codecs.begin(); iCodec != codecs.end(); iCodec ++ ){
- if( (*iCodec)->getSdpMediaType() == payloadType ){
- return (*iCodec);
- }
- }
-
- newCodecInstance = ((AudioMedia *)(*media))->createCodecInstance( payloadType );
- if( newCodecInstance ){
- codecs.push_back( newCodecInstance );
- }
-
- return newCodecInstance;
-}
-
-uint32_t AudioMediaSource::getSsrc(){
- return ssrc;
-}
Copied: branches/rtcp_ntp/libminisip/mediahandler/AudioMedia.cxx (from rev 2998, branches/rtcp_ntp/mediahandler/AudioMedia.cxx)
Deleted: branches/rtcp_ntp/libminisip/mediahandler/AudioMedia.h
===================================================================
--- branches/rtcp_ntp/mediahandler/AudioMedia.h 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/mediahandler/AudioMedia.h 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,197 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004, 2005
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#ifndef AUDIO_MEDIA_AND_AUDIOSOURCE_H
-#define AUDIO_MEDIA_AND_AUDIOSOURCE_H
-
-
-#include"Media.h"
-#ifdef AEC_SUPPORT
-#include "../aec/aec.h" //hanning
-#endif
-
-#include"../soundcard/SoundSource.h"
-
-class AudioMediaSource;
-class SilenceSensor;
-class Resampler;
-
-/**
- * The AudioMedia class holds the object required to acquire and
- * play out audio data. It is created upon startup, or when the
- * media configuration changes.
- */
-class AudioMedia : public Media, public SoundRecorderCallback{
-
- public:
- /**
- * Constructor, called by the MediaHandler upon
- * initialization, at startup or when the media
- * configuration changes.
- * @param soundIo a reference to the SoundIO object to
- * use for interaction with the soundcard
- * @param codecList a list of references to Codec
- * objects, representing the CODEC chosen by the user
- * and sorted according to her preference
- */
- AudioMedia( MRef<SoundIO *> soundIo, std::list<MRef<Codec *> > codecList );
-
- virtual std::string getMemObjectType(){return "AudioMedia";}
-
- /**
- * Returns the media type as used in the SDP (audio or video).
- * @returns the media type as a string
- */
- virtual std::string getSdpMediaType();
-
- /**
- * Play the given RTP packet on this medium. This includes
- * decoding if relevant.
- * @param rtpPacket the RTP packet to play
- */
- virtual void playData( MRef<RtpPacket *> rtpPacket );
-
- /**
- * Used by the media sessions to register a MediaStreamSender.
- * When a MediaStreamSender is registered to a Media object,
- * it will be used to send sampled media from the corresponding
- * medium
- * @param sender a reference to the MediaStreamSender object to
- * register
- */
- virtual void registerMediaSender( MRef<MediaStreamSender *> sender );
-
-
- /**
- * Used by the media sessions to unregister a MediaStreamSender,
- * when a media session ends.
- * @param sender a reference to the MediaStreamSender object to
- * unregister
- */
- virtual void unRegisterMediaSender( MRef<MediaStreamSender *> sender );
- /**
- * Used to register a new media source. Called upon discovery
- * of a new SSRC identifier. Each media source may use
- * a different decoder.
- * @param ssrc the SSRC identifier used by the new media source
- */
- virtual void registerMediaSource( uint32_t ssrc );
-
-
- /**
- * Used to unregister a media source when the session ends.
- * @param ssrc the SSRC identifier used by the media source to
- * unregister
- */
- virtual void unRegisterMediaSource( uint32_t ssrc );
-
- /**
- * Callback used by the SoundIO when sound samples are
- * available. The AudioMedia will process them by
- * encoding them and sending them to all the registered
- * MediaStreamSender objects.
- * @param samplearr pointer to the audio samples
- * @param length length of samplearr
- */
- virtual void srcb_handleSound( void *samplearr, int length );
- #ifdef AEC_SUPPORT
- virtual void srcb_handleSound( void *samplearr, int length, void *samplearrR); //hanning
- #endif
-
-
- /**
- * Send the data to all the registered MediaStreamSender.
- * If relevant, the data is first encoded using the
- * MediaStream's selected CODEC.
- * @param data pointer to the data to send
- * @param length length of the data buffer
- * @param ts timestamp to use in the RTP header
- * @param marker whether or not the marker should be set
- * in the RTP header
- */
- virtual void sendData( byte_t * data, uint32_t length, uint32_t ts, bool marker );
-
- /**
- * Used to start the playout of a ringtone, contained
- * in the given filename. The file should contain raw
- * audio PCM.
- * @param ringtoneFile the file from which the ringtone
- * data is read
- */
- void startRinging( std::string ringtoneFile );
-
- /**
- * Used to stop the playout of any ringtone.
- */
- void stopRinging();
-
-#ifdef DEBUG_OUTPUT
- virtual string getDebugString();
-#endif
-
- MRef<AudioMediaSource *> getSource( uint32_t ssrc );
-
- MRef<Resampler *> getResampler() { return resampler; };
-
- MRef<SoundIO *> getSoundIO() { return soundIo; };
-
- protected:
- MRef<Resampler *> resampler;
- SilenceSensor * silenceSensor;
- MRef<SoundIO *> soundIo;
- uint32_t seqNo;
- byte_t encoded[1600];
- short resampledData[160];
- #ifdef AEC_SUPPORT
- short resampledDataR[160]; //hanning
- static AEC aec; //hanning
- #endif
- std::list< MRef<AudioCodec *> > codecs;
- std::list< MRef<AudioMediaSource *> > sources;
-
-};
-
-class AudioMediaSource : public BasicSoundSource{
- public:
- AudioMediaSource( uint32_t ssrc, MRef<Media *> media );
-
- void playData( MRef<RtpPacket *> rtpPacket );
- uint32_t getSsrc();
-
- MRef<Media *> getMedia() { return media; };
-
- MRef<CodecState *> findCodec( uint8_t payloadType );
-
- short * getCodecOutputBuffer() { return codecOutput; }
-
- protected:
- std::list< MRef<CodecState *> > codecs;
- MRef<Media *> media;
- short codecOutput[16384];
- uint32_t ssrc;
-
-};
-
-
-#endif //#ifndef AUDIO_MEDIA_AND_AUDIOSOURCE_H
-
-
Copied: branches/rtcp_ntp/libminisip/mediahandler/AudioMedia.h (from rev 2998, branches/rtcp_ntp/mediahandler/AudioMedia.h)
Deleted: branches/rtcp_ntp/libminisip/mediahandler/DtmfSender.cxx
===================================================================
--- branches/rtcp_ntp/mediahandler/DtmfSender.cxx 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/mediahandler/DtmfSender.cxx 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,64 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004, 2005
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#include<config.h>
-#include"DtmfSender.h"
-#include"Session.h"
-#include"MediaStream.h"
-
-
-DtmfSender::DtmfSender( MRef<Session *> session ){
- this->session = session;
-}
-
-void DtmfSender::timeout( DtmfEvent * event ){
- uint8_t payload[4];
- payload[0] = event->symbol;
- payload[1] = ( (event->endOfEvent << 7) & 0x80 ) | ( event->volume & 0x3F );
- payload[2] = (event->duration >> 8) & 0xFF;
- payload[3] = event->duration & 0xFF;
-
- sendPayload( payload, event->startOfEvent, event->ts );
-
- if( event->lastBlock ){
- delete event->ts;
- }
-
- delete event;
-}
-
-void DtmfSender::sendPayload( byte_t payload[], bool mark, uint32_t * ts ){
- std::list<MRef<MediaStreamSender *> >::iterator iSender;
-
- session->mediaStreamSendersLock.lock();
- for( iSender = session->mediaStreamSenders.begin();
- iSender != session->mediaStreamSenders.end();
- iSender++ ){
-
- if( !(**iSender)->disabled ){
- ((MediaStreamSender *)(**iSender))->send( payload, 4, ts, mark, true );
- }
-
- }
- session->mediaStreamSendersLock.unlock();
-
-}
Copied: branches/rtcp_ntp/libminisip/mediahandler/DtmfSender.cxx (from rev 2998, branches/rtcp_ntp/mediahandler/DtmfSender.cxx)
Deleted: branches/rtcp_ntp/libminisip/mediahandler/DtmfSender.h
===================================================================
--- branches/rtcp_ntp/mediahandler/DtmfSender.h 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/mediahandler/DtmfSender.h 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,59 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004, 2005
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-#ifndef DTMFSENDER_H
-#define DTMFSENDER_H
-
-#include<libmutil/MemObject.h>
-
-class Session;
-
-class DtmfEvent{
- public:
- DtmfEvent( uint8_t symbol, uint8_t volume, uint16_t duration, bool endOfEvent, bool startOfEvent, uint32_t * ts, bool lastBlock = false ):
- symbol(symbol),volume(volume),duration(duration),endOfEvent(endOfEvent),startOfEvent(startOfEvent),ts(ts),lastBlock(lastBlock){};
-
- private:
-
- uint8_t symbol;
- uint8_t volume;
- uint16_t duration;
- bool endOfEvent;
- bool startOfEvent;
- uint32_t * ts;
- bool lastBlock;
-
- friend class DtmfSender;
-};
-
-class DtmfSender : public MObject {
- public:
- DtmfSender( MRef<Session *> session );
- void timeout( DtmfEvent * event );
- virtual std::string getMemObjectType(){ return "DtmfSender"; };
-
- private:
- MRef<Session *> session;
- void sendPayload( uint8_t payload[], bool mark, uint32_t * ts );
-};
-
-#endif
Copied: branches/rtcp_ntp/libminisip/mediahandler/DtmfSender.h (from rev 2998, branches/rtcp_ntp/mediahandler/DtmfSender.h)
Deleted: branches/rtcp_ntp/libminisip/mediahandler/KeyAgreement.cxx
===================================================================
--- branches/rtcp_ntp/mediahandler/KeyAgreement.cxx 2006-12-06 22:21:16 UTC (rev 2997)
+++ branches/rtcp_ntp/libminisip/mediahandler/KeyAgreement.cxx 2006-12-06 23:27:17 UTC (rev 2999)
@@ -1,632 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Copyright (C) 2004
- *
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
- * Joachim Orrblad <joachim at orrblad.com>
-*/
-
-#include<config.h>
-
-
-#include"Session.h"
-#include"MediaStream.h"
-
-
-#include<libmutil/Timestamp.h>
-#include<libmutil/dbg.h>
-#include"../sip/SipDialogSecurityConfig.h"
-
-#include<libmikey/keyagreement.h>
-#include<libmikey/keyagreement_dh.h>
-#include<libmikey/keyagreement_psk.h>
-#include<libmikey/MikeyException.h>
-
-#define MIKEY_PROTO_SRTP 0
-
-
-using namespace std;
-
-
-bool Session::responderAuthenticate( string message ){
-
- bool authenticated;
-
- if(message.substr(0,6) == "mikey "){
-
- string b64Message = message.substr(6, message.length()-6);
-
- if( message == "" )
- throw MikeyException( "No MIKEY message received" );
- else {
- try{
- MikeyMessage * init_mes = new MikeyMessage(b64Message);
-
-// MikeyMessage * resp_mes = NULL;
- switch( init_mes->type() ){
- case MIKEY_TYPE_DH_INIT:
-
- if( securityConfig.cert.isNull() ){
- merr << "No certificate available" << end;
- // throw MikeyExceptionUnacceptable(
- // "Cannot handle DH key agreement, no certificate" );
- securityConfig.secured = false;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- return false;
- }
-
-
- if( !securityConfig.dh_enabled ){
- merr << "Cannot handle DH key agreement" << end;
- //throw MikeyExceptionUnacceptable(
- // "Cannot handle DH key agreement" );
- securityConfig.secured = false;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- return false;
- }
-
- if( !ka ){
- ka = new KeyAgreementDH( securityConfig.cert, securityConfig.cert_db, DH_GROUP_OAKLEY5 );
- }
- ka->setInitiatorData( init_mes );
-
-#ifdef ENABLE_TS
- ts.save( AUTH_START );
-#endif
- if( init_mes->authenticate( ((KeyAgreementDH *)*ka) ) ){
- merr << "Authentication of the DH init message failed" << end;
-// throw MikeyExceptionAuthentication(
-// "Authentication of the DH init message failed" );
- merr << ka->authError() << end;
- securityConfig.secured = false;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- return false;
- }
-
- merr << "Authentication successful, controling the certificate" << end;
-
-#ifdef ENABLE_TS
- ts.save( TMP );
-#endif
- if( securityConfig.check_cert ){
- if( ((KeyAgreementDH *)*ka)->controlPeerCertificate() == 0){
-#ifdef DEBUG_OUTPUT
- merr << "Certificate check failed in the incoming MIKEY message" << end;
-#endif
- securityConfig.secured = false;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- return false;
- }
- }
-#ifdef ENABLE_TS
- ts.save( AUTH_END );
-#endif
-
- securityConfig.ka_type = KEY_MGMT_METHOD_MIKEY_DH;
-
- break;
- case MIKEY_TYPE_PSK_INIT:
- if( !securityConfig.psk_enabled ){
- //throw MikeyExceptionUnacceptable(
- // "Cannot handle PSK key agreement" );
-
- securityConfig.secured = false;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- return false;
- }
-
- ka = new KeyAgreementPSK( securityConfig.psk, securityConfig.psk_length );
- ka->setInitiatorData( init_mes );
-
-#ifdef ENABLE_TS
- ts.save( AUTH_START );
-#endif
-
- if( init_mes->authenticate( ((KeyAgreementPSK *)*ka) ) ){
-// throw MikeyExceptionAuthentication(
-// "Authentication of the PSK init message failed" );
- securityConfig.secured = false;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- return false;
- }
-
-#ifdef ENABLE_TS
- ts.save( AUTH_END );
-#endif
-
- securityConfig.ka_type = KEY_MGMT_METHOD_MIKEY_PSK;
- break;
- case MIKEY_TYPE_PK_INIT:
- //throw MikeyExceptionUnimplemented(
- // "Public Key key agreement not implemented" );
- securityConfig.secured = false;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- return false;
- default:
- merr << "Unexpected type of message in INVITE" << end;
- securityConfig.secured = false;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- return false;
- }
-
- securityConfig.secured = true;
- authenticated = true;
- }
- catch( certificate_exception &exc ){
- // TODO: Tell the GUI
- merr << "Could not open certificate" <<end;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured = false;
- authenticated = false;
- }
- catch( MikeyExceptionUnacceptable &exc ){
- merr << "MikeyException caught: "<<exc.what()<<end;
- //FIXME! send SIP Unacceptable with Mikey Error message
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured = false;
- authenticated = false;
- }
- // Authentication failed
- catch( MikeyExceptionAuthentication &exc ){
- merr << "MikeyExceptionAuthentication caught: "<<exc.what()<<end;
- //FIXME! send SIP Authorization failed with Mikey Error message
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured = false;
- authenticated = false;
- }
- // Message was invalid
- catch( MikeyExceptionMessageContent &exc ){
- MikeyMessage * error_mes;
- merr << "MikeyExceptionMesageContent caught: " << exc.what() << end;
- if( ( error_mes = exc.errorMessage() ) != NULL ){
- //FIXME: send the error message!
- }
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured = false;
- authenticated = false;
- }
- catch( MikeyException & exc ){
- merr << "MikeyException caught: " << exc.what() << end;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured = false;
- authenticated = false;
- }
-
- }
- }
- else {
- merr << "Unknown type of key agreement" << end;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured = false;
- authenticated = true;
- }
- return authenticated;
-}
-
-string Session::responderParse(){
-
- if( ! ( securityConfig.ka_type & KEY_MGMT_METHOD_MIKEY ) ){
- merr << "Unknown type of key agreement" << end;
- securityConfig.secured = false;
- return "";
- }
-
- MikeyMessage * responseMessage = NULL;
- MikeyMessage * initMessage = (MikeyMessage *)ka->initiatorData();
-
- if( initMessage == NULL ){
- merr << "Uninitialized message, this is a bug" << end;
- securityConfig.secured = false;
- return "";
- }
-
- try{
- switch( securityConfig.ka_type ){
- case KEY_MGMT_METHOD_MIKEY_DH:
-#ifdef ENABLE_TS
- ts.save( MIKEY_PARSE_START );
-#endif
-
- addStreamsToKa( false );
- responseMessage = initMessage->buildResponse((KeyAgreementDH *)*ka);
-#ifdef ENABLE_TS
- ts.save( MIKEY_PARSE_END );
-#endif
- break;
- case KEY_MGMT_METHOD_MIKEY_PSK:
-#ifdef ENABLE_TS
- ts.save( MIKEY_PARSE_START );
-#endif
-
- addStreamsToKa( false );
-
- responseMessage = initMessage->buildResponse((KeyAgreementPSK *)*ka);
-#ifdef ENABLE_TS
- ts.save( MIKEY_PARSE_END );
-#endif
- break;
- case KEY_MGMT_METHOD_MIKEY_PK:
- /* Should not happen at that point */
- throw MikeyExceptionUnimplemented(
- "Public Key key agreement not implemented" );
- break;
- default:
- throw MikeyExceptionMessageContent(
- "Unexpected type of message in INVITE" );
- }
- }
- catch( certificate_exception & exc ){
- // TODO: Tell the GUI
- merr << "Could not open certificate" <<end;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured = false;
- }
- catch( MikeyExceptionUnacceptable & exc ){
- merr << "MikeyException caught: "<<exc.what()<<end;
- //FIXME! send SIP Unacceptable with Mikey Error message
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured = false;
- }
- // Message was invalid
- catch( MikeyExceptionMessageContent & exc ){
- MikeyMessage * error_mes;
- merr << "MikeyExceptionMesageContent caught: " << exc.what() << end;
- if( ( error_mes = exc.errorMessage() ) != NULL ){
- responseMessage = error_mes;
- }
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured = false;
- }
- catch( MikeyException & exc ){
- merr << "MikeyException caught: " << exc.what() << end;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured = false;
- }
-
- if( responseMessage != NULL ){
- //merr << "Created response message" << responseMessage->get_string() << end;
- return responseMessage->b64Message();
- }
- else{
- //merr << "No response message" << end;
- return string("");
- }
-
-
-}
-
-
-string Session::initiatorCreate(){
- MikeyMessage * message;
-
-
- try{
- switch( securityConfig.ka_type ){
- case KEY_MGMT_METHOD_MIKEY_DH:
- if( !securityConfig.cert || securityConfig.cert->is_empty() ){
- throw MikeyException( "No certificate provided for DH key agreement" );
- }
-#ifdef ENABLE_TS
- ts.save( DH_PRECOMPUTE_START );
-#endif
-
- if( ka && ka->type() != KEY_AGREEMENT_TYPE_DH ){
- ka = NULL;
- }
- if( !ka ){
- ka = new KeyAgreementDH( securityConfig.cert, securityConfig.cert_db, DH_GROUP_OAKLEY5 );
- }
- addStreamsToKa();
-#ifdef ENABLE_TS
- ts.save( DH_PRECOMPUTE_END );
-#endif
- message = new MikeyMessage( ((KeyAgreementDH *)*ka) );
-#ifdef ENABLE_TS
- ts.save( MIKEY_CREATE_END );
-#endif
- break;
- case KEY_MGMT_METHOD_MIKEY_PSK:
-#ifdef ENABLE_TS
- ts.save( DH_PRECOMPUTE_START );
-#endif
- ka = new KeyAgreementPSK( securityConfig.psk, securityConfig.psk_length );
- addStreamsToKa();
-#ifdef ENABLE_TS
- ts.save( DH_PRECOMPUTE_END );
-#endif
- ((KeyAgreementPSK *)*ka)->generateTgk();
-#ifdef ENABLE_TS
- ts.save( MIKEY_CREATE_START );
-#endif
- message = new MikeyMessage( ((KeyAgreementPSK *)*ka) );
-#ifdef ENABLE_TS
- ts.save( MIKEY_CREATE_END );
-#endif
- break;
- case KEY_MGMT_METHOD_MIKEY_PK:
- throw MikeyExceptionUnimplemented(
- "PK KA type not implemented" );
- default:
- throw MikeyException( "Invalid type of KA" );
- }
-
- string b64Message = message->b64Message();
- delete message;
- return "mikey "+b64Message;
- }
- catch( certificate_exception & ){
- // FIXME: tell the GUI
- merr << "Could not open certificate" <<end;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured = false;
- return "";
- }
- catch( MikeyException & exc ){
- merr << "MikeyException caught: " << exc.what() << end;
- securityConfig.ka_type = KEY_MGMT_METHOD_NULL;
- securityConfig.secured=false;
- return "";
- }
-}
-
-bool Session::initiatorAuthenticate( string message ){
-
-
- if (message.substr(0,6) == "mikey ")
- {
-
- // get rid of the "mikey "
- message = message.substr(6,message.length()-6);
- if(message == ""){
- merr << "No MIKEY message received" << end;
- securityConfig.secured = false;
- return false;
- } else {
- try{
- MikeyMessage * resp_mes = new MikeyMessage( message );
- ka->setResponderData( resp_mes );
-
- switch( securityConfig.ka_type ){
- case KEY_MGMT_METHOD_MIKEY_DH:
-
-#ifdef ENABLE_TS
- ts.save( AUTH_START );
-#endif
- if( resp_mes->authenticate( ((KeyAgreementDH *)*ka) ) ){
- throw MikeyExceptionAuthentication(
- "Authentication of the DH response message failed&