using Independentsoft.Sip;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SipComponent
{
static class ExtentionMethods
{
///
/// Gets the Dialog with the specified id
///
/// The object to which the method applies
/// A sip Id with whom the SipClient class is in dialog
///
public static Dialog GetDialogWith(this SipClient sipClient, string sipID)
{
return sipClient.Dialogs.FirstOrDefault((dialog) =>
{
if ((dialog.From.Address.Split(':', '@')[1] == sipID) ||
(dialog.To.Address.Split(':', '@')[1] == sipID))
return true;
else
return false;
});
}
}
}