MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / tm_reply_replicate

Function tm_reply_replicate

modules/tm/cluster.c:490–510  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

488 * 1: if the message was replicated
489 */
490int 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
512static int tm_existing_ack_trans(struct sip_msg *msg)
513{

Callers 1

t_checkFunction · 0.85

Calls 2

tm_get_cidFunction · 0.85
tm_replicate_replyFunction · 0.85

Tested by

no test coverage detected