* Replicates a reply message to the owner of the transaction */
| 395 | * Replicates a reply message to the owner of the transaction |
| 396 | */ |
| 397 | static void tm_replicate_reply(struct sip_msg *msg, int cid) |
| 398 | { |
| 399 | int rc; |
| 400 | bin_packet_t *packet = tm_replicate_packet(msg, TM_CLUSTER_REPLY); |
| 401 | if (!packet) |
| 402 | return; |
| 403 | |
| 404 | rc = cluster_api.send_to(packet, tm_repl_cluster, cid); |
| 405 | switch (rc) { |
| 406 | case CLUSTERER_CURR_DISABLED: |
| 407 | LM_INFO("Current node is disabled in cluster: %d\n", |
| 408 | tm_repl_cluster); |
| 409 | break; |
| 410 | case CLUSTERER_DEST_DOWN: |
| 411 | LM_INFO("%d node is disabled in cluster: %d\n", cid, |
| 412 | tm_repl_cluster); |
| 413 | break; |
| 414 | case CLUSTERER_SEND_ERR: |
| 415 | LM_ERR("Error sending message to %d in cluster: %d\n", cid, |
| 416 | tm_repl_cluster); |
| 417 | break; |
| 418 | case CLUSTERER_SEND_SUCCESS: |
| 419 | if_update_stat(tm_enable_stats, tm_cluster_reply_tx , 1); |
| 420 | break; |
| 421 | } |
| 422 | bin_free_packet(packet); |
| 423 | } |
| 424 | |
| 425 | /** |
| 426 | * Replicates a request message to all the member of the cluster |
no test coverage detected