fixy
This commit is contained in:
		
							parent
							
								
									acc4fa5022
								
							
						
					
					
						commit
						3fa6a199ee
					
				
							
								
								
									
										8
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								index.js
									
									
									
									
									
								
							|  | @ -38,13 +38,13 @@ function parseVoicemailData(data) { | |||
| } | ||||
| 
 | ||||
| function getUsers() { | ||||
| 	var vmData = fs.readFileSync(process.env.DEV == "true" ? "./dev/voicemail.conf" : "/etc/asterisk/voicemail.conf").toString() | ||||
| 	var vmData = fs.readFileSync(process.env.DEV ? "./dev/voicemail.conf" : "/etc/asterisk/voicemail.conf").toString() | ||||
| 	voicemailData = parseVoicemailData(extractTextFromRawText(vmData)); | ||||
| 	return voicemailData; | ||||
| } | ||||
| 
 | ||||
| function getEndpoints() { | ||||
| 	if (!process.env.DEV == "true") { | ||||
| 	if (!process.env.DEV) { | ||||
| 		const currentEndpoint = execSync('asterisk -x "pjsip show endpoints"').toString(); | ||||
| 		const endpoints = currentEndpoint.split("\n"); | ||||
| 		return endpoints; | ||||
|  | @ -142,7 +142,7 @@ function renderStatusPage() { | |||
| 		if (err) { | ||||
| 			console.error(err); | ||||
| 		} else { | ||||
| 			fs.writeFileSync(process.env.DEV == "true" ? "./dev/index.html" : "/var/www/html/status/index.html", str); | ||||
| 			fs.writeFileSync(process.env.DEV ? "./dev/index.html" : "/var/www/html/status/index.html", str); | ||||
| 		} | ||||
| 	}); | ||||
| } | ||||
|  | @ -155,7 +155,7 @@ client.on("ready", () => { | |||
| 	setInterval(renderStatusPage, 5*1000); | ||||
| }); | ||||
| 
 | ||||
| if (process.env.DEV == "true") { | ||||
| if (process.env.DEV) { | ||||
| 	console.log("DEV") | ||||
| 	renderStatusPage(); | ||||
| 	notifyNew(); | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue