| 4 | | McuCmd mcuCmdList[] = |
|---|
| | 4 | //CreateConference |
|---|
| | 5 | xmlrpc_value* CreateConference(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 6 | { |
|---|
| | 7 | MCU *mcu = (MCU *)user_data; |
|---|
| | 8 | MultiConf *conf = NULL; |
|---|
| | 9 | |
|---|
| | 10 | //Parseamos |
|---|
| | 11 | char *str; |
|---|
| | 12 | xmlrpc_parse_value(env, param_array, "(s)", &str); |
|---|
| | 13 | |
|---|
| | 14 | //Creamos la conferencia |
|---|
| | 15 | int confId = mcu->CreateConference(str); |
|---|
| | 16 | |
|---|
| | 17 | //Si error |
|---|
| | 18 | if (!confId>0) |
|---|
| | 19 | return xmlerror(env,"No se puede crear la conferencia"); |
|---|
| | 20 | |
|---|
| | 21 | //Obtenemos la referencia |
|---|
| | 22 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 23 | return xmlerror(env,"Conferencia borrada antes de poder iniciarse\n"); |
|---|
| | 24 | |
|---|
| | 25 | //La iniciamos |
|---|
| | 26 | int res = conf->Init(); |
|---|
| | 27 | |
|---|
| | 28 | //Liberamos la referencia |
|---|
| | 29 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 30 | |
|---|
| | 31 | //Salimos |
|---|
| | 32 | if(!res) |
|---|
| | 33 | return xmlerror(env,"No se ha podido iniciar la conferencia\n"); |
|---|
| | 34 | |
|---|
| | 35 | //Devolvemos el resultado |
|---|
| | 36 | return xmlok(env,xmlrpc_build_value(env,"(i)",confId)); |
|---|
| | 37 | } |
|---|
| | 38 | |
|---|
| | 39 | xmlrpc_value* DeleteConference(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 40 | { |
|---|
| | 41 | MCU *mcu = (MCU *)user_data; |
|---|
| | 42 | MultiConf *conf = NULL; |
|---|
| | 43 | |
|---|
| | 44 | //Parseamos |
|---|
| | 45 | int confId; |
|---|
| | 46 | xmlrpc_parse_value(env, param_array, "(i)", &confId); |
|---|
| | 47 | |
|---|
| | 48 | //Comprobamos si ha habido error |
|---|
| | 49 | if(env->fault_occurred) |
|---|
| | 50 | return 0; |
|---|
| | 51 | |
|---|
| | 52 | //Delete conference |
|---|
| | 53 | if (!mcu->DeleteConference(confId)) |
|---|
| | 54 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 55 | |
|---|
| | 56 | //Devolvemos el resultado |
|---|
| | 57 | return xmlok(env); |
|---|
| | 58 | } |
|---|
| | 59 | |
|---|
| | 60 | xmlrpc_value* CreateParticipant(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 61 | { |
|---|
| | 62 | MCU *mcu = (MCU *)user_data; |
|---|
| | 63 | MultiConf *conf = NULL; |
|---|
| | 64 | |
|---|
| | 65 | //Parseamos |
|---|
| | 66 | int confId; |
|---|
| | 67 | xmlrpc_parse_value(env, param_array, "(i)", &confId); |
|---|
| | 68 | |
|---|
| | 69 | //Comprobamos si ha habido error |
|---|
| | 70 | if(env->fault_occurred) |
|---|
| | 71 | return 0; |
|---|
| | 72 | |
|---|
| | 73 | //Obtenemos la referencia |
|---|
| | 74 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 75 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 76 | |
|---|
| | 77 | //La borramos |
|---|
| | 78 | int partId = conf->CreateParticipant(); |
|---|
| | 79 | |
|---|
| | 80 | //Liberamos la referencia |
|---|
| | 81 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 82 | |
|---|
| | 83 | //Salimos |
|---|
| | 84 | if(!partId) |
|---|
| | 85 | return xmlerror(env,"No se ha podido añadir el participante a la conferencia\n"); |
|---|
| | 86 | |
|---|
| | 87 | //Devolvemos el resultado |
|---|
| | 88 | return xmlok(env,xmlrpc_build_value(env,"(i)",partId)); |
|---|
| | 89 | } |
|---|
| | 90 | |
|---|
| | 91 | xmlrpc_value* DeleteParticipant(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 92 | { |
|---|
| | 93 | MCU *mcu = (MCU *)user_data; |
|---|
| | 94 | MultiConf *conf = NULL; |
|---|
| | 95 | |
|---|
| | 96 | //Parseamos |
|---|
| | 97 | int confId; |
|---|
| | 98 | int partId; |
|---|
| | 99 | xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId); |
|---|
| | 100 | |
|---|
| | 101 | //Comprobamos si ha habido error |
|---|
| | 102 | if(env->fault_occurred) |
|---|
| | 103 | return 0; |
|---|
| | 104 | |
|---|
| | 105 | //Obtenemos la referencia |
|---|
| | 106 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 107 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 108 | |
|---|
| | 109 | //La borramos |
|---|
| | 110 | int res = conf->DeleteParticipant(partId); |
|---|
| | 111 | |
|---|
| | 112 | //Liberamos la referencia |
|---|
| | 113 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 114 | |
|---|
| | 115 | //Salimos |
|---|
| | 116 | if(!res) |
|---|
| | 117 | return xmlerror(env,"No se ha podido añadir el participante a la conferencia\n"); |
|---|
| | 118 | |
|---|
| | 119 | //Devolvemos el resultado |
|---|
| | 120 | return xmlok(env); |
|---|
| | 121 | } |
|---|
| | 122 | |
|---|
| | 123 | xmlrpc_value* SetVideoCodec(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 124 | { |
|---|
| | 125 | MCU *mcu = (MCU *)user_data; |
|---|
| | 126 | MultiConf *conf = NULL; |
|---|
| | 127 | |
|---|
| | 128 | //Parseamos |
|---|
| | 129 | int confId; |
|---|
| | 130 | int partId; |
|---|
| | 131 | int codec; |
|---|
| | 132 | int mode; |
|---|
| | 133 | int fps; |
|---|
| | 134 | int bitrate; |
|---|
| | 135 | int quality; |
|---|
| | 136 | int fillLevel; |
|---|
| | 137 | |
|---|
| | 138 | xmlrpc_parse_value(env, param_array, "(iiiiiiii)", &confId,&partId,&codec,&mode,&fps,&bitrate,&quality,&fillLevel); |
|---|
| | 139 | |
|---|
| | 140 | //Comprobamos si ha habido error |
|---|
| | 141 | if(env->fault_occurred) |
|---|
| | 142 | return 0; |
|---|
| | 143 | |
|---|
| | 144 | //Obtenemos la referencia |
|---|
| | 145 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 146 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 147 | |
|---|
| | 148 | //La borramos |
|---|
| | 149 | int res = conf->SetVideoCodec(partId,codec,mode,fps,bitrate,quality,fillLevel); |
|---|
| | 150 | |
|---|
| | 151 | //Liberamos la referencia |
|---|
| | 152 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 153 | |
|---|
| | 154 | //Salimos |
|---|
| | 155 | if(!res) |
|---|
| | 156 | return xmlerror(env,"No soportado\n"); |
|---|
| | 157 | |
|---|
| | 158 | //Devolvemos el resultado |
|---|
| | 159 | return xmlok(env); |
|---|
| | 160 | } |
|---|
| | 161 | |
|---|
| | 162 | xmlrpc_value* StartSendingVideo(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 163 | { |
|---|
| | 164 | MCU *mcu = (MCU *)user_data; |
|---|
| | 165 | MultiConf *conf = NULL; |
|---|
| | 166 | |
|---|
| | 167 | //Parseamos |
|---|
| | 168 | int confId; |
|---|
| | 169 | int partId; |
|---|
| | 170 | char *sendVideoIp; |
|---|
| | 171 | int sendVideoPort; |
|---|
| | 172 | xmlrpc_parse_value(env, param_array, "(iisi)", &confId,&partId,&sendVideoIp,&sendVideoPort); |
|---|
| | 173 | |
|---|
| | 174 | //Comprobamos si ha habido error |
|---|
| | 175 | if(env->fault_occurred) |
|---|
| | 176 | return 0; |
|---|
| | 177 | |
|---|
| | 178 | //Obtenemos la referencia |
|---|
| | 179 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 180 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 181 | |
|---|
| | 182 | //La borramos |
|---|
| | 183 | int res = conf->StartSendingVideo(partId,sendVideoIp,sendVideoPort); |
|---|
| | 184 | |
|---|
| | 185 | //Liberamos la referencia |
|---|
| | 186 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 187 | |
|---|
| | 188 | //Salimos |
|---|
| | 189 | if(!res) |
|---|
| | 190 | return xmlerror(env,"Error\n"); |
|---|
| | 191 | |
|---|
| | 192 | //Devolvemos el resultado |
|---|
| | 193 | return xmlok(env); |
|---|
| | 194 | } |
|---|
| | 195 | |
|---|
| | 196 | xmlrpc_value* StopSendingVideo(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 197 | { |
|---|
| | 198 | MCU *mcu = (MCU *)user_data; |
|---|
| | 199 | MultiConf *conf = NULL; |
|---|
| | 200 | |
|---|
| | 201 | //Parseamos |
|---|
| | 202 | int confId; |
|---|
| | 203 | int partId; |
|---|
| | 204 | xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId); |
|---|
| | 205 | |
|---|
| | 206 | //Comprobamos si ha habido error |
|---|
| | 207 | if(env->fault_occurred) |
|---|
| | 208 | return 0; |
|---|
| | 209 | |
|---|
| | 210 | //Obtenemos la referencia |
|---|
| | 211 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 212 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 213 | |
|---|
| | 214 | //La borramos |
|---|
| | 215 | int res = conf->StopSendingVideo(partId); |
|---|
| | 216 | |
|---|
| | 217 | //Liberamos la referencia |
|---|
| | 218 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 219 | |
|---|
| | 220 | //Salimos |
|---|
| | 221 | if(!res) |
|---|
| | 222 | return xmlerror(env,"No se ha podido terminar la conferencia\n"); |
|---|
| | 223 | |
|---|
| | 224 | //Devolvemos el resultado |
|---|
| | 225 | return xmlok(env); |
|---|
| | 226 | } |
|---|
| | 227 | |
|---|
| | 228 | xmlrpc_value* StartReceivingVideo(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 229 | { |
|---|
| | 230 | MCU *mcu = (MCU *)user_data; |
|---|
| | 231 | MultiConf *conf = NULL; |
|---|
| | 232 | |
|---|
| | 233 | //Parseamos |
|---|
| | 234 | int confId; |
|---|
| | 235 | int partId; |
|---|
| | 236 | xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId); |
|---|
| | 237 | |
|---|
| | 238 | //Comprobamos si ha habido error |
|---|
| | 239 | if(env->fault_occurred) |
|---|
| | 240 | return 0; |
|---|
| | 241 | |
|---|
| | 242 | //Obtenemos la referencia |
|---|
| | 243 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 244 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 245 | |
|---|
| | 246 | //La borramos |
|---|
| | 247 | int recVideoPort = conf->StartReceivingVideo(partId); |
|---|
| | 248 | |
|---|
| | 249 | //Liberamos la referencia |
|---|
| | 250 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 251 | |
|---|
| | 252 | //Salimos |
|---|
| | 253 | if(!recVideoPort) |
|---|
| | 254 | return xmlerror(env,"No se ha podido terminar la conferencia\n"); |
|---|
| | 255 | |
|---|
| | 256 | //Devolvemos el resultado |
|---|
| | 257 | return xmlok(env,xmlrpc_build_value(env,"(i)",recVideoPort)); |
|---|
| | 258 | } |
|---|
| | 259 | |
|---|
| | 260 | xmlrpc_value* StopReceivingVideo(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 261 | { |
|---|
| | 262 | MCU *mcu = (MCU *)user_data; |
|---|
| | 263 | MultiConf *conf = NULL; |
|---|
| | 264 | |
|---|
| | 265 | //Parseamos |
|---|
| | 266 | int confId; |
|---|
| | 267 | int partId; |
|---|
| | 268 | xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId); |
|---|
| | 269 | |
|---|
| | 270 | //Comprobamos si ha habido error |
|---|
| | 271 | if(env->fault_occurred) |
|---|
| | 272 | return 0; |
|---|
| | 273 | |
|---|
| | 274 | //Obtenemos la referencia |
|---|
| | 275 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 276 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 277 | |
|---|
| | 278 | //La borramos |
|---|
| | 279 | int res = conf->StopReceivingVideo(partId); |
|---|
| | 280 | |
|---|
| | 281 | //Liberamos la referencia |
|---|
| | 282 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 283 | |
|---|
| | 284 | //Salimos |
|---|
| | 285 | if(!res) |
|---|
| | 286 | return xmlerror(env,"Error\n"); |
|---|
| | 287 | |
|---|
| | 288 | //Devolvemos el resultado |
|---|
| | 289 | return xmlok(env); |
|---|
| | 290 | } |
|---|
| | 291 | |
|---|
| | 292 | xmlrpc_value* IsSendingVideo(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 293 | { |
|---|
| | 294 | MCU *mcu = (MCU *)user_data; |
|---|
| | 295 | MultiConf *conf = NULL; |
|---|
| | 296 | |
|---|
| | 297 | //Parseamos |
|---|
| | 298 | int partId; |
|---|
| | 299 | int confId; |
|---|
| | 300 | xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId); |
|---|
| | 301 | |
|---|
| | 302 | //Comprobamos si ha habido error |
|---|
| | 303 | if(env->fault_occurred) |
|---|
| | 304 | return 0; |
|---|
| | 305 | |
|---|
| | 306 | //Obtenemos la referencia |
|---|
| | 307 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 308 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 309 | |
|---|
| | 310 | //La borramos |
|---|
| | 311 | int res = conf->IsSendingVideo(partId); |
|---|
| | 312 | |
|---|
| | 313 | //Liberamos la referencia |
|---|
| | 314 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 315 | |
|---|
| | 316 | //Devolvemos el resultado |
|---|
| | 317 | return xmlok(env,xmlrpc_build_value(env,"(i)",res)); |
|---|
| | 318 | } |
|---|
| | 319 | |
|---|
| | 320 | xmlrpc_value* IsReceivingVideo(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 321 | { |
|---|
| | 322 | MCU *mcu = (MCU *)user_data; |
|---|
| | 323 | MultiConf *conf = NULL; |
|---|
| | 324 | |
|---|
| | 325 | //Parseamos |
|---|
| | 326 | int confId; |
|---|
| | 327 | int partId; |
|---|
| | 328 | xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId); |
|---|
| | 329 | |
|---|
| | 330 | //Comprobamos si ha habido error |
|---|
| | 331 | if(env->fault_occurred) |
|---|
| | 332 | return 0; |
|---|
| | 333 | |
|---|
| | 334 | //Obtenemos la referencia |
|---|
| | 335 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 336 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 337 | |
|---|
| | 338 | //La borramos |
|---|
| | 339 | int res = conf->IsReceivingVideo(partId); |
|---|
| | 340 | |
|---|
| | 341 | //Liberamos la referencia |
|---|
| | 342 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 343 | |
|---|
| | 344 | //Devolvemos el resultado |
|---|
| | 345 | return xmlok(env,xmlrpc_build_value(env,"(i)",res)); |
|---|
| | 346 | } |
|---|
| | 347 | |
|---|
| | 348 | xmlrpc_value* SetAudioCodec(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 349 | { |
|---|
| | 350 | MCU *mcu = (MCU *)user_data; |
|---|
| | 351 | MultiConf *conf = NULL; |
|---|
| | 352 | |
|---|
| | 353 | //Parseamos |
|---|
| | 354 | int confId; |
|---|
| | 355 | int partId; |
|---|
| | 356 | int codec; |
|---|
| | 357 | |
|---|
| | 358 | xmlrpc_parse_value(env, param_array, "(iii)", &confId,&partId,&codec); |
|---|
| | 359 | |
|---|
| | 360 | //Comprobamos si ha habido error |
|---|
| | 361 | if(env->fault_occurred) |
|---|
| | 362 | return 0; |
|---|
| | 363 | |
|---|
| | 364 | //Obtenemos la referencia |
|---|
| | 365 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 366 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 367 | |
|---|
| | 368 | //La borramos |
|---|
| | 369 | int res = conf->SetAudioCodec(partId,codec); |
|---|
| | 370 | |
|---|
| | 371 | //Liberamos la referencia |
|---|
| | 372 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 373 | |
|---|
| | 374 | //Salimos |
|---|
| | 375 | if(!res) |
|---|
| | 376 | return xmlerror(env,"No soportado\n"); |
|---|
| | 377 | |
|---|
| | 378 | //Devolvemos el resultado |
|---|
| | 379 | return xmlok(env); |
|---|
| | 380 | } |
|---|
| | 381 | |
|---|
| | 382 | xmlrpc_value* StartSendingAudio(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 383 | { |
|---|
| | 384 | MCU *mcu = (MCU *)user_data; |
|---|
| | 385 | MultiConf *conf = NULL; |
|---|
| | 386 | |
|---|
| | 387 | //Parseamos |
|---|
| | 388 | int confId; |
|---|
| | 389 | int partId; |
|---|
| | 390 | char *sendAudioIp; |
|---|
| | 391 | int sendAudioPort; |
|---|
| | 392 | |
|---|
| | 393 | xmlrpc_parse_value(env, param_array, "(iisi)", &confId,&partId,&sendAudioIp,&sendAudioPort); |
|---|
| | 394 | |
|---|
| | 395 | //Comprobamos si ha habido error |
|---|
| | 396 | if(env->fault_occurred) |
|---|
| | 397 | return 0; |
|---|
| | 398 | |
|---|
| | 399 | //Obtenemos la referencia |
|---|
| | 400 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 401 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 402 | |
|---|
| | 403 | //La borramos |
|---|
| | 404 | int res = conf->StartSendingAudio(partId,sendAudioIp,sendAudioPort); |
|---|
| | 405 | |
|---|
| | 406 | //Liberamos la referencia |
|---|
| | 407 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 408 | |
|---|
| | 409 | //Salimos |
|---|
| | 410 | if(!res) |
|---|
| | 411 | return xmlerror(env,"Error\n"); |
|---|
| | 412 | |
|---|
| | 413 | //Devolvemos el resultado |
|---|
| | 414 | return xmlok(env); |
|---|
| | 415 | } |
|---|
| | 416 | |
|---|
| | 417 | xmlrpc_value* StopSendingAudio(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 418 | { |
|---|
| | 419 | MCU *mcu = (MCU *)user_data; |
|---|
| | 420 | MultiConf *conf = NULL; |
|---|
| | 421 | |
|---|
| | 422 | //Parseamos |
|---|
| | 423 | int confId; |
|---|
| | 424 | int partId; |
|---|
| | 425 | xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId); |
|---|
| | 426 | |
|---|
| | 427 | //Comprobamos si ha habido error |
|---|
| | 428 | if(env->fault_occurred) |
|---|
| | 429 | return 0; |
|---|
| | 430 | |
|---|
| | 431 | //Obtenemos la referencia |
|---|
| | 432 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 433 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 434 | |
|---|
| | 435 | //La borramos |
|---|
| | 436 | int res = conf->StopSendingAudio(partId); |
|---|
| | 437 | |
|---|
| | 438 | //Liberamos la referencia |
|---|
| | 439 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 440 | |
|---|
| | 441 | //Salimos |
|---|
| | 442 | if(!res) |
|---|
| | 443 | return xmlerror(env,"No se ha podido terminar la conferencia\n"); |
|---|
| | 444 | |
|---|
| | 445 | //Devolvemos el resultado |
|---|
| | 446 | return xmlok(env); |
|---|
| | 447 | } |
|---|
| | 448 | |
|---|
| | 449 | xmlrpc_value* StartReceivingAudio(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 450 | { |
|---|
| | 451 | MCU *mcu = (MCU *)user_data; |
|---|
| | 452 | MultiConf *conf = NULL; |
|---|
| | 453 | |
|---|
| | 454 | //Parseamos |
|---|
| | 455 | int confId; |
|---|
| | 456 | int partId; |
|---|
| | 457 | xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId); |
|---|
| | 458 | |
|---|
| | 459 | //Comprobamos si ha habido error |
|---|
| | 460 | if(env->fault_occurred) |
|---|
| | 461 | return 0; |
|---|
| | 462 | |
|---|
| | 463 | //Obtenemos la referencia |
|---|
| | 464 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 465 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 466 | |
|---|
| | 467 | //La borramos |
|---|
| | 468 | int recAudioPort = conf->StartReceivingAudio(partId); |
|---|
| | 469 | |
|---|
| | 470 | //Liberamos la referencia |
|---|
| | 471 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 472 | |
|---|
| | 473 | //Salimos |
|---|
| | 474 | if(!recAudioPort) |
|---|
| | 475 | return xmlerror(env,"No se ha podido terminar la conferencia\n"); |
|---|
| | 476 | |
|---|
| | 477 | //Devolvemos el resultado |
|---|
| | 478 | return xmlok(env,xmlrpc_build_value(env,"(i)",recAudioPort,recAudioPort)); |
|---|
| | 479 | } |
|---|
| | 480 | |
|---|
| | 481 | xmlrpc_value* StopReceivingAudio(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 482 | { |
|---|
| | 483 | MCU *mcu = (MCU *)user_data; |
|---|
| | 484 | MultiConf *conf = NULL; |
|---|
| | 485 | |
|---|
| | 486 | //Parseamos |
|---|
| | 487 | int confId; |
|---|
| | 488 | int partId; |
|---|
| | 489 | xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId); |
|---|
| | 490 | |
|---|
| | 491 | //Comprobamos si ha habido error |
|---|
| | 492 | if(env->fault_occurred) |
|---|
| | 493 | return 0; |
|---|
| | 494 | |
|---|
| | 495 | //Obtenemos la referencia |
|---|
| | 496 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 497 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 498 | |
|---|
| | 499 | //La borramos |
|---|
| | 500 | int res = conf->StopReceivingAudio(partId); |
|---|
| | 501 | |
|---|
| | 502 | //Liberamos la referencia |
|---|
| | 503 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 504 | |
|---|
| | 505 | //Salimos |
|---|
| | 506 | if(!res) |
|---|
| | 507 | return xmlerror(env,"Error\n"); |
|---|
| | 508 | |
|---|
| | 509 | //Devolvemos el resultado |
|---|
| | 510 | return xmlok(env); |
|---|
| | 511 | } |
|---|
| | 512 | |
|---|
| | 513 | xmlrpc_value* IsSendingAudio(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 514 | { |
|---|
| | 515 | MCU *mcu = (MCU *)user_data; |
|---|
| | 516 | MultiConf *conf = NULL; |
|---|
| | 517 | |
|---|
| | 518 | //Parseamos |
|---|
| | 519 | int partId; |
|---|
| | 520 | int confId; |
|---|
| | 521 | xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId); |
|---|
| | 522 | |
|---|
| | 523 | //Comprobamos si ha habido error |
|---|
| | 524 | if(env->fault_occurred) |
|---|
| | 525 | return 0; |
|---|
| | 526 | |
|---|
| | 527 | //Obtenemos la referencia |
|---|
| | 528 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 529 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 530 | |
|---|
| | 531 | //La borramos |
|---|
| | 532 | int res = conf->IsSendingAudio(partId); |
|---|
| | 533 | |
|---|
| | 534 | //Liberamos la referencia |
|---|
| | 535 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 536 | |
|---|
| | 537 | //Devolvemos el resultado |
|---|
| | 538 | return xmlok(env,xmlrpc_build_value(env,"(i)",res)); |
|---|
| | 539 | } |
|---|
| | 540 | |
|---|
| | 541 | xmlrpc_value* IsReceivingAudio(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 542 | { |
|---|
| | 543 | MCU *mcu = (MCU *)user_data; |
|---|
| | 544 | MultiConf *conf = NULL; |
|---|
| | 545 | |
|---|
| | 546 | //Parseamos |
|---|
| | 547 | int confId; |
|---|
| | 548 | int partId; |
|---|
| | 549 | xmlrpc_parse_value(env, param_array, "(ii)", &confId,&partId); |
|---|
| | 550 | |
|---|
| | 551 | //Comprobamos si ha habido error |
|---|
| | 552 | if(env->fault_occurred) |
|---|
| | 553 | return 0; |
|---|
| | 554 | |
|---|
| | 555 | //Obtenemos la referencia |
|---|
| | 556 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 557 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 558 | |
|---|
| | 559 | //La borramos |
|---|
| | 560 | int res = conf->IsReceivingAudio(partId); |
|---|
| | 561 | |
|---|
| | 562 | //Liberamos la referencia |
|---|
| | 563 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 564 | |
|---|
| | 565 | //Devolvemos el resultado |
|---|
| | 566 | return xmlok(env,xmlrpc_build_value(env,"(i)",res)); |
|---|
| | 567 | } |
|---|
| | 568 | |
|---|
| | 569 | xmlrpc_value* SetCompositionType(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) |
|---|
| | 570 | { |
|---|
| | 571 | MCU *mcu = (MCU *)user_data; |
|---|
| | 572 | MultiConf *conf = NULL; |
|---|
| | 573 | |
|---|
| | 574 | //Parseamos |
|---|
| | 575 | int confId; |
|---|
| | 576 | int comp; |
|---|
| | 577 | int size; |
|---|
| | 578 | xmlrpc_parse_value(env, param_array, "(iii)", &confId,&comp,&size); |
|---|
| | 579 | |
|---|
| | 580 | //Comprobamos si ha habido error |
|---|
| | 581 | if(env->fault_occurred) |
|---|
| | 582 | return 0; |
|---|
| | 583 | |
|---|
| | 584 | //Obtenemos la referencia |
|---|
| | 585 | if(!mcu->GetConferenceRef(confId,&conf)) |
|---|
| | 586 | return xmlerror(env,"La conferencia no existe\n"); |
|---|
| | 587 | |
|---|
| | 588 | //La borramos |
|---|
| | 589 | int res = conf->SetCompositionType(comp,size); |
|---|
| | 590 | |
|---|
| | 591 | //Liberamos la referencia |
|---|
| | 592 | mcu->ReleaseConferenceRef(confId); |
|---|
| | 593 | |
|---|
| | 594 | //Salimos |
|---|
| | 595 | if(!res) |
|---|
| | 596 | return xmlerror(env,"Error\n"); |
|---|
| | 597 | |
|---|
| | 598 | //Devolvemos el resultado |
|---|
| | 599 | return xmlok(env); |
|---|
| | 600 | } |
|---|
| | 601 | |
|---|
| | 602 | XmlHandlerCmd mcuCmdList[] = |
|---|