private void OnCallIncoming(int call, int call2replace, CORESIP_CallInfo info, CORESIP_CallInInfo inInfo) { _Logger.Debug("Nueva llamada entrante [SrdId={0}] [SrcIp={1}] [SrcSubId={2}] [SrcRs={3}] [DstId={4}] [DstIp={5}] [DstSubId={6}]", inInfo.SrcId, inInfo.SrcIp, inInfo.SrcSubId, inInfo.SrcRs, inInfo.DstId, inInfo.DstIp, inInfo.DstSubId); Top.WorkingThread.Enqueue("OnCallIncoming", delegate() { CORESIP_Answer answer = new CORESIP_Answer(SipAgent.SIP_NOT_FOUND); string dstId = string.IsNullOrEmpty(inInfo.DstSubId) ? inInfo.DstId : inInfo.DstSubId; foreach (StrNumeroAbonado alias in Top.Cfg.HostAddresses) { if (string.Compare(dstId, alias.NumeroAbonado, true) == 0) { answer.Value = SipAgent.SIP_DECLINE; switch (info.Type) { case CORESIP_CallType.CORESIP_CALL_DIA: General.SafeLaunchEvent(IncomingTlfCall, this, call, call2replace, info, inInfo, answer); break; case CORESIP_CallType.CORESIP_CALL_IA: General.SafeLaunchEvent(IncomingLcCall, this, call, info, inInfo, answer); break; case CORESIP_CallType.CORESIP_CALL_GG_MONITORING: //ULISES solo soporta G/G monitoring General.SafeLaunchEvent(IncomingMonitoringCall, this, call, info, inInfo, answer); break; case CORESIP_CallType.CORESIP_CALL_MONITORING: case CORESIP_CallType.CORESIP_CALL_AG_MONITORING: answer.Value = SipAgent.SIP_BAD_REQUEST; //ULISES solo soporta G/G monitoring break; } break; } } try { if (answer.Value == SipAgent.SIP_MOVED_TEMPORARILY) { SipAgent.MovedTemporallyAnswerCall(call, answer.redirectTo, "unconditional"); } else if (answer.Value != 0 && answer.Value != SipAgent.SIP_DECLINE) { SipAgent.AnswerCall(call, answer.Value); } } catch (Exception exc) { _Logger.Error("SipAgent.AnswerCall", exc.Message); } }); }