Dear sipx experts,

Maybe SipDialog::isEarlyDialogFor() has bug because it doesn't compare 
SipDialog'callid with the argument callId.

UtlBoolean SipDialog::isEarlyDialogFor(const UtlString& callId,
                                       const UtlString& localTag,
                                       const UtlString& remoteTag) const
{
    // missing : if(callId.compareTo(*this, UtlString::ignoreCase) != 0) return 
FALSE; ?

    UtlBoolean isSameEarlyDialog = FALSE;

    // If the local tag is NULL the remote tag must match one of the
    // two given tags, to be an early dialog for the given dialog info
    if(mLocalTag.isNull())
    {
        if(localTag.compareTo(mRemoteTag, UtlString::ignoreCase) == 0 ||
           remoteTag.compareTo(mRemoteTag, UtlString::ignoreCase) == 0)
        {
            isSameEarlyDialog = TRUE;
        }
    }

    // If the remote tag is NULL the local tag must match one of the
    // two given tags, to be an early dialog for the given dialog info
    else if(mRemoteTag.isNull())
    {
        if(localTag.compareTo(mLocalTag, UtlString::ignoreCase) == 0 ||
           remoteTag.compareTo(mLocalTag, UtlString::ignoreCase) == 0)
        {
            isSameEarlyDialog = TRUE;
        }
    }

    return(isSameEarlyDialog);
}

The following method has same bug.

UtlBoolean SipDialog::wasEarlyDialogFor(const UtlString& callId,
                                        const UtlString& localTag,
                                        const UtlString& remoteTag) const
{
    UtlBoolean wasSameEarlyDialog = FALSE;

    // Assume that if any either of the given tags matches 
    // one of the dialog's tags that they shared the same
    // early dialog
    if(localTag.compareTo(mRemoteTag, UtlString::ignoreCase) == 0 ||
       remoteTag.compareTo(mRemoteTag, UtlString::ignoreCase) == 0 ||
       localTag.compareTo(mLocalTag, UtlString::ignoreCase) == 0 ||
       remoteTag.compareTo(mLocalTag, UtlString::ignoreCase) == 0)
    {
        wasSameEarlyDialog = TRUE;
    }

    return(wasSameEarlyDialog);
}


Thank for reading.

_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev

Reply via email to