Changeset 10
- Timestamp:
- 08/11/07 21:55:23
(1 year ago)
- Author:
- sip
- Message:
Fixed conference destruction
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1 |
r10 |
|
| 193 | 193 | int MCU::DeleteConference(int id) |
|---|
| 194 | 194 | { |
|---|
| 195 | | Log("-DeleteConference [%d]\n",id); |
|---|
| 196 | | |
|---|
| 197 | | //Bloqueamos |
|---|
| 198 | | pthread_mutex_lock(&mutex); |
|---|
| 199 | | |
|---|
| 200 | | //SI no esta |
|---|
| 201 | | if (lstConf.find(id)==lstConf.end()) |
|---|
| | 195 | Log(">DeleteConference [%d]\n",id); |
|---|
| | 196 | |
|---|
| | 197 | //Bloqueamos |
|---|
| | 198 | pthread_mutex_lock(&mutex); |
|---|
| | 199 | |
|---|
| | 200 | //Find conference |
|---|
| | 201 | LstConference::iterator it = lstConf.find(id); |
|---|
| | 202 | |
|---|
| | 203 | //Check if we found it or not |
|---|
| | 204 | if (it==lstConf.end()) |
|---|
| 202 | 205 | { |
|---|
| 203 | 206 | //Desbloquamos el mutex |
|---|
| … | … | |
| 207 | 210 | return Error("Conferencia no encontrada [%d]\n",id); |
|---|
| 208 | 211 | } |
|---|
| 209 | | |
|---|
| 210 | | //La marcamos para borrar |
|---|
| 211 | | lstConf[id].enabled = false; |
|---|
| | 212 | |
|---|
| | 213 | //Get conference |
|---|
| | 214 | MultiConf *conf = it->second.conf; |
|---|
| | 215 | |
|---|
| | 216 | //Remove from list |
|---|
| | 217 | lstConf.erase(it); |
|---|
| 212 | 218 | |
|---|
| 213 | 219 | //Desbloquamos el mutex |
|---|
| 214 | 220 | pthread_mutex_unlock(&mutex); |
|---|
| 215 | 221 | |
|---|
| 216 | | //Y salimos |
|---|
| | 222 | //End it |
|---|
| | 223 | conf->End(); |
|---|
| | 224 | |
|---|
| | 225 | //Delete conference |
|---|
| | 226 | delete conf; |
|---|
| | 227 | |
|---|
| | 228 | Log("<DeleteConference [%d]\n",id); |
|---|
| | 229 | |
|---|
| | 230 | //Exit |
|---|
| 217 | 231 | return true; |
|---|
| 218 | 232 | } |
|---|
| r6 |
r10 |
|
| 137 | 137 | Participant *part = (*it).second; |
|---|
| 138 | 138 | |
|---|
| | 139 | //Y lo quitamos del mapa |
|---|
| | 140 | lstParticipants.erase(it); |
|---|
| | 141 | |
|---|
| 139 | 142 | //Terminamos el audio y el video |
|---|
| 140 | 143 | part->video.End(); |
|---|
| … | … | |
| 147 | 150 | //Lo borramos |
|---|
| 148 | 151 | delete part; |
|---|
| 149 | | |
|---|
| 150 | | //Y lo quitamos del mapa |
|---|
| 151 | | lstParticipants.erase(it); |
|---|
| 152 | 152 | |
|---|
| 153 | 153 | return 1; |
|---|
| r8 |
r10 |
|
| 95 | 95 | if(env->fault_occurred) |
|---|
| 96 | 96 | return 0; |
|---|
| 97 | | |
|---|
| 98 | | //Obtenemos la referencia |
|---|
| 99 | | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| 100 | | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| 101 | | |
|---|
| 102 | | //La borramos |
|---|
| 103 | | int res = conf->End(); |
|---|
| 104 | | |
|---|
| 105 | | //Liberamos la referencia |
|---|
| 106 | | mcu->ReleaseConferenceRef(confId); |
|---|
| 107 | | |
|---|
| 108 | | //Salimos |
|---|
| 109 | | if(!res) |
|---|
| 110 | | return xmlerror(env,"No se ha podido terminar la conferencia\n"); |
|---|
| | 97 | |
|---|
| | 98 | //Delete conference |
|---|
| | 99 | if (!mcu->DeleteConference(confId)) |
|---|
| | 100 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| 111 | 101 | |
|---|
| 112 | 102 | //Devolvemos el resultado |
|---|
Download in other formats:
|
|