/// <summary> /// Iniciar reproducción. /// </summary> public override void start() { jobDataCommonStatic = jobDataCommon; //Tiempo de duración de la reproducción. En segundos. resetTime(); if (!jobDataCommon.callServer.callTime.Equals(0)) { time = jobDataCommon.callServer.callTime; } //Establecer tipo de archivo a reproducir. if (System.IO.File.Exists(jobDataCommon.callServer.soundFile.targetPath)) { try { extTypePlayer = System.IO.Path.GetExtension(jobDataCommon.callServer.soundFile.targetPath).ToLower(); } catch (Exception e) { log.Error("No fue posible obtener la extensión del archivo de audio", e); } } else { log.Error("El archivo de audio no existe"); } //Inicializar reproductor. initPlayback(); }
/// <summary> /// Iniciar llamada. /// </summary> public override void start() { jobDataCommonStatic = jobDataCommon; var account = new SIPAccount(jobDataCommon.registrationRequired, jobDataCommon.connectionCallServer.displayName, jobDataCommon.connectionCallServer.userName, jobDataCommon.connectionCallServer.registerName, jobDataCommon.connectionCallServer.registerPassword, jobDataCommon.domainHost, jobDataCommon.domainPort); //Extensión a llamar. numberToDial. registerName = jobDataCommon.callServer.registerName; //Tiempo de duración de la llamada. En segundos. resetTime(); if (!jobDataCommon.callServer.callTime.Equals(0)) { time = jobDataCommon.callServer.callTime; } //Registrar cuenta. Los eventos desencadenan la ejecución de la llamada. registerAccount(account); //Establecer tipo de archivo a reproducir. if (System.IO.File.Exists(jobDataCommon.callServer.soundFile.targetPath)) { try { extTypePlayer = System.IO.Path.GetExtension(jobDataCommon.callServer.soundFile.targetPath).ToLower(); } catch (Exception e) { log.Error("No fue posible obtener la extensión del archivo de audio", e); } } else { log.Error("El archivo de audio no existe"); } //Inicializar reproductor. initStreamPlayback(); }