Skip to content
Snippets Groups Projects
Commit 56445be4 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

#6233: Fix serialized account list terminated with a ";" character

parent e64c7a3b
Branches
Tags
No related merge requests found
...@@ -76,6 +76,8 @@ void create_new_conference (conference_state_t state, const gchar* confID, confe ...@@ -76,6 +76,8 @@ void create_new_conference (conference_state_t state, const gchar* confID, confe
new_conf->participant_list = NULL; new_conf->participant_list = NULL;
new_conf->participant_number = NULL; new_conf->participant_number = NULL;
set_conference_timestamp(&new_conf->_time_start);
*conf = new_conf; *conf = new_conf;
} }
...@@ -259,7 +261,7 @@ void create_conference_history_entry_from_serialized(gchar *timestamp, gchar **p ...@@ -259,7 +261,7 @@ void create_conference_history_entry_from_serialized(gchar *timestamp, gchar **p
gchar *time_stop = ""; gchar *time_stop = "";
gchar *accountID = ""; gchar *accountID = "";
gchar *recordfile = ""; gchar *recordfile = "";
const gchar *confID = "conf_1234"; const gchar *confID = generate_call_id();
DEBUG("Conference: Create a conference from serialized form"); DEBUG("Conference: Create a conference from serialized form");
...@@ -310,7 +312,7 @@ static void process_conference_participant_from_serialized(gchar *participant, c ...@@ -310,7 +312,7 @@ static void process_conference_participant_from_serialized(gchar *participant, c
gint tok = 0; gint tok = 0;
DEBUG("------------------------------- process_conference_participant_from_serialized"); DEBUG("Conference: Process participant from serialized form");
ptr = g_strsplit(participant, delim, 2); ptr = g_strsplit(participant, delim, 2);
while(ptr != NULL && (tok < 2)) { while(ptr != NULL && (tok < 2)) {
...@@ -318,9 +320,7 @@ static void process_conference_participant_from_serialized(gchar *participant, c ...@@ -318,9 +320,7 @@ static void process_conference_participant_from_serialized(gchar *participant, c
gchar *account = NULL; gchar *account = NULL;
token = 0; token = 0;
numberaccount = *ptr; numberaccount = *ptr;
DEBUG("HERE IS THE PROBLEM");
numberptr = g_strsplit(numberaccount, delimnumber, 2); numberptr = g_strsplit(numberaccount, delimnumber, 2);
DEBUG("problem !!!");
while(numberptr != NULL && (token < 2)) { while(numberptr != NULL && (token < 2)) {
switch(token) { switch(token) {
case 0: case 0:
...@@ -328,6 +328,11 @@ static void process_conference_participant_from_serialized(gchar *participant, c ...@@ -328,6 +328,11 @@ static void process_conference_participant_from_serialized(gchar *participant, c
break; break;
case 1: case 1:
account = *numberptr; account = *numberptr;
int len = strlen(account);
if(g_str_has_suffix(account, ";")) {
gchar *tmpchar = g_strdup(account);
g_strlcpy(account, tmpchar, len);
}
break; break;
default: default:
break; break;
...@@ -346,9 +351,7 @@ static void process_conference_participant_from_serialized(gchar *participant, c ...@@ -346,9 +351,7 @@ static void process_conference_participant_from_serialized(gchar *participant, c
calllist_add_history_call(tmp_call); calllist_add_history_call(tmp_call);
calllist_add_call(current_calls, tmp_call); calllist_add_call(current_calls, tmp_call);
DEBUG("BEFORE %s", call_id);
conference_add_participant(call_id, conf); conference_add_participant(call_id, conf);
DEBUG("AFTER");
ptr++; ptr++;
} }
......
...@@ -1337,6 +1337,8 @@ void ManagerImpl::createConfFromParticipantList(const std::vector< std::string > ...@@ -1337,6 +1337,8 @@ void ManagerImpl::createConfFromParticipantList(const std::vector< std::string >
// Manager methods may behave differently if the call id particip to a conference // Manager methods may behave differently if the call id particip to a conference
conf->add(generatedCallID); conf->add(generatedCallID);
switchCall("");
// Create call // Create call
callSuccess = outgoingCall(account, generatedCallID, tostr, conf->getConfID()); callSuccess = outgoingCall(account, generatedCallID, tostr, conf->getConfID());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment