* Checks if a message should be replicated, and if it is, replicates it * Returns: * 0: if the message should not be replicated * 1: if the message was replicated */
| 488 | * 1: if the message was replicated |
| 489 | */ |
| 490 | int tm_reply_replicate(struct sip_msg *msg) |
| 491 | { |
| 492 | int cid; |
| 493 | if (!tm_cluster_enabled()) |
| 494 | return 0; |
| 495 | |
| 496 | /* double-check we have received the message on a anycast network */ |
| 497 | if (!is_anycast(msg->rcv.bind_address)) |
| 498 | return 0; |
| 499 | cid = tm_get_cid(msg); |
| 500 | /* if there was no parameter, or it was, but it was ours, handle it */ |
| 501 | if (cid < 0) |
| 502 | return 0; |
| 503 | if (cid == tm_node_id) { |
| 504 | LM_DBG("reply should be processed by us (%d)\n", cid); |
| 505 | return 0; |
| 506 | } |
| 507 | LM_DBG("reply should get to node %d\n", cid); |
| 508 | tm_replicate_reply(msg, cid); |
| 509 | return 1; |
| 510 | } |
| 511 | |
| 512 | static int tm_existing_ack_trans(struct sip_msg *msg) |
| 513 | { |
no test coverage detected