~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to gnome/src/conference_obj.c

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-05-19 21:46:37 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120519214637-la8rbrford5kj6m3
Tags: 1.1.0-1
* New upstream release 
  - Fixes "FTBFS with libccrtp-dev/2.0.2 from experimental" (Closes: #663282)
* NEW Maintainer: Debian VoIP Team - Thanks Francois for your work.
  - (Closes: #665789: O: sflphone -- SIP and IAX2 compatible VoIP phone)
* Added Build-Depends: libdbus-c++-bin
* Add gcc47-fixes.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include <time.h>
32
32
 
33
33
#include "callable_obj.h"
 
34
#include "str_utils.h"
34
35
#include "dbus.h"
35
36
#include "sflphone_const.h"
36
37
#include "logger.h"
37
38
#include "calltab.h"
38
39
#include "calllist.h"
39
40
 
40
 
conference_obj_t *create_new_conference(conference_state_t state, const gchar* const confID)
 
41
conference_obj_t *
 
42
create_new_conference(conference_state_t state, const gchar* const confID)
41
43
{
42
44
    if (confID == NULL) {
43
 
        ERROR("Conference: Error: Conference ID is NULL while creating new conference");
 
45
        ERROR("Conference ID is NULL while creating new conference");
44
46
        return NULL;
45
47
    }
46
48
 
47
 
    DEBUG("Conference: Create new conference %s", confID);
 
49
    DEBUG("Create new conference %s", confID);
48
50
 
49
51
    // Allocate memory
50
52
    conference_obj_t *new_conf = g_new0(conference_obj_t, 1);
51
53
 
52
 
    if (!new_conf) {
53
 
        ERROR("Conference: Error: Could not allocate data ");
54
 
        return NULL;
55
 
    }
56
 
 
57
54
    // Set state field
58
55
    new_conf->_state = state;
59
56
 
80
77
 
81
78
    gchar *state_str = g_hash_table_lookup(details, "CONF_STATE");
82
79
 
83
 
    if (g_strcasecmp(state_str, "ACTIVE_ATTACHED") == 0)
 
80
    if (utf8_case_equal(state_str, "ACTIVE_ATTACHED"))
84
81
        new_conf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED;
85
 
    else if (g_strcasecmp(state_str, "ACTIVE_ATTACHED_REC") == 0)
 
82
    else if (utf8_case_equal(state_str, "ACTIVE_ATTACHED_REC"))
86
83
        new_conf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD;
87
 
    else if (g_strcasecmp(state_str, "ACTIVE_DETACHED") == 0)
 
84
    else if (utf8_case_equal(state_str, "ACTIVE_DETACHED"))
88
85
        new_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED;
89
 
    else if (g_strcasecmp(state_str, "ACTIVE_DETACHED_REC") == 0)
 
86
    else if (utf8_case_equal(state_str, "ACTIVE_DETACHED_REC"))
90
87
        new_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED_RECORD;
91
 
    else if (g_strcasecmp(state_str, "HOLD") == 0)
 
88
    else if (utf8_case_equal(state_str, "HOLD"))
92
89
        new_conf->_state = CONFERENCE_STATE_HOLD;
93
 
    else if (g_strcasecmp(state_str, "HOLD_REC") == 0)
 
90
    else if (utf8_case_equal(state_str, "HOLD_REC"))
94
91
        new_conf->_state = CONFERENCE_STATE_HOLD_RECORD;
95
92
 
96
93
    return new_conf;
113
110
    callable_obj_t *call = calllist_get_call(current_calls_tab, call_id);
114
111
 
115
112
    if (!call) {
116
 
        ERROR("Conference: Error: Could not find %s", call_id);
 
113
        ERROR("Could not find %s", call_id);
117
114
        return;
118
115
    }
119
116
 
123
120
 
124
121
void conference_add_participant(const gchar* call_id, conference_obj_t* conf)
125
122
{
126
 
    DEBUG("Conference: Conference %s, adding participant %s", conf->_confID, call_id);
 
123
    DEBUG("Conference %s, adding participant %s", conf->_confID, call_id);
127
124
 
128
125
    // store the new participant list after appending participant id
129
126
    conf->participant_list = g_slist_append(conf->participant_list, (gpointer) g_strdup(call_id));
141
138
 
142
139
void conference_participant_list_update(gchar** participants, conference_obj_t* conf)
143
140
{
144
 
    DEBUG("Conference: Participant list update");
145
 
 
146
141
    if (!conf) {
147
 
        ERROR("Conference: Error: Conference is NULL");
 
142
        ERROR("Conference is NULL");
148
143
        return;
149
144
    }
150
145
 
151
 
    for (gchar **part = participants; part && *part; ++part) {
152
 
        gchar *call_id = (gchar *) (*part);
153
 
        callable_obj_t *call = calllist_get_call(current_calls_tab, call_id);
154
 
 
155
 
        if (call->_confID != NULL) {
156
 
            g_free(call->_confID);
157
 
            call->_confID = NULL;
158
 
        }
159
 
    }
160
 
 
161
146
    if (conf->participant_list) {
162
147
        g_slist_free(conf->participant_list);
163
148
        conf->participant_list = NULL;
166
151
    for (gchar **part = participants; part && *part; ++part) {
167
152
        gchar *call_id = (gchar *) (*part);
168
153
        callable_obj_t *call = calllist_get_call(current_calls_tab, call_id);
169
 
        call->_confID = g_strdup(conf->_confID);
 
154
        if (!call) {
 
155
            restore_call(call_id);
 
156
            call = calllist_get_call(current_calls_tab, call_id);
 
157
        }
170
158
        conference_add_participant(call_id, conf);
171
159
    }
172
160
}