[OpenSIPS-Users] crash after failover
microx
acmicrox at gmail.com
Wed Jul 10 14:55:27 CEST 2013
Hi Vlad,
For failover, I came up with another mechanism as follows. Say that two
proxy servers A and B are both running. Then, proxy server A fails to run
suddenly. When proxy server B receives those BYEs of dialogs whose original
INVITEs processed by proxy server, proxy server B calls lookup("location",
"m", "$tu") to find the locations of the destinations of BYEs and insert Via
header fields. With this mechanism, I don't need to load dialogs from DB
into memory.
However, for the original mechanism, I find the new error message attached
to the end. Please also refer to the code of dealing with failover and the
DB record. Many thanks for your kind help.
Best regards,
Chen-Che
1.
if (is_method("ACK|BYE|INVITE|UPDATE|INFO")) {
if (match_dialog()) {
if (is_method("BYE")) {
set_rtp_proxy_set("$avp(thisRTPProxy)");
unforce_rtp_proxy();
}
}
else {
xlog("match_dialog fails (check R-URI: $ru)");
if (is_method("BYE")) {
avp_db_query("select caller_sock from dialog where
callid='$ci'", "$avp(socket)");
xlog("Query caller_socket from DB: $avp(socket)\n");
if (is_avp_set("$avp(socket)") && ($avp(socket) !=
"udp:10.100.13.13:5060")) {
if ($stat(dlgSync) == 0) {
update_stat("dlgSync", "+1");
xlog("Dialog synchronization start");
*avp_db_query("update dialog set
caller_sock='udp:127.0.0.1:5060', callee_sock='udp:127.0.0.1:5060' where
caller_sock='udp:10.100.13.12:5060'");*
*exec_msg("/usr/local/sbin/opensipsctl fifo
dlg_db_sync");*
xlog("Dialog synchronization done");
reset_stat("dlgSync");
}
}
}
}
2. DB record
dlg_id | callid | from_uri |
from_tag | to_uri | to_tag |
mangled_from_uri | mangled_to_uri | caller_cseq | callee_cseq |
caller_ping_cseq | callee_ping_cseq | caller_route_set | callee_route_set |
caller_contact | callee_contact |
caller_sock | callee_sock | state | start_time | timeout |
vars | profiles | script_flags | flags
---------------+-------------------------+----------------------------+--------------------------+----------------------------+--------------------------+------------------+----------------+-------------+-------------+------------------+------------------+------------------+------------------+----------------------------------+-------------------------------------------+-----------------------+-----------------------+-------+------------+------------+--------------------------------+----------+--------------+-------
8943142124310 | 2914-21412 at 192.168.8.70 | sip:2000011653 at thcloud.com |
21412SIPpTag00Caller2914 | sip:2000011654 at thcloud.com |
29936SIPpTag01Callee2915 | | | 0 |
1 | 0 | 0 | |
| sip:2000011653 at 192.168.8.70:5060 |
sip:10005 at 192.168.8.28:6050;transport=UDP | udp:10.100.13.13:5060 |
udp:10.100.13.13:5060 | 4 | 1373444756 | 1374049557 |
accX_table#acc|accX_flags#\x03 | | 0 | 144
(1 row)
3. error message
/usr/sbin/opensips[28853]: ERROR:db_postgres:db_postgres_submit_query:
0x7f3b53bc5bc8 PQsendQuery Error: ERROR: null value in column "caller_cseq"
violates not-null constraint#012DETAIL: Failing row contains
(7941606572433, 12293-13701 at 192.168.8.70, sip:2000049169 at thcloud.com,
13701SIPpTag00Caller12293, sip:2000049170 at thcloud.com,
1916SIPpTag01Callee11806, null, null, null, null, 0, 0, null, null,
sip:2000049169 at 192.168.8.70:5060, sip:10005 at 192.168.8.28:6050;transport=UDP,
udp:127.0.0.1:5060, udp:127.0.0.1:5060, 4, 1373346323, 1373441495, null,
null, 0, 0).#012 Query: update dialog set
state=4,timeout=1373441495,caller_cseq=NULL,callee_cseq=NULL,caller_ping_cseq=0,callee_ping_cseq=0,vars=NULL,profiles=NULL,script_flags=0,flags=0
where dlg_id=7941606572433
/usr/sbin/opensips[28853]: ERROR:core:db_do_update: error while submitting
query
/usr/sbin/opensips[28853]: ERROR:db_postgres:db_postgres_store_result:
0x7f3b53bc5bc8 - invalid query, execution aborted
/usr/sbin/opensips[28853]: ERROR:db_postgres:db_postgres_store_result:
0x7f3b53bc5bc8: PGRES_FATAL_ERROR
/usr/sbin/opensips[28853]: ERROR:db_postgres:db_postgres_store_result:
0x7f3b53bc5bc8:
/usr/sbin/opensips[28853]: WARNING:db_postgres:db_postgres_update:
unexpected result returned
/usr/sbin/opensips[28853]: ERROR:dialog:dialog_update_db: could not update
database info
/usr/sbin/opensips[28853]: CRITICAL:core:sig_alarm_abort: BUG - shutdown
timeout triggered, dying...
--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/crash-after-failover-tp7585845p7587113.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
More information about the Users
mailing list