diff --git a/console/linphonec.c b/console/linphonec.c index 1161c87f20..9037ad119f 100644 --- a/console/linphonec.c +++ b/console/linphonec.c @@ -399,16 +399,21 @@ static void start_prompt_reader(void){ #if !defined(_WIN32_WCE) static bctbx_pipe_t create_server_socket(void){ char path[128]; + { + char* profile_id_env = getenv("LINPHONE_PROFILE_ID"); + if (profile_id_env){ + snprintf(path,sizeof(path)-1,"linphonec-%s",profile_id_env); + }else{ #ifndef _WIN32 snprintf(path,sizeof(path)-1,"linphonec-%i",getuid()); #else - { TCHAR username[128]; DWORD size=sizeof(username)-1; GetUserName(username,&size); snprintf(path,sizeof(path)-1,"linphonec-%s",username); - } #endif + } + } return bctbx_server_pipe_create(path); } diff --git a/console/shell.c b/console/shell.c index 86da875397..927739c8b4 100644 --- a/console/shell.c +++ b/console/shell.c @@ -82,7 +82,12 @@ static int send_command(const char *command, char *reply, int reply_len, int pri int err; char path[128]; #ifndef _WIN32 - snprintf(path,sizeof(path)-1,"linphonec-%i",getuid()); + char* profile_id_env = getenv("LINPHONE_PROFILE_ID"); + if (profile_id_env){ + snprintf(path,sizeof(path)-1,"linphonec-%s", profile_id_env); + }else{ + snprintf(path,sizeof(path)-1,"linphonec-%i", getuid()); + } #else { char username[128];