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

Function receive_dlg_repl

modules/dialog/dlg_replication.c:1119–1185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1117#undef DLG_CLUSTER_SEND
1118
1119void receive_dlg_repl(bin_packet_t *pkt)
1120{
1121 int rc = 0;
1122
1123 short ver = get_bin_pkg_version(pkt);
1124
1125 switch (pkt->type) {
1126 case REPLICATION_DLG_CREATED:
1127 if (ver != DLG_BIN_V3)
1128 ensure_bin_version(pkt, BIN_VERSION);
1129
1130 dlg_event_is_replicated = 1;
1131 rc = dlg_replicated_create(pkt, NULL, NULL, NULL, 0, 0, 0);
1132 if_update_stat(dlg_enable_stats, create_recv, 1);
1133 break;
1134 case REPLICATION_DLG_UPDATED:
1135 if (ver != DLG_BIN_V3)
1136 ensure_bin_version(pkt, BIN_VERSION);
1137
1138 dlg_event_is_replicated = 1;
1139 rc = dlg_replicated_update(pkt);
1140 if_update_stat(dlg_enable_stats, update_recv, 1);
1141 break;
1142 case REPLICATION_DLG_DELETED:
1143 if (ver != DLG_BIN_V3)
1144 ensure_bin_version(pkt, BIN_VERSION);
1145
1146 dlg_event_is_replicated = 1;
1147 rc = dlg_replicated_delete(pkt);
1148 if_update_stat(dlg_enable_stats, delete_recv, 1);
1149 break;
1150 case REPLICATION_DLG_CSEQ:
1151 if (ver != DLG_BIN_V3)
1152 ensure_bin_version(pkt, BIN_VERSION);
1153
1154 dlg_event_is_replicated = 1;
1155 rc = dlg_replicated_cseq_updated(pkt);
1156 break;
1157 case REPLICATION_DLG_VALUE:
1158 ensure_bin_version(pkt, BIN_VERSION);
1159
1160 dlg_event_is_replicated = 1;
1161 rc = dlg_replicated_value(pkt);
1162 break;
1163 case SYNC_PACKET_TYPE:
1164 if (ver != DLG_BIN_V3)
1165 ensure_bin_version(pkt, BIN_VERSION);
1166
1167 dlg_event_is_replicated = 1;
1168 while (clusterer_api.sync_chunk_iter(pkt))
1169 if (dlg_replicated_create(pkt, NULL, NULL, NULL, 0, 0, 1) < 0) {
1170 LM_ERR("Failed to process sync packet\n");
1171 dlg_event_is_replicated = 0;
1172 return;
1173 }
1174 break;
1175 default:
1176 rc = -1;

Callers

nothing calls this directly

Calls 6

get_bin_pkg_versionFunction · 0.85
dlg_replicated_createFunction · 0.85
dlg_replicated_updateFunction · 0.85
dlg_replicated_deleteFunction · 0.85
dlg_replicated_valueFunction · 0.85

Tested by

no test coverage detected