char *prompt(EditLine * e)
{
if (*prompt_str == '\0') {
- switch_snprintf(prompt_str, sizeof(prompt_str), "sangoma-media-gateway@%s> ", hostname);
- switch_snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", switch_core_get_switchname());
++ switch_snprintf(prompt_str, sizeof(prompt_str), "sangoma-media-gateway@%s> ", switch_core_get_switchname());
}
return prompt_str;
GetModuleFileName(NULL, base_dir, BUFSIZE);
lastbacklash = strrchr(base_dir, '\\');
base_dir[(lastbacklash - base_dir)] = '\0';
+ /* set base_dir as cwd, to be able to use relative paths in scripting languages (e.g. mod_lua) when FS is running as a service or while debugging FS using visual studio */
+ SetCurrentDirectory(base_dir);
+
#else
char base_dir[1024] = SWITCH_PREFIX_DIR;
+ if (SWITCH_GLOBAL_dirs.base_dir) {
+ snprintf(base_dir, sizeof(base_dir), "%s", SWITCH_GLOBAL_dirs.base_dir);
+ }
#endif
if (!SWITCH_GLOBAL_dirs.base_dir && (SWITCH_GLOBAL_dirs.base_dir = (char *) malloc(BUFSIZE))) {