[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "telephone-events" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Wed Jul 27 14:03:26 CDT 2011
branch "telephone-events" has been updated
via 9404329a8b8249a38809c708bfa55092635f2c92 (commit)
from 6f8904c6e789bb9aa71600da73ab81cc06563572 (commit)
Summary of changes:
src/SipTelephonyEventSource.cpp | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit 9404329a8b8249a38809c708bfa55092635f2c92
Author: Mark Michelson <mmichelson at digium.com>
Date: Wed Jul 27 14:03:26 2011 -0500
Make adjustments based on feedback on CR-ASTSCF-135
* Use a const_iterator
* Don't allow the same sink to be added multiple times to a source.
diff --git a/src/SipTelephonyEventSource.cpp b/src/SipTelephonyEventSource.cpp
index 3985481..b7eab2c 100644
--- a/src/SipTelephonyEventSource.cpp
+++ b/src/SipTelephonyEventSource.cpp
@@ -27,7 +27,7 @@ using namespace AsteriskSCF::System::WorkQueue::V1;
void SipTelephonyEventSource::distributeToSinks(const AsteriskSCF::SessionCommunications::V1::TelephonyEventPtr& event)
{
- for (AsteriskSCF::SessionCommunications::V1::TelephonyEventSinkSeq::iterator iter = mSinks.begin();
+ for (AsteriskSCF::SessionCommunications::V1::TelephonyEventSinkSeq::const_iterator iter = mSinks.begin();
iter != mSinks.end(); ++iter)
{
(*iter)->write(event);
@@ -67,7 +67,10 @@ void SipTelephonyEventSource::addSink_async(
void SipTelephonyEventSource::addSink(const AsteriskSCF::SessionCommunications::V1::TelephonyEventSinkPrx& sink)
{
- mSinks.push_back(sink);
+ if (std::find(mSinks.begin(), mSinks.end(), sink) == mSinks.end())
+ {
+ mSinks.push_back(sink);
+ }
}
class GetSinks : public SuspendableWork
-----------------------------------------------------------------------
--
asterisk-scf/integration/sip.git
More information about the asterisk-scf-commits
mailing list