[asterisk-scf-commits] asterisk-scf/integration/media_rtp_pjmedia.git branch "nat-traversal" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Jun 9 12:05:01 CDT 2011


branch "nat-traversal" has been updated
       via  68c0861af82abbffdd6ec8d12b1b1aa5070d0d52 (commit)
       via  f8435c69f85df0811d78d3b7ee67a8e5bc36747d (commit)
       via  fcea6350ddac837d6fabf6caf124c38e762f836a (commit)
       via  2dc34886a7215947c02bef873e46c6acc3f79f25 (commit)
       via  f85f58b9b98c2fb2246fff3e68bdd8c8defe140f (commit)
       via  572d9688bb23319a2ef23030dbd4f60b9c6acefd (commit)
       via  9ebdc19da47c48de3c9ae080431dec36817c29b7 (commit)
       via  e8164ed94af4df2f2d74b568cdaf7be78f666aba (commit)
       via  1d8328968ea8ea5b276643c9b36365f2edb5933c (commit)
       via  1fa1d2704fd2b6c31f0f72c6c8d7e44b49efb31a (commit)
       via  1476d4d52c1cf76a287c34031310d3c71b30bf5b (commit)
       via  468c255b5ece37590cdbdd1121541dfc305f2d95 (commit)
       via  2fe8c6154989313a4f40eb45cccd5b946f8f495b (commit)
       via  103929b269e3391fa36b4d34c81ca96efa5eaaef (commit)
       via  d77ecdc4c1ed57239a797b59be19f9841085cbe4 (commit)
       via  10900df1422c8cdd3c43173863a6c7f8087f9801 (commit)
       via  70dab79e95c3da49b6a1ea7ed8564530fd57a389 (commit)
       via  a9f2d2c2f87162aaeec2d1080b860e059fe31cbd (commit)
       via  cd8b75e4635108c0a032348c1c159441ffbbb26f (commit)
       via  7c62f27966769e9d75d22eb80044d055bc4dd195 (commit)
       via  590ca45f3604f215b8019bf0f8d9cc9a8f952b33 (commit)
       via  4740d0813de6b66cd70000b8b7c10dd883520ac6 (commit)
       via  e04d914ecae9eb1c24a87fb18d8f93b46335c760 (commit)
       via  6eaa470cd582ad9231eb69aa335312a880cce9fe (commit)
       via  366fae18463169b226613285ba70842374c718ab (commit)
       via  c85c80143e620332470b3d82df17f4d9e65140b1 (commit)
       via  f27572008be8a6a37d8aaee4e8a7b29fb8e7339c (commit)
       via  d418b0865dc86ba0d4a4f522a05ae685d77fb14f (commit)
       via  014b58607f05d3c99be3e5edf26a81545a04ed52 (commit)
       via  d0f0dfa8e7260ee3d7bf94fe4edc7e9cf7cb858a (commit)
       via  8c950ee6637816c1a07b9864a8a9fdb627cb632c (commit)
       via  5ef3067c4fd3bc3c6036f0a6ac3c1bbfe7d7d488 (commit)
       via  6bc19fc030ca626b7b86b1ba39098d5a7fbaec60 (commit)
       via  0bde61f3c48d1fa13fd58115ca609f2c9a8fe954 (commit)
       via  8c0401743b4bb5b0f6db9533631d6aa0822cd975 (commit)
       via  7bd1a2b33fc2c8037d4c79ea204a29ab72072414 (commit)
       via  eed17133034e54adb065166ad1795a62c2d73f41 (commit)
       via  1467fd724497c5b072d3fafdc03b9d52bb9cb731 (commit)
       via  123ea2768f3372ba6ff51e2b60f147eb218b0097 (commit)
      from  a3b4754ceedd12d7cef5c63fdc89a01978bb736a (commit)

Summary of changes:
 config/Rtp.config                                  |   18 +
 config/RtpConfigurator.py                          |   62 +++
 config/test_component.config                       |    8 +
 ...t_component.config => test_component_v6.config} |   10 +-
 config/test_media_rtp_pjmedia.conf                 |    4 +-
 local-slice/RtpConfigurationIf.ice                 |  182 ++++++++
 local-slice/RtpStateReplicationIf.ice              |    3 +
 src/CMakeLists.txt                                 |   11 +-
 src/ICETransport.cpp                               |    2 +
 src/MediaRTPpjmedia.cpp                            |  169 +++++++-
 src/PJLibConfiguration.h                           |    2 +
 src/PJMediaEnvironment.cpp                         |    7 +
 src/PJMediaEnvironment.h                           |   47 ++-
 src/PJUtil.h                                       |    9 +
 src/RTPConfiguration.cpp                           |  460 ++++++++++++++++++++
 src/RTPConfiguration.h                             |   59 +++
 src/RTPSession.cpp                                 |   68 ++-
 src/RTPSession.h                                   |   52 ++-
 src/RTPSink.cpp                                    |    8 +-
 src/RTPSource.cpp                                  |   32 ++-
 src/RtpStateReplicator.h                           |   23 +-
 src/RtpStateReplicatorApp.cpp                      |  119 +++++
 src/RtpStateReplicatorListener.cpp                 |   24 +-
 test/CMakeLists.txt                                |   15 +-
 test/TestRTPpjmedia.cpp                            |  117 +++++-
 25 files changed, 1430 insertions(+), 81 deletions(-)
 create mode 100644 config/Rtp.config
 create mode 100755 config/RtpConfigurator.py
 copy config/{test_component.config => test_component_v6.config} (78%)
 create mode 100644 local-slice/RtpConfigurationIf.ice
 create mode 100644 src/RTPConfiguration.cpp
 create mode 100644 src/RTPConfiguration.h


- Log -----------------------------------------------------------------
commit 68c0861af82abbffdd6ec8d12b1b1aa5070d0d52
Merge: a3b4754 f8435c6
Author: Brent Eagles <beagles at digium.com>
Date:   Thu Jun 9 11:07:00 2011 -0230

    Merge branch 'master' into nat-traversal and capture some works in progress.

diff --cc src/CMakeLists.txt
index ec6e80d,859c2e9..0b20fe8
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@@ -9,41 -6,18 +6,44 @@@ asterisk_scf_slice_include_directories(
  
  asterisk_scf_component_init(media_rtp_pjmedia)
  asterisk_scf_component_add_file(media_rtp_pjmedia MediaRTPpjmedia.cpp)
 -asterisk_scf_component_add_file(media_rtp_pjmedia RTPSession.cpp)
  asterisk_scf_component_add_file(media_rtp_pjmedia RTPSource.cpp)
  asterisk_scf_component_add_file(media_rtp_pjmedia RTPSink.cpp)
 -asterisk_scf_component_add_file(media_rtp_pjmedia RTPSession.h)
  asterisk_scf_component_add_file(media_rtp_pjmedia RTPSource.h)
  asterisk_scf_component_add_file(media_rtp_pjmedia RTPSink.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia RTPICESession.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia RTPICESession.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia NATModule.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia NATModule.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia NATConfig.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia NATConfig.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia ICEConfiguration.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia ICEConfiguration.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia SRTPConfiguration.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia SRTPConfiguration.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia PJMediaEnvironment.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia PJMediaEnvironment.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia PJMediaEndpoint.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia PJMediaEndpoint.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia PJMediaTransport.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia PJMediaTransport.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia UDPTransport.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia UDPTransport.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia ICETransport.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia ICETransport.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia SRTPTransport.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia SRTPTransport.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia PJLibConfiguration.cpp)
 +asterisk_scf_component_add_file(media_rtp_pjmedia PJLibConfiguration.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia PJUtil.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia ServiceConfig.h)
 +asterisk_scf_component_add_file(media_rtp_pjmedia SessionAdapter.h)
 +
  asterisk_scf_component_add_file(media_rtp_pjmedia RtpStateReplicatorListener.cpp)
  asterisk_scf_component_add_file(media_rtp_pjmedia RtpStateReplicator.h)
+ asterisk_scf_component_add_file(media_rtp_pjmedia RTPConfiguration.cpp)
+ asterisk_scf_component_add_file(media_rtp_pjmedia RTPConfiguration.h)
  asterisk_scf_component_add_slice(media_rtp_pjmedia ../local-slice/RtpStateReplicationIf.ice)
+ asterisk_scf_component_add_slice(media_rtp_pjmedia ../local-slice/RtpConfigurationIf.ice)
  asterisk_scf_component_add_boost_libraries(media_rtp_pjmedia core thread)
  asterisk_scf_component_build_icebox(media_rtp_pjmedia)
  target_link_libraries(media_rtp_pjmedia logging-client)
diff --cc src/ICETransport.cpp
index 52e36a3,0000000..44491aa
mode 100644,000000..100644
--- a/src/ICETransport.cpp
+++ b/src/ICETransport.cpp
@@@ -1,184 -1,0 +1,186 @@@
 +/*
 + * Asterisk SCF -- An open-source communications framework.
 + *
 + * Copyright (C) 2010, Digium, Inc.
 + *
 + * See http://www.asterisk.org for more information about
 + * the Asterisk SCF project. Please do not directly contact
 + * any of the maintainers of this project for assistance;
 + * the project provides a web site, mailing lists and IRC
 + * channels for your use.
 + *
 + * This program is free software, distributed under the terms of
 + * the GNU General Public License Version 2. See the LICENSE.txt file
 + * at the top of the source tree.
 + */
 +
 +#include "ICETransport.h"
 +#include "PJUtil.h"
++
 +#include <pjmedia.h>
 +#include <pjlib.h>
++
 +#include <AsteriskSCF/System/ExceptionsIf.h>
 +#include <map>
 +
 +using namespace AsteriskSCF::PJMediaRTP;
 +using namespace AsteriskSCF::System::V1;
 +using namespace AsteriskSCF::PJUtil;
 +using namespace std;
 +
 +namespace 
 +{
 +class ICECallbackAdapter
 +{
 +public:
 +    static void addEntry(pjmedia_transport* transport, const ICETransportPtr& callback);
 +    static void onICEComplete(pjmedia_transport* transport, pj_ice_strans_op operation, pj_status_t status);
 +
 +    struct CallbackRecord
 +    {
 +        bool connected;
 +        ICETransportPtr transport;
 +    };
 +    typedef std::map<pjmedia_transport*, CallbackRecord> TransportMap;
 +
 +private:
 +    static TransportMap mTransportMap;
 +    static boost::shared_mutex mLock;
 +};
 +
 +//
 +// Static member initializations.
 +//
 +ICECallbackAdapter::TransportMap ICECallbackAdapter::mTransportMap;
 +boost::shared_mutex ICECallbackAdapter::mLock;
 +
 +//
 +// For some reason the ICE media transport doesn't have the concept of associating user data with a transport, so we
 +// have to map it "out of band". The problem is, there is a race condition in that the ICE completion callack could be
 +// invoked before we get a chance to add the transport.  The solution to that is to allow an entry to be created when
 +// the ICE completion callback arrives and there isn't a table entry. When the addEntry runs, it will see the entry and
 +// simply update the appropriate field.
 +// 
 +void ICECallbackAdapter::addEntry(pjmedia_transport* transport, const ICETransportPtr& callback)
 +{
 +    boost::unique_lock<boost::shared_mutex> lock(mLock);
 +    TransportMap::iterator i = mTransportMap.find(transport);
 +    if (i != mTransportMap.end())
 +    {
 +        i->second.transport = callback;
 +    }
 +    else
 +    {
 +        CallbackRecord r;
 +        r.connected = false;
 +        r.transport = callback;
 +        mTransportMap.insert(make_pair(transport, r));
 +    }
 +}
 +
 +void ICECallbackAdapter::onICEComplete(pjmedia_transport* transport, pj_ice_strans_op operation, pj_status_t status)
 +{
 +    //
 +    // AFAICT, only PJ_ICE_STRANS_OP_NEGOTIATION should get here.
 +    // 
 +    switch (operation)
 +    {
 +        case PJ_ICE_STRANS_OP_INIT:
 +            //
 +            // Initialization is complete. FWICT, this should not get here.
 +            //
 +            break;
 +        case PJ_ICE_STRANS_OP_NEGOTIATION:
 +            //
 +            // Negotiation is complete.
 +            //
 +        {
 +            boost::unique_lock<boost::shared_mutex> lock(mLock);
 +            TransportMap::iterator i = mTransportMap.find(transport);
 +            if (i == mTransportMap.end())
 +            {
 +                CallbackRecord r;
 +                r.connected = true;
 +                mTransportMap.insert(make_pair(transport, r));
 +            }
 +            else
 +            {
 +                i->second.connected = true;
 +                i->second.transport->onSetupComplete(transport, status);
 +            }
 +        }
 +            break;
 +        case PJ_ICE_STRANS_OP_KEEP_ALIVE:
 +            //
 +            // Keep alive has successfully completed. FWICT this should not get here.
 +            // 
 +            break;
 +    };
 +}
 +
 +}
 +
 +ICETransport::~ICETransport()
 +{
 +    //
 +    // TODO : cleanup ICE transport, the transport itself is closed by the parent class.
 +    // 
 +}
 +
 +void ICETransport::onSetupComplete(pjmedia_transport* transport, int status)
 +{
 +    if (fail(status))
 +    {
 +        //
 +        // TODO!
 +        //
 +        return;
 +    }
 +
 +    pjmedia_transport_info info;
 +    pjmedia_transport_info_init(&info);
 +    pjmedia_transport_get_info(transport, &info);
 +
 +    pjmedia_ice_transport_info* iceInfo = 0;
 +    for (unsigned i = 0; i < info.specific_info_cnt; ++i)
 +    {
 +        if (info.spc_info[i].type == PJMEDIA_TRANSPORT_TYPE_ICE)
 +        {
 +            iceInfo = (pjmedia_ice_transport_info*)(info.spc_info[i].buffer);
 +        }
 +    }
 +
 +    if (iceInfo != 0 && iceInfo->role == PJ_ICE_SESS_ROLE_CONTROLLING)
 +    {
 +        if (mLastKnownAddr && pj_sockaddr_cmp(&info.sock_info.rtp_addr_name, mLastKnownAddr.get()))
 +        {
 +            //
 +            // Address has changed! We need to let Session listeners know!
 +            // TODO! 
 +            //
 +            pj_memcpy(mLastKnownAddr.get(), &info.sock_info.rtp_addr_name, sizeof(pj_sockaddr));
 +        }
 +    }
 +}
 +
 +ICETransportPtr ICETransport::create(const PJMediaEndpointPtr& ep)
 +{
 +    pjmedia_transport* t;
 +    PJICECallbackPtr callback(new pjmedia_ice_cb);
 +    callback->on_ice_complete = &ICECallbackAdapter::onICEComplete;
 +    pj_status_t result = pjmedia_ice_create(ep->endpoint(), "ASCF_ICE_MEDIA", 10, 0, callback.get(),
 +      &t);
 +    if (fail(result))
 +    {
 +        throw InternalInitializationException("Unable to create new ICE media transport");
 +    }
 +    ICETransportPtr transport(new ICETransport(t, callback));
 +    ICECallbackAdapter::addEntry(t, transport);
 +    return transport;
 +}
 +
 +ICETransport::ICETransport(pjmedia_transport* t, const PJICECallbackPtr& cb) :
 +    PJMediaTransport(t),
 +    mCallback(cb)
 +{ 
 +}
diff --cc src/MediaRTPpjmedia.cpp
index 8f000d1,a76217b..98feaa5
--- a/src/MediaRTPpjmedia.cpp
+++ b/src/MediaRTPpjmedia.cpp
@@@ -14,13 -14,13 +14,13 @@@
   * at the top of the source tree.
   */
  
--#include <pjlib.h>
 -#include <pjmedia.h>
 -
  #include <Ice/Ice.h>
  #include <IceBox/IceBox.h>
  #include <IceUtil/UUID.h>
  
++#include <pjlib.h>
 +#include <pjmedia.h>
 +
  #include <boost/shared_ptr.hpp>
  
  #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
@@@ -34,11 -35,11 +35,13 @@@
  
  #include "RtpStateReplicationIf.h"
  
 -#include "RTPSession.h"
 +#include "RTPICESession.h"
  #include "RtpStateReplicator.h"
+ #include "RTPConfiguration.h"
+ #include "RtpConfigurationIf.h"
  
 +#include "PJMediaEnvironment.h"
 +
  using namespace std;
  using namespace AsteriskSCF::Core::Discovery::V1;
  using namespace AsteriskSCF::Media::V1;
@@@ -77,14 -75,27 +82,19 @@@ private
       */
      Ice::ObjectAdapterPtr mAdapter;
  
 -    /**
 -     * Memory caching pool.
 -     */
 -    pj_caching_pool mCachingPool;
 +    PJMediaEnvironmentPtr mEnvironment;
  
      /**
 -     * Memory pool.
 +     * A proxy to the local replica control.
       */
 -    pj_pool_t* mMemoryPool;
 -
 -    /**
 -     * A pointer to the replica service.
 -     */
 -    ReplicaPtr mReplicaService;
 +    ReplicaPrx mReplicaControlPrx;
  
      /**
+      * A pointer to the configuration service.
+      */
+     ConfigurationServiceImplPtr mConfigurationService;
+ 
+     /**
       * A proxy to the state replicator.
       */
      AsteriskSCF::Discovery::SmartProxy<RtpStateReplicatorPrx> mStateReplicator;
@@@ -201,9 -243,12 +242,14 @@@ private
       */
      ReplicaPtr mReplicaService;
  
 +    ReplicaPrx mReplicaControlPrx;
 +
      /**
+      * Instance of our configuration service implementation.
+      */
+     ConfigurationServiceImplPtr mConfigurationService;
+ 
+     /**
       * Instance of our state replicator listener.
       */
      RtpStateReplicatorListenerPtr mReplicatorListener;
@@@ -339,10 -434,12 +429,10 @@@ RTPMediaServiceImpl::RTPMediaServiceImp
  /**
   * Implementation of the allocate method as defined in MediaRTPIf.ice
   */
- RTPSessionPrx RTPMediaServiceImpl::allocate(const FormatSeq& formats, const Ice::Current&)
+ RTPSessionPrx RTPMediaServiceImpl::allocate(const RTPServiceLocatorParamsPtr& params, const Ice::Current&)
  {
 -    RTPSessionImplPtr session =
 -        new RTPSessionImpl(mAdapter, params, &mCachingPool.factory, mReplicaService, mStateReplicator,
 -	    mConfigurationService);
 -    return session->getProxy();
 +    return AsteriskSCF::PJMediaRTP::RTPSession::create(mAdapter, IceUtil::generateUUID(), formats, mEnvironment,
 +      mReplicaControlPrx, mStateReplicator);
  }
  
  /**
@@@ -383,9 -480,12 +473,13 @@@ void MediaRTPpjmediaApp::start(const st
      mLocalAdapter = mCommunicator->createObjectAdapter("MediaRTPpjmediaAdapterLocal");
  
      mReplicaService = new ReplicaImpl(mLocalAdapter);
 -    mLocalAdapter->add(mReplicaService, mCommunicator->stringToIdentity(ReplicaServiceId));
 +    mReplicaControlPrx  = ReplicaPrx::uncheckedCast(mLocalAdapter->add(mReplicaService, 
 +        mCommunicator->stringToIdentity(ReplicaServiceId)));
  
+     mConfigurationService = new ConfigurationServiceImpl();
+     ConfigurationServicePrx mConfigurationServiceProxy = ConfigurationServicePrx::uncheckedCast(
+ 	mLocalAdapter->addWithUUID(mConfigurationService));
+ 
      mLocalAdapter->activate();
  
      mGlobalAdapter = mCommunicator->createObjectAdapter("MediaRTPpjmediaAdapter");
diff --cc src/PJLibConfiguration.h
index d0cc641,0000000..85ee8c6
mode 100644,000000..100644
--- a/src/PJLibConfiguration.h
+++ b/src/PJLibConfiguration.h
@@@ -1,64 -1,0 +1,66 @@@
 +/*
 + * Asterisk SCF -- An open-source communications framework.
 + *
 + * Copyright (C) 2010, Digium, Inc.
 + *
 + * See http://www.asterisk.org for more information about
 + * the Asterisk SCF project. Please do not directly contact
 + * any of the maintainers of this project for assistance;
 + * the project provides a web site, mailing lists and IRC
 + * channels for your use.
 + *
 + * This program is free software, distributed under the terms of
 + * the GNU General Public License Version 2. See the LICENSE.txt file
 + * at the top of the source tree.
 + */
 +
 +#pragma once
 +
 +#include <Ice/PropertiesF.h>
 +#include <string>
 +#include <boost/shared_ptr.hpp>
 +
 +namespace AsteriskSCF
 +{
 +namespace PJMediaRTP
 +{
 +
 +/**
++ *
 + * PJLibConfiguration is fairly minimal at the moment, but may grow in the future. The intent is to reduce code
 + * duplication when dealing with pjproject related configuration. This is also an immutable object, so locking is not an
 + * issue.
++ *
 + **/
 +class PJLibConfiguration
 +{
 +public:
 +
 +    int timerHeapSize() const
 +    {
 +        return mTimerHeapSize;
 +    }
 +
 +    /**
 +     * Create configuration instance from Ice properties.  TODO: This could be extended by adding additional factory
 +     * overrides.
 +     **/
 +    static boost::shared_ptr<PJLibConfiguration> create(const Ice::PropertiesPtr& props,
 +            const std::string& propertyPrefix);
 +
 +private:
 +    int mTimerHeapSize;
 +
 +    PJLibConfiguration(int timerHeapSize);
 +
 +    //
 +    // Hidden, not implemented.
 +    //
 +    PJLibConfiguration(const PJLibConfiguration&);
 +    void operator=(const PJLibConfiguration&);
 +};
 +
 +typedef boost::shared_ptr<PJLibConfiguration> PJLibConfigurationPtr;
 +
 +} /* end of namespace PJMediaRTP */
 +} /* End of namespace AsteriskSCF */
diff --cc src/PJMediaEnvironment.cpp
index 7ef9540,0000000..688c4cb
mode 100644,000000..100644
--- a/src/PJMediaEnvironment.cpp
+++ b/src/PJMediaEnvironment.cpp
@@@ -1,56 -1,0 +1,63 @@@
 +/*
 + * Asterisk SCF -- An open-source communications framework.
 + *
 + * Copyright (C) 2010, Digium, Inc.
 + *
 + * See http://www.asterisk.org for more information about
 + * the Asterisk SCF project. Please do not directly contact
 + * any of the maintainers of this project for assistance;
 + * the project provides a web site, mailing lists and IRC
 + * channels for your use.
 + *
 + * This program is free software, distributed under the terms of
 + * the GNU General Public License Version 2. See the LICENSE.txt file
 + * at the top of the source tree.
 + */
 +
 +#include "PJMediaEnvironment.h"
 +#include <Ice/Properties.h>
 +#include <pjlib.h>
 +#include <pjmedia.h>
 +#include <pjnath.h>
 +#include "PJUtil.h"
 +#include <AsteriskSCF/System/ExceptionsIf.h>
 +
 +using namespace std;
 +using namespace AsteriskSCF::PJMediaRTP;
 +using namespace AsteriskSCF::System::V1;
 +using namespace AsteriskSCF::PJUtil;
 +
++//
++// The main work of creating the various objects is done by the factory, not the PJMediaEnvironment constructor.
++//
 +PJMediaEnvironmentPtr AsteriskSCF::PJMediaRTP::PJMediaEnvironment::create(const Ice::PropertiesPtr& props, const string& propertyPrefix)
 +{
 +    return PJMediaEnvironmentPtr(
 +        new PJMediaEnvironment(PJLibConfiguration::create(props, propertyPrefix),
 +                ICEConfiguration::create(props, propertyPrefix),
 +                NATConfig::create(props, propertyPrefix),
 +                SRTPConfiguration::create(props, propertyPrefix)));
 +}
 +
 +PJMediaEnvironment::PJMediaEnvironment(const PJLibConfigurationPtr& libCfg,
 +        const ICEConfigurationPtr& iceCfg,
 +        const NATConfigPtr& natCfg,
 +        const SRTPConfigurationPtr& srtpCfg) :
 +    mPJLibConfig(libCfg),
 +    mICEConfig(iceCfg),
 +    mNATConfig(natCfg),
 +    mSRTPConfig(srtpCfg),
 +    mCachingPool(new pj_caching_pool)
 +{
++    //
++    // I find this practice a little sketchy since the pointers that might be retrieve through the accessors *must* not be
++    // used outside of the scope of this object's lifetime.
++    //
 +    pj_caching_pool_init(mCachingPool.get(), & pj_pool_factory_default_policy, 0);
 +    mPoolFactory = &(mCachingPool->factory);
 +    
 +    //
 +    // TODO: should these values come from configuration.
 +    //
 +    mMemoryPool = pj_pool_create(mPoolFactory, "media_rtp_pjmedia", 1024, 1024, 0);
 +}
diff --cc src/PJMediaEnvironment.h
index 2dea117,0000000..d2f2994
mode 100644,000000..100644
--- a/src/PJMediaEnvironment.h
+++ b/src/PJMediaEnvironment.h
@@@ -1,100 -1,0 +1,141 @@@
 +/*
 + * Asterisk SCF -- An open-source communications framework.
 + *
 + * Copyright (C) 2010, Digium, Inc.
 + *
 + * See http://www.asterisk.org for more information about
 + * the Asterisk SCF project. Please do not directly contact
 + * any of the maintainers of this project for assistance;
 + * the project provides a web site, mailing lists and IRC
 + * channels for your use.
 + *
 + * This program is free software, distributed under the terms of
 + * the GNU General Public License Version 2. See the LICENSE.txt file
 + * at the top of the source tree.
 + */
 +
 +#pragma once
 +
 +#include "PJLibConfiguration.h"
 +#include "NATConfig.h"
 +#include "ICEConfiguration.h"
 +#include "SRTPConfiguration.h"
 +
 +#include <Ice/PropertiesF.h>
 +#include <string>
 +#include <boost/shared_ptr.hpp>
 +
 +//
 +// Forward declarations.
 +//
 +struct pj_pool_factory;
 +struct pjmedia_endpt;
 +struct pj_pool_t;
 +struct pj_caching_pool;
 +
 +namespace AsteriskSCF
 +{
 +namespace PJMediaRTP
 +{
 +
 +class PJMediaEnvironment;
 +typedef boost::shared_ptr<PJMediaEnvironment> PJMediaEnvironmentPtr;
 +
++/**
++ *
++ * PJMediaEnvironment pulls together all of the different configuration modules for the current pjproject library
++ * features. Objects that need this info should use these accessors instead of caching their own copies. The
++ * PJMediaEnvironment can be updated with new configuration without affecting operations in progress. In progress
++ * operations will simply use the version of the configuration that was available when it started. The exception to this
++ * guideline is if there are multiple operations in a small scope that need a consistent version of the
++ * configuration. In this case, that operation should keep a scope-local copy for the duration of those operations. This
++ * can extend to AMI operations.
++ *
++ * PJMediaEnvironment provides accessors for the pool and pool factory used in so many pjX related operations. This
++ * prevents having pj related details peppered throughout the method signatures.
++ *
++ * Generally speaking this object should be instantiated when the service is loaded *or* as soon as the relevant
++ * configuration becomes available.
++ *
++ **/
 +class PJMediaEnvironment
 +{
 +public:
 +
++    /**
++     * Get generic configuration object.
++     */
 +    PJLibConfigurationPtr libConfig() const
 +    {
 +        return mPJLibConfig;
 +    }
 +
++    /**
++     * Get NAT related configuration object.
++     */
 +    NATConfigPtr natConfig() const
 +    {
 +        return mNATConfig;
 +    }
 +
++    /**
++     * Get ICE transport configuration object.
++     */
 +    ICEConfigurationPtr ICEConfig() const
 +    {
 +        return mICEConfig;
 +    }
 +
++    /**
++     * Get SRTP relatd configuratino object.
++     */
 +    SRTPConfigurationPtr srtpConfig() const
 +    {
 +        return mSRTPConfig;
 +    }
 +
++    /**
++     * Get our library instance's main pool factory. As this function does not return a reference counted pointer, its
++     * value should not be cached at all. It's validity is directly related to the lifetime of the PJMediaEnvironment
++     * object.
++     */
 +    pj_pool_factory* poolFactory() const
 +    {
 +        return mPoolFactory;
 +    }
- 
++    
++    /**
++     * Get the main memory pool. As this function does not return a reference counted pointer, its value should
++     * not be cached at all. It's validity is directly related to the lifetime of the PJMediaEnvironment object.
++     */
 +    pj_pool_t* memoryPool() const
 +    {
 +        return mMemoryPool;
 +    }
 +
- 
++    /**
++     * Create an instance of the object based on the Ice properties.
++     *
++     * XXX: This needs to be extended to work with the configuration service.
++     */
 +    static PJMediaEnvironmentPtr create(const Ice::PropertiesPtr& props, const std::string& prefix);
 +
 +private:
 +
 +    PJLibConfigurationPtr mPJLibConfig;
 +    ICEConfigurationPtr mICEConfig;
 +    NATConfigPtr mNATConfig;
 +    SRTPConfigurationPtr mSRTPConfig;
 +
 +    pj_pool_factory* mPoolFactory;
-     pjmedia_endpt* mEndpoint;
 +    pj_pool_t* mMemoryPool;
 +    boost::shared_ptr<pj_caching_pool> mCachingPool;
 +
 +    PJMediaEnvironment(const PJLibConfigurationPtr& libConfig,
 +            const ICEConfigurationPtr& iceConfig,
 +            const NATConfigPtr& natconfig,
 +            const SRTPConfigurationPtr& srtpConfig);
 +};
 +
 +} /* End of namespace PJMediaRTP */
 +} /* End of namespace AsteriskSCF */
diff --cc src/PJUtil.h
index e2383ec,0000000..2794652
mode 100644,000000..100644
--- a/src/PJUtil.h
+++ b/src/PJUtil.h
@@@ -1,40 -1,0 +1,49 @@@
 +/*
 + * Asterisk SCF -- An open-source communications framework.
 + *
 + * Copyright (C) 2010, Digium, Inc.
 + *
 + * See http://www.asterisk.org for more information about
 + * the Asterisk SCF project. Please do not directly contact
 + * any of the maintainers of this project for assistance;
 + * the project provides a web site, mailing lists and IRC
 + * channels for your use.
 + *
 + * This program is free software, distributed under the terms of
 + * the GNU General Public License Version 2. See the LICENSE.txt file
 + * at the top of the source tree.
 + */
 +
 +#pragma once
 +
++#ifdef _WIN32
++#pragma warning(push)
++#pragma warning(disable: 4267 4244)
++#endif
++
 +#include <pjlib.h>
 +
++#ifdef _WIN32
++#pragma warning(pop)
++#endif
++
 +namespace AsteriskSCF
 +{
 +namespace PJUtil
 +{
 +
 +/**
 + * Simple result checking functions overloaded on pj_status_t result type.
 + **/
 +inline bool success(pj_status_t r)
 +{
 +    return r == PJ_SUCCESS;
 +}
 +
 +inline bool fail(pj_status_t r)
 +{
 +    return !success(r);
 +}
 +
 +} /* End of namespace PJUtil */
 +} /* End of namespace AsteriskSCF */
diff --cc src/RTPSession.cpp
index ec6a746,641e5c8..282d0af
--- a/src/RTPSession.cpp
+++ b/src/RTPSession.cpp
@@@ -18,15 -28,10 +18,17 @@@
  #include "RTPSession.h"
  #include "RTPSource.h"
  #include "RTPSink.h"
 +#include "ServiceConfig.h"
 +
 +#include <pjlib.h>
 +#include <Ice/Ice.h>
 +#include <IceUtil/UUID.h>
 +#include <AsteriskSCF/System/ExceptionsIf.h>
 +
 +#include <pjmedia.h>
  
+ #include "RTPConfiguration.h"
+ 
  using namespace std;
  using namespace AsteriskSCF::Core::Discovery::V1;
  using namespace AsteriskSCF::Media::V1;
@@@ -124,35 -132,41 +126,49 @@@ public
  /**
   * Constructor for the RTPSessionImpl class (used by Ice).
   */
- RTPSessionImpl::RTPSessionImpl(const Ice::ObjectAdapterPtr& adapter, const FormatSeq& formats,
-         pj_pool_factory* factory, const ReplicaPtr& replicaService,
-         const AsteriskSCF::Discovery::SmartProxy<RtpStateReplicatorPrx>& stateReplicator) : 
-     mImpl(new RTPSessionImplPriv(adapter, formats, replicaService, stateReplicator))
+ RTPSessionImpl::RTPSessionImpl(const Ice::ObjectAdapterPtr& adapter, const RTPServiceLocatorParamsPtr& params,
+     pj_pool_factory* factory, const ReplicaPtr& replicaService,
+     const AsteriskSCF::Discovery::SmartProxy<RtpStateReplicatorPrx>& stateReplicator,
+     const ConfigurationServiceImplPtr& configurationService) : 
+     mImpl(new RTPSessionImplPriv(adapter, params->formats, replicaService, stateReplicator))
  {
      /* Add ourselves to the ICE ASM so we can be used. */
 +
 +    //
 +    // XXX: It's sketchy to add a servant to an object adapter in it's constructor.
 +    //
      mImpl->mProxy = RTPSessionPrx::uncheckedCast(adapter->addWithUUID(this));
  
      /* Create an endpoint in pjmedia for our media. */
-     pj_status_t status = pjmedia_endpt_create(factory, NULL, 1, &mImpl->mEndpoint);
+     pj_status_t status = pjmedia_endpt_create(factory, NULL, configurationService->getWorkerThreadCount(), &mImpl->mEndpoint);
+ 
+     assert(status == PJ_SUCCESS);
+ 
+     int af;
+     pj_str_t binding;
  
-     if (status != PJ_SUCCESS)
+     if (params->ipv6 == true)
+     {
+ 	af = pj_AF_INET6();
+ 	pj_strset(&binding, (char*)(configurationService->getBindIPv6address().c_str()), (configurationService->getBindIPv6address().size()));
+     }
+     else
      {
-         /* TODO: This is bad... we can't go on! */
-         throw InternalInitializationException("Unable to created PJMEDIA endpoint!");
+ 	af = pj_AF_INET();
+         pj_strset(&binding, (char*)(configurationService->getBindIPv4address().c_str()), (configurationService->getBindIPv4address().size()));
      }
  
+     int minimumPort = configurationService->getStartPort();
+     int maximumPort = configurationService->getEndPort();
+ 
      /* Now create some transport we can use to actually send or receive the media. */
 -    for (int port = minimumPort; port < maximumPort; port += 2)
 +
 +    //
 +    // The candidate ports increment by two to allow "room" for both a control and a data port.
 +    //
 +    for (int port = AsteriskSCF::PJMediaRTP::DefaultRTPPortMinimum; port < AsteriskSCF::PJMediaRTP::DefaultRTPPortMaximum; port += 2)
      {
-         if ((status = pjmedia_transport_udp_create2(mImpl->mEndpoint, "RTP", NULL, port, 0, &mImpl->mTransport)) ==
+         if ((status = pjmedia_transport_udp_create3(mImpl->mEndpoint, af, "RTP", pj_strlen(&binding) ? &binding : NULL, port, 0, &mImpl->mTransport)) ==
                  PJ_SUCCESS)
          {
  	    mImpl->mSessionStateItem->mPort = port;
@@@ -183,10 -198,8 +200,10 @@@
   * Constructor for the RTPSessionImpl class (used by state replicator).
   */
  RTPSessionImpl::RTPSessionImpl(const Ice::ObjectAdapterPtr& adapter, pj_pool_factory* factory,
 +        const Ice::Identity& sessionIdentity, const Ice::Identity& sinkIdentity, const Ice::Identity& sourceIdentity,
 +        Ice::Int port, const FormatSeq& formats) :
- ///
- // MEMORY LEAK XXX->>>
+     const Ice::Identity& sessionIdentity, const Ice::Identity& sinkIdentity, const Ice::Identity& sourceIdentity,
+     Ice::Int port, const FormatSeq& formats, bool ipv6, const ConfigurationServiceImplPtr& configurationService) :
      mImpl(new RTPSessionImplPriv(adapter, formats, 0, *(new AsteriskSCF::Discovery::SmartProxy<RtpStateReplicatorPrx>)))
  {
      mImpl->mProxy = RTPSessionPrx::uncheckedCast(adapter->add(this, sessionIdentity));
diff --cc src/RTPSession.h
index 30127f9,4ba6e86..df8cdfb
--- a/src/RTPSession.h
+++ b/src/RTPSession.h
@@@ -8,26 -8,35 +8,61 @@@
  
  #pragma once
  
- #include <AsteriskSCF/System/Component/ComponentServiceIf.h>
- #include <AsteriskSCF/System/Component/ReplicaIf.h>
 -#include <boost/shared_ptr.hpp>
++#include "RtpStateReplicationIf.h"
++#include "RTPConfiguration.h"
++#include "PJMediaEnvironment.h"
++
  #include <AsteriskSCF/Discovery/SmartProxy.h>
+ 
 -#include "RTPConfiguration.h"
++#include <AsteriskSCF/System/Component/ReplicaIf.h>
++#include <AsteriskSCF/System/Component/ComponentServiceIf.h>
 +#include <AsteriskSCF/Media/MediaIf.h>
 +#include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
- #include "RtpStateReplicationIf.h"
  
 -/**
 - * Forward definition for our private implementation of RTPSession.
 - */
 -class RTPSessionImplPriv;
 +#include <boost/shared_ptr.hpp>
  
 -/**
 - * Forward definition for our private implementation of StreamSinkRTP.
 - */
 -class StreamSinkRTPImpl;
++namespace AsteriskSCF
++{
++namespace PJMediaRTP
++{
++class RTPSession
++{
++public:
++    //
++    // XXX service locator params
++    // configuration service servant (why?)
++    //
++    static AsteriskSCF::Media::RTP::V1::RTPSessionPrx create(const Ice::ObjectAdapterPtr& objectAdapter,
++            const std::string& id,
++            const AsteriskSCF::Media::V1::FormatSeq& formats,
++            const PJMediaEnvironmentPtr& environment,
++            const AsteriskSCF::System::Component::V1::ReplicaPrx& replicaControl,
++            const AsteriskSCF::Discovery::SmartProxy<
++                AsteriskSCF::Media::RTP::V1::RtpStateReplicatorPrx>& stateReplicator
++    );
+ 
 -/**
 - * A typedef which creates a smart pointer type for StreamSinkRTPImpl.
 - */
 -typedef IceUtil::Handle<StreamSinkRTPImpl> StreamSinkRTPImplPtr;
++    static ReplicationAdapterPtr create(const Ice::ObjectAdapterPtr& objectAdapter,
++        const PJMediaEnvironmentPtr& environment,
++        const AsteriskSCF::Media::RTP::V1::RtpSessionStateItemPtr& update
++    );
++};
++} /* End of namespace RTPMedia */
++} /* End of namespace AsteriskSCF */
+ 
 -/**
 - * Forward definition for our private implementation of StreamSourceRTP.
 - */
 -class StreamSourceRTPImpl;
++
++#if 0
+ 
  /**
 - * A typedef which creates a smart pointer type for StreamSourceRTPImpl.
 + * Forward definition for our private implementation of RTPSession.
   */
 -typedef IceUtil::Handle<StreamSourceRTPImpl> StreamSourceRTPImplPtr;
 +class RTPSessionImplPriv;
 +
 +//
 +// Forward declarations.
 +//
 +
 +struct pjmedia_transport;
 +struct pj_pool_factory;
  
  /**
   * Implementation of the RTPSession interface as defined in MediaRTPIf.ice
@@@ -35,11 -44,13 +70,13 @@@
  class RTPSessionImpl : public AsteriskSCF::Media::RTP::V1::RTPSession
  {
  public:
-     RTPSessionImpl(const Ice::ObjectAdapterPtr&, const AsteriskSCF::Media::V1::FormatSeq&,
-             pj_pool_factory*, const AsteriskSCF::System::Component::V1::ReplicaPtr&, 
-             const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::Media::RTP::V1::RtpStateReplicatorPrx>&);
 -    RTPSessionImpl(const Ice::ObjectAdapterPtr&, const AsteriskSCF::Media::RTP::V1::RTPServiceLocatorParamsPtr&,
++   RTPSessionImpl(const Ice::ObjectAdapterPtr&, const AsteriskSCF::Media::RTP::V1::RTPServiceLocatorParamsPtr&,
+ 	pj_pool_factory*, const AsteriskSCF::System::Component::V1::ReplicaPtr&, 
+ 	const AsteriskSCF::Discovery::SmartProxy<AsteriskSCF::Media::RTP::V1::RtpStateReplicatorPrx>&,
+ 	const ConfigurationServiceImplPtr&);
      RTPSessionImpl(const Ice::ObjectAdapterPtr&, pj_pool_factory*, const Ice::Identity&, const Ice::Identity&,
-             const Ice::Identity&, Ice::Int, const AsteriskSCF::Media::V1::FormatSeq&);
+ 	const Ice::Identity&, Ice::Int, const AsteriskSCF::Media::V1::FormatSeq&, bool,
+ 	const ConfigurationServiceImplPtr&);
      AsteriskSCF::Media::V1::StreamSourceSeq getSources(const Ice::Current&);
      AsteriskSCF::Media::V1::StreamSinkSeq getSinks(const Ice::Current&);
      std::string getId(const Ice::Current&);
@@@ -72,3 -83,3 +109,4 @@@ private
   * A typedef which creates a smart pointer type for RTPSessionImpl.
   */
  typedef IceUtil::Handle<RTPSessionImpl> RTPSessionImplPtr;
++#endif
diff --cc src/RTPSink.cpp
index 69fea7c,41e7b18..ab64164
--- a/src/RTPSink.cpp
+++ b/src/RTPSink.cpp
@@@ -14,12 -14,21 +14,18 @@@
   * at the top of the source tree.
   */
  
 -#include <pjlib.h>
 -#include <pjmedia.h>
 +#include "RTPSink.h"
++#include "RtpStateReplicationIf.h"
  
 -#include <Ice/Ice.h>
  #include <IceUtil/UUID.h>
 +#include <pjlib.h>
 +#include <pjmedia.h>
  
+ #include <AsteriskSCF/Media/MediaIf.h>
+ #include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
+ #include <AsteriskSCF/System/Component/ReplicaIf.h>
+ 
 -#include "RtpStateReplicationIf.h"
 -
 -#include "RTPSession.h"
 -#include "RTPSink.h"
+ 
  using namespace std;
  using namespace AsteriskSCF::Core::Discovery::V1;
  using namespace AsteriskSCF::Media::V1;
@@@ -215,15 -247,3 +221,15 @@@ RtpStreamSinkStateItemPtr StreamSinkRTP
  {
      return mImpl->mSinkStateItem;
  }
 +
 +
 +void StreamSinkRTPImpl::setRemoteDetailsImpl(const std::string& host, Ice::Int port)
 +{
 +    mImpl->mSinkStateItem->mRemoteAddress = host;
 +    mImpl->mSinkStateItem->mRemotePort = port;
 +}
 +
 +void StreamSinkRTPImpl::setSourceImpl(const AsteriskSCF::Media::V1::StreamSourcePrx& proxy)
 +{
 +    mImpl->mSinkStateItem->mSource = proxy;
- }
++}
diff --cc src/RTPSource.cpp
index 33c64e3,3bc22c1..9065bd3
--- a/src/RTPSource.cpp
+++ b/src/RTPSource.cpp
@@@ -19,11 -19,16 +19,14 @@@
  #include <Ice/Ice.h>
  #include <IceUtil/UUID.h>
  
 -#include <AsteriskSCF/Media/MediaIf.h>
 -#include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
 +#include <pjlib.h>
 +#include <pjmedia.h>
 +
  #include <AsteriskSCF/logger.h>
+ #include <AsteriskSCF/System/Component/ReplicaIf.h>
+ 
+ #include "RtpStateReplicationIf.h"
  
 -#include "RTPSession.h"
 -#include "RTPSource.h"
 -
  using namespace std;
  using namespace AsteriskSCF::Core::Discovery::V1;
  using namespace AsteriskSCF::Media::V1;
@@@ -228,15 -239,32 +231,32 @@@ void StreamSourceRTPImpl::setRemoteDeta
      pj_str_t tmpAddress;
      pj_strset(&tmpAddress, (char*)address.c_str(), address.size());
  
-     /* Now for the next trick - convert into a pj_sockaddr_in so we can pass it to pjmedia_transport_attach */
-     pj_sockaddr_in_init(&sin, &tmpAddress, (pj_uint16_t) port);
+     /* Now for the next trick - convert into a pj_sockaddr so we can pass it to pjmedia_transport_attach */
+     pj_status_t status = pj_sockaddr_parse(pj_AF_UNSPEC(), 0, &tmpAddress, &addr);
+ 
+     if (status != PJ_SUCCESS)
+     {
+ 	throw InvalidAddress();
+     }
+ 
+     // Confirm that the address family of the address matches that of this RTP session
+     pjmedia_transport_info transportInfo;
+ 
+     pjmedia_transport_info_init(&transportInfo);
+     pjmedia_transport_get_info(mImpl->mSession->getTransport(), &transportInfo);
+ 
+     if (transportInfo.sock_info.rtp_addr_name.addr.sa_family != addr.addr.sa_family)
+     {
+ 	throw InvalidAddress();
+     }
+ 
+     pj_sockaddr_set_port(&addr, static_cast<pj_uint16_t>(port));
  
      /* In case we were already attached go ahead and detach */
 -    pjmedia_transport_detach(mImpl->mSession->getTransport(), this);
 +    pjmedia_transport_detach(mImpl->mTransport->getTransport(), this);
  
      /* All ready... actually do it! */
-     pj_status_t status = pjmedia_transport_attach(mImpl->mTransport->getTransport(), this, &sin, NULL, 
-       sizeof(pj_sockaddr_in), &receiveRTP, NULL);
+     status = pjmedia_transport_attach(mImpl->mSession->getTransport(), this, &addr, NULL, pj_sockaddr_get_len(&addr), &receiveRTP, NULL);
  
      if (status != PJ_SUCCESS)
      {
diff --cc src/RtpStateReplicator.h
index 94eaa6f,b244dda..deb0907
--- a/src/RtpStateReplicator.h
+++ b/src/RtpStateReplicator.h
@@@ -16,16 -16,22 +16,18 @@@
  
  #pragma once
  
 -#include <Ice/Ice.h>
 -
 -#include <AsteriskSCF/Replication/StateReplicator.h>
+ #include "RtpStateReplicationIf.h"
+ #include "RTPConfiguration.h"
+ 
 +#include <Ice/Ice.h>
 +#include <AsteriskSCF/Replication/StateReplicator.h>
- #include "RtpStateReplicationIf.h"
- #include "PJMediaEnvironment.h"
- #include <string>
+ #include <boost/shared_ptr.hpp>
  
 -#include "RTPConfiguration.h"
 -
 -
  typedef AsteriskSCF::Replication::StateReplicator<
      AsteriskSCF::Media::RTP::V1::RtpStateReplicator, 
-     AsteriskSCF::Media::RTP::V1::RtpStateItemPtr, std::string,
-     AsteriskSCF::Media::RTP::V1::RtpStateReplicatorListenerPrx> RtpStateReplicatorI;
+     AsteriskSCF::Media::RTP::V1::RtpStateItemPtr, 
+     std::string, AsteriskSCF::Media::RTP::V1::RtpStateReplicatorListenerPrx> RtpStateReplicatorI;
+ 
  typedef IceUtil::Handle<RtpStateReplicatorI> RtpStateReplicatorIPtr;
  
  //
diff --cc src/RtpStateReplicatorListener.cpp
index 00f1831,4f3cef1..a972abc
--- a/src/RtpStateReplicatorListener.cpp
+++ b/src/RtpStateReplicatorListener.cpp
@@@ -59,11 -54,11 +59,12 @@@ private
  struct RtpStateReplicatorListenerImpl
  {
  public:
 -    RtpStateReplicatorListenerImpl(const Ice::ObjectAdapterPtr& adapter, pj_pool_factory *poolFactory,
 -	const RtpGeneralStateItemPtr& generalState,
 +    RtpStateReplicatorListenerImpl(const Ice::ObjectAdapterPtr& adapter, const PJMediaEnvironmentPtr& env,
-             const RtpGeneralStateItemPtr& generalState)
++            const RtpGeneralStateItemPtr& generalState,
+ 	const ConfigurationServiceImplPtr& configurationService)
 -        : mId(IceUtil::generateUUID()), mAdapter(adapter), mPoolFactory(poolFactory), mGeneralState(generalState),
 -	  mConfigurationService(configurationService) {}
 +        : mId(IceUtil::generateUUID()), mAdapter(adapter), mEnvironment(env), mGeneralState(generalState) 
 +    {
 +    }
      
      void removeStateNoticeImpl(const Ice::StringSeq& itemKeys)
      {
@@@ -100,10 -96,12 +102,16 @@@
  		    boost::shared_ptr<RtpStateReplicatorItem> newitem(new RtpStateReplicatorItem());
  		    localitem = newitem;
  		    mImpl->mStateItems.insert(make_pair(item->mSessionId, newitem));
--
++/*
 +		    ReplicationAdapterPtr replicationAdapter = AsteriskSCF::PJMediaRTP::RTPSession::create(mImpl->mAdapter,
-                         mImpl->mEnvironment, item);
++                            mImpl->mEnvironment, item, mImpl->mConfigurationService);
 +                    localitem->setAdapter(replicationAdapter);
++*/
+ 		    RTPSessionImplPtr localSession =
+                         new RTPSessionImpl(mImpl->mAdapter, mImpl->mPoolFactory, item->mSessionIdentity,
+ 			    item->mSinkIdentity, item->mSourceIdentity, item->mPort, item->mFormats, item->mIPv6,
+ 			    mImpl->mConfigurationService);
+ 		    localitem->setSession(localSession);
  		}
  		else
  		{
@@@ -143,13 -145,15 +151,22 @@@
      string mId;
      map<string, boost::shared_ptr<RtpStateReplicatorItem> > mStateItems;
      Ice::ObjectAdapterPtr mAdapter;
 -    pj_pool_factory *mPoolFactory;
 +    PJMediaEnvironmentPtr mEnvironment;
      RtpGeneralStateItemPtr mGeneralState;
+     ConfigurationServiceImplPtr mConfigurationService;
  };
  
++/*
  RtpStateReplicatorListenerI::RtpStateReplicatorListenerI(const Ice::ObjectAdapterPtr& adapter,
++<<<<<<< HEAD
 +        const PJMediaEnvironmentPtr& environment, const RtpGeneralStateItemPtr& generalState)
 +    : mImpl(new RtpStateReplicatorListenerImpl(adapter, environment, generalState)) {}
++=======
+     pj_pool_factory *poolFactory, const RtpGeneralStateItemPtr& generalState,
+     const ConfigurationServiceImplPtr& configurationService)
+     : mImpl(new RtpStateReplicatorListenerImpl(adapter, poolFactory, generalState, configurationService)) {}
++>>>>>>> master
++*/
  
  RtpStateReplicatorListenerI::~RtpStateReplicatorListenerI()
  {
diff --cc test/CMakeLists.txt
index 812a061,bc8266a..3905f6c
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@@ -8,9 -8,15 +8,16 @@@ asterisk_scf_component_add_slice(media_
  asterisk_scf_component_add_boost_libraries(media_rtp_pjmedia_test unit_test_framework thread date_time)
  asterisk_scf_component_build_icebox(media_rtp_pjmedia_test)
  target_link_libraries(media_rtp_pjmedia_test asterisk-scf-api)
 +target_link_libraries(media_rtp_pjmedia_test ice-util-cpp)
  
- # integration test
- if(integrated_build STREQUAL "true")
-   asterisk_scf_test_icebox(media_rtp_pjmedia_test config/test_component.config)
- endif()
+ asterisk_scf_component_init(media_rtp_pjmedia_test_v6)
+ asterisk_scf_component_add_file(media_rtp_pjmedia_test_v6 TestRTPpjmedia.cpp)
+ asterisk_scf_component_add_slice(media_rtp_pjmedia_test_v6 ../local-slice/RtpStateReplicationIf.ice)
+ asterisk_scf_component_add_boost_libraries(media_rtp_pjmedia_test_v6 unit_test_framework thread date_time)
+ asterisk_scf_component_build_icebox(media_rtp_pjmedia_test_v6)
+ pjproject_link(media_rtp_pjmedia_test_v6 pjlib)
+ set_property(TARGET media_rtp_pjmedia_test_v6 PROPERTY COMPILE_DEFINITIONS IPV6_TEST)
+ target_link_libraries(media_rtp_pjmedia_test_v6 asterisk-scf-api)
+ 
+ asterisk_scf_test_icebox(media_rtp_pjmedia_test config/test_component.config)
+ asterisk_scf_test_icebox(media_rtp_pjmedia_test_v6 config/test_component_v6.config)

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list