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

Function tm_replicate_broadcast

modules/tm/cluster.c:429–457  ·  view source on GitHub ↗

* Replicates a request message to all the member of the cluster * hoping that one of them will match the transaction and will act on it */

Source from the content-addressed store, hash-verified

427 * hoping that one of them will match the transaction and will act on it
428 */
429static int tm_replicate_broadcast(struct sip_msg *msg)
430{
431 int rc;
432
433 bin_packet_t *packet = tm_replicate_packet(msg, TM_CLUSTER_REQUEST);
434 if (!packet)
435 return -1;
436
437 rc = cluster_api.send_all(packet, tm_repl_cluster);
438 switch (rc) {
439 case CLUSTERER_CURR_DISABLED:
440 LM_INFO("Current node is disabled in cluster: %d\n",
441 tm_repl_cluster);
442 break;
443 case CLUSTERER_DEST_DOWN:
444 LM_INFO("All nodes are disabled in cluster: %d\n",
445 tm_repl_cluster);
446 break;
447 case CLUSTERER_SEND_ERR:
448 LM_ERR("Error sending message to cluster: %d\n",
449 tm_repl_cluster);
450 break;
451 case CLUSTERER_SEND_SUCCESS:
452 if_update_stat(tm_enable_stats, tm_cluster_request_tx , 1);
453 break;
454 }
455 bin_free_packet(packet);
456 return 0;
457}
458
459/**
460 * Retrieves the cluster_id of a message, if present in via

Callers 1

tm_anycast_replicateFunction · 0.85

Calls 2

tm_replicate_packetFunction · 0.85
bin_free_packetFunction · 0.85

Tested by

no test coverage detected