void SipRedirectorPresenceRouting::removeNonVoicemailContacts( ContactList& contactList ) { // walk the list to find the contact entry for voicemail size_t index; Url contactUrl; bool bVoicemailContactFound = false; for( index = 0; index < contactList.entries(); index++ ) { if( contactList.get( index, contactUrl ) ) { UtlString userPart; contactUrl.getUserId( userPart ); if( userPart.index( VOICEMAIL_CONTACT_PREFIX ) == 0 ) { bVoicemailContactFound = true; break; } } } // if vm contact found, remove all and put vm contact back in. if( bVoicemailContactFound ) { contactList.removeAll( *this ); contactList.add( contactUrl, *this ); } }
virtual RedirectPlugin::LookUpStatus lookUp( const SipMessage& message, const UtlString& requestString, const Url& requestUri, const UtlString& method, ContactList& contactList, RequestSeqNo requestSeqNo, int redirectorNo, SipRedirectorPrivateStorage*& privateStorage, ErrorDescriptor& errorDescriptor) { char diagMessage[100]; sprintf( diagMessage, "%s::lookUp: contactList Size=%d", mLogName.data(), contactList.entries() ); globalList.push_back( diagMessage ); if( mBehavior.compareTo("ADD_SELF_AS_CONTACT") == 0 ) { contactList.add( mLogName, *this ); return RedirectPlugin::SUCCESS; } else if( mBehavior.compareTo("DONT_ADD_CONTACT") == 0 ) { return RedirectPlugin::SUCCESS; } else if( mBehavior.compareTo("RETURN_ERROR") == 0 ) { return RedirectPlugin::ERROR; } return RedirectPlugin::SUCCESS; }
virtual void observe( const SipMessage& message, ///< the incoming SIP message const UtlString& requestString, /**< the request URI from the SIP message as a UtlString * ONLY for use in debugging messages; all comparisons * should be with requestUri */ const Url& requestUri, ///< the request URI from the SIP message as a Uri, const UtlString& method, ///< Method of the request to observe const ContactList& contactList, ///< Read-only list of contacts to use for redirection RequestSeqNo requestSeqNo, ///< the request sequence number int redirectorNo ///< the identifier for this redirector ) { char diagMessage[100]; sprintf( diagMessage, "%s::observe: contactList Size=%d", mLogName.data(), contactList.entries() ); globalList.push_back( diagMessage ); }