private void Holder_Completed(object sender, EventArgs e) { InviteHolder holder = sender as InviteHolder; remoteHolder(holder); //记录本次呼叫对应的接收端地址。 _targets[holder.CallID] = new InviteSource(holder.VideoId, holder.RemoteIP, holder.RemotePort); }
public void PutInvite(SIP_RequestReceivedEventArgs e) { if (e.Request.RequestLine.Method.ToUpper().Equals(SIP_Methods.INVITE)) { InviteHolder holder = new InviteHolder(_sipServer, e); holder.CommandTimeout += Holder_CommandTimeout; holder.Completed += Holder_Completed; _holders[holder.GUID] = holder; holder.Start(); } }
private void remoteHolder(InviteHolder holder) { holder.CommandTimeout -= Holder_CommandTimeout; holder.Completed -= Holder_Completed; _holders.Remove(holder.GUID); }