Use the Terminate method to leave a session at any time. Depending on the state of the application, the Terminate method will send a BYE message and disconnect the session, or send a CANCEL message and disconnect the session. Some session properties might still be valid even after the Terminate method is called. Terminate cleans up any pending operations such as outstanding REFER subscriptions or queued messages. See the following example.

Copy Code
foreach (SignalingSession SessionToTerminate in m_ListOfSessions)
{
  if (SessionToTerminate != null)
  {
	SessionToTerminate.Terminate();
  }
}

See Also