From 7168fa85a1cf75ff505137c0146366247370ad00 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 26 Sep 2017 09:35:31 +0200 Subject: [PATCH 1/2] Remove patch to adapt to pjspi API change (works for rawhide only) --- sflphone-pjspi-api-change.patch | 131 -------------------------------- sflphone.spec | 7 +- 2 files changed, 4 insertions(+), 134 deletions(-) delete mode 100644 sflphone-pjspi-api-change.patch diff --git a/sflphone-pjspi-api-change.patch b/sflphone-pjspi-api-change.patch deleted file mode 100644 index 266db65..0000000 --- a/sflphone-pjspi-api-change.patch +++ /dev/null @@ -1,131 +0,0 @@ -diff -up sflphone-1.4.1/daemon/src/sip/pres_sub_server.cpp.pjsip-api-change sflphone-1.4.1/daemon/src/sip/pres_sub_server.cpp ---- sflphone-1.4.1/daemon/src/sip/pres_sub_server.cpp.pjsip-api-change 2017-09-06 16:49:23.087165453 +0200 -+++ sflphone-1.4.1/daemon/src/sip/pres_sub_server.cpp 2017-09-06 16:52:28.338162891 +0200 -@@ -122,12 +122,13 @@ PresSubServer::pres_on_rx_subscribe_requ - - /* Create UAS dialog: */ - const pj_str_t contact(acc->getContactHeader()); -- status = pjsip_dlg_create_uas(pjsip_ua_instance(), rdata, &contact, &dlg); -+ status = pjsip_dlg_create_uas_and_inc_lock(pjsip_ua_instance(), rdata, &contact, &dlg); - - if (status != PJ_SUCCESS) { - char errmsg[PJ_ERR_MSG_SIZE]; - pj_strerror(status, errmsg, sizeof(errmsg)); - WARN("Unable to create UAS dialog for subscription: %s [status=%d]", errmsg, status); -+ pjsip_dlg_dec_lock(dlg); - pres->unlock(); - pjsip_endpt_respond_stateless(endpt, rdata, 400, NULL, NULL, NULL); - return PJ_TRUE; -@@ -156,6 +157,7 @@ PresSubServer::pres_on_rx_subscribe_requ - pjsip_dlg_send_response(dlg, pjsip_rdata_get_tsx(rdata), tdata); - } - -+ pjsip_dlg_dec_lock(dlg); - pres->unlock(); - return PJ_FALSE; - } -@@ -200,6 +202,7 @@ PresSubServer::pres_on_rx_subscribe_requ - if (status != PJ_SUCCESS) { - WARN("Unable to accept presence subscription %d", status); - pjsip_pres_terminate(sub, PJ_FALSE); -+ pjsip_dlg_dec_lock(dlg); - pres->unlock(); - return PJ_FALSE; - } -@@ -209,6 +212,7 @@ PresSubServer::pres_on_rx_subscribe_requ - - if (presSubServer->getExpires() == 0) { - // PJSIP_EVSUB_STATE_TERMINATED -+ pjsip_dlg_dec_lock(dlg); - pres->unlock(); - return PJ_TRUE; - } -@@ -245,10 +249,12 @@ PresSubServer::pres_on_rx_subscribe_requ - if (status != PJ_SUCCESS) { - WARN("Unable to create/send NOTIFY %d", status); - pjsip_pres_terminate(sub, PJ_FALSE); -+ pjsip_dlg_dec_lock(dlg); - pres->unlock(); - return status; - } - -+ pjsip_dlg_dec_lock(dlg); - pres->unlock(); - return PJ_TRUE; - } -diff -up sflphone-1.4.1/daemon/src/sip/sipvoiplink.cpp.pjsip-api-change sflphone-1.4.1/daemon/src/sip/sipvoiplink.cpp ---- sflphone-1.4.1/daemon/src/sip/sipvoiplink.cpp.pjsip-api-change 2017-09-06 16:49:38.812165235 +0200 -+++ sflphone-1.4.1/daemon/src/sip/sipvoiplink.cpp 2017-09-06 16:54:46.362160982 +0200 -@@ -405,9 +405,10 @@ transaction_request_cb(pjsip_rx_data *rd - - pjsip_dialog *dialog = 0; - -- if (pjsip_dlg_create_uas(pjsip_ua_instance(), rdata, nullptr, &dialog) != PJ_SUCCESS) { -+ if (pjsip_dlg_create_uas_and_inc_lock(pjsip_ua_instance(), rdata, nullptr, &dialog) != PJ_SUCCESS) { - call.reset(); - try_respond_stateless(endpt_, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, nullptr, nullptr, nullptr); -+ pjsip_dlg_dec_lock(dialog); - return PJ_FALSE; - } - -@@ -415,11 +416,13 @@ transaction_request_cb(pjsip_rx_data *rd - - if (!dialog or pjsip_dlg_set_transport(dialog, &tp_sel) != PJ_SUCCESS) { - ERROR("Could not set transport for dialog"); -+ pjsip_dlg_dec_lock(dialog); - return PJ_FALSE; - } - - if (!call->inv) { - ERROR("Call invite is not initialized"); -+ pjsip_dlg_dec_lock(dialog); - return PJ_FALSE; - } - -@@ -443,6 +446,7 @@ transaction_request_cb(pjsip_rx_data *rd - try_respond_stateless(endpt_, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, NULL, NULL, NULL); - } - -+ pjsip_dlg_dec_lock(dialog); - return PJ_FALSE; - } - -@@ -464,11 +468,13 @@ transaction_request_cb(pjsip_rx_data *rd - } else { // Proceed with normal call flow - if (pjsip_inv_initial_answer(call->inv, rdata, PJSIP_SC_TRYING, NULL, NULL, &tdata) != PJ_SUCCESS) { - ERROR("Could not answer invite"); -+ pjsip_dlg_dec_lock(dialog); - return PJ_FALSE; - } - - if (pjsip_inv_send_msg(call->inv, tdata) != PJ_SUCCESS) { - ERROR("Could not send msg for invite"); -+ pjsip_dlg_dec_lock(dialog); - return PJ_FALSE; - } - -@@ -476,6 +482,7 @@ transaction_request_cb(pjsip_rx_data *rd - - if (pjsip_inv_answer(call->inv, PJSIP_SC_RINGING, NULL, NULL, &tdata) != PJ_SUCCESS) { - ERROR("Could not answer invite"); -+ pjsip_dlg_dec_lock(dialog); - return PJ_FALSE; - } - -@@ -485,6 +492,7 @@ transaction_request_cb(pjsip_rx_data *rd - - if (pjsip_inv_send_msg(call->inv, tdata) != PJ_SUCCESS) { - ERROR("Could not send msg for invite"); -+ pjsip_dlg_dec_lock(dialog); - return PJ_FALSE; - } - -@@ -494,6 +502,8 @@ transaction_request_cb(pjsip_rx_data *rd - Manager::instance().incomingCall(*call, account_id); - } - -+ pjsip_dlg_dec_lock(dialog); -+ - return PJ_FALSE; - } - diff --git a/sflphone.spec b/sflphone.spec index 8a8d35e..7c993de 100644 --- a/sflphone.spec +++ b/sflphone.spec @@ -1,6 +1,6 @@ Name: sflphone Version: 1.4.1 -Release: 27%{?dist} +Release: 28%{?dist} Summary: SIP/IAX2 compatible enterprise-class software phone License: GPLv3+ @@ -33,8 +33,6 @@ Patch9: sflphone_gcc6.patch Patch10: sflphone_gcc7.patch # Fix FTBFS due to ERROR: The token "BOOL" is deprecated; use "BOOLEAN" instead Patch11: sflphone_dbus.patch -# Adapt to pjsip API change -Patch12: sflphone-pjspi-api-change.patch BuildRequires: alsa-lib-devel BuildRequires: ccrtp-devel @@ -301,6 +299,9 @@ fi %changelog +* Tue Sep 26 2017 Milan Crha - 1.4.1-28 +- Remove patch to adapt to pjspi API change (works for rawhide only) + * Wed Sep 06 2017 Sandro Mani - 1.4.1-27 - Add patch to fix deprecated dbus marshalling types From 38f6ece51dd393dad77b02b22737850ae1e76e97 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 26 Sep 2017 09:55:58 +0200 Subject: [PATCH 2/2] Revert "Remove patch to adapt to pjspi API change (works for rawhide only)" My fault, I'm sorry. This reverts commit 7168fa85a1cf75ff505137c0146366247370ad00. --- sflphone-pjspi-api-change.patch | 131 ++++++++++++++++++++++++++++++++ sflphone.spec | 7 +- 2 files changed, 134 insertions(+), 4 deletions(-) create mode 100644 sflphone-pjspi-api-change.patch diff --git a/sflphone-pjspi-api-change.patch b/sflphone-pjspi-api-change.patch new file mode 100644 index 0000000..266db65 --- /dev/null +++ b/sflphone-pjspi-api-change.patch @@ -0,0 +1,131 @@ +diff -up sflphone-1.4.1/daemon/src/sip/pres_sub_server.cpp.pjsip-api-change sflphone-1.4.1/daemon/src/sip/pres_sub_server.cpp +--- sflphone-1.4.1/daemon/src/sip/pres_sub_server.cpp.pjsip-api-change 2017-09-06 16:49:23.087165453 +0200 ++++ sflphone-1.4.1/daemon/src/sip/pres_sub_server.cpp 2017-09-06 16:52:28.338162891 +0200 +@@ -122,12 +122,13 @@ PresSubServer::pres_on_rx_subscribe_requ + + /* Create UAS dialog: */ + const pj_str_t contact(acc->getContactHeader()); +- status = pjsip_dlg_create_uas(pjsip_ua_instance(), rdata, &contact, &dlg); ++ status = pjsip_dlg_create_uas_and_inc_lock(pjsip_ua_instance(), rdata, &contact, &dlg); + + if (status != PJ_SUCCESS) { + char errmsg[PJ_ERR_MSG_SIZE]; + pj_strerror(status, errmsg, sizeof(errmsg)); + WARN("Unable to create UAS dialog for subscription: %s [status=%d]", errmsg, status); ++ pjsip_dlg_dec_lock(dlg); + pres->unlock(); + pjsip_endpt_respond_stateless(endpt, rdata, 400, NULL, NULL, NULL); + return PJ_TRUE; +@@ -156,6 +157,7 @@ PresSubServer::pres_on_rx_subscribe_requ + pjsip_dlg_send_response(dlg, pjsip_rdata_get_tsx(rdata), tdata); + } + ++ pjsip_dlg_dec_lock(dlg); + pres->unlock(); + return PJ_FALSE; + } +@@ -200,6 +202,7 @@ PresSubServer::pres_on_rx_subscribe_requ + if (status != PJ_SUCCESS) { + WARN("Unable to accept presence subscription %d", status); + pjsip_pres_terminate(sub, PJ_FALSE); ++ pjsip_dlg_dec_lock(dlg); + pres->unlock(); + return PJ_FALSE; + } +@@ -209,6 +212,7 @@ PresSubServer::pres_on_rx_subscribe_requ + + if (presSubServer->getExpires() == 0) { + // PJSIP_EVSUB_STATE_TERMINATED ++ pjsip_dlg_dec_lock(dlg); + pres->unlock(); + return PJ_TRUE; + } +@@ -245,10 +249,12 @@ PresSubServer::pres_on_rx_subscribe_requ + if (status != PJ_SUCCESS) { + WARN("Unable to create/send NOTIFY %d", status); + pjsip_pres_terminate(sub, PJ_FALSE); ++ pjsip_dlg_dec_lock(dlg); + pres->unlock(); + return status; + } + ++ pjsip_dlg_dec_lock(dlg); + pres->unlock(); + return PJ_TRUE; + } +diff -up sflphone-1.4.1/daemon/src/sip/sipvoiplink.cpp.pjsip-api-change sflphone-1.4.1/daemon/src/sip/sipvoiplink.cpp +--- sflphone-1.4.1/daemon/src/sip/sipvoiplink.cpp.pjsip-api-change 2017-09-06 16:49:38.812165235 +0200 ++++ sflphone-1.4.1/daemon/src/sip/sipvoiplink.cpp 2017-09-06 16:54:46.362160982 +0200 +@@ -405,9 +405,10 @@ transaction_request_cb(pjsip_rx_data *rd + + pjsip_dialog *dialog = 0; + +- if (pjsip_dlg_create_uas(pjsip_ua_instance(), rdata, nullptr, &dialog) != PJ_SUCCESS) { ++ if (pjsip_dlg_create_uas_and_inc_lock(pjsip_ua_instance(), rdata, nullptr, &dialog) != PJ_SUCCESS) { + call.reset(); + try_respond_stateless(endpt_, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, nullptr, nullptr, nullptr); ++ pjsip_dlg_dec_lock(dialog); + return PJ_FALSE; + } + +@@ -415,11 +416,13 @@ transaction_request_cb(pjsip_rx_data *rd + + if (!dialog or pjsip_dlg_set_transport(dialog, &tp_sel) != PJ_SUCCESS) { + ERROR("Could not set transport for dialog"); ++ pjsip_dlg_dec_lock(dialog); + return PJ_FALSE; + } + + if (!call->inv) { + ERROR("Call invite is not initialized"); ++ pjsip_dlg_dec_lock(dialog); + return PJ_FALSE; + } + +@@ -443,6 +446,7 @@ transaction_request_cb(pjsip_rx_data *rd + try_respond_stateless(endpt_, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, NULL, NULL, NULL); + } + ++ pjsip_dlg_dec_lock(dialog); + return PJ_FALSE; + } + +@@ -464,11 +468,13 @@ transaction_request_cb(pjsip_rx_data *rd + } else { // Proceed with normal call flow + if (pjsip_inv_initial_answer(call->inv, rdata, PJSIP_SC_TRYING, NULL, NULL, &tdata) != PJ_SUCCESS) { + ERROR("Could not answer invite"); ++ pjsip_dlg_dec_lock(dialog); + return PJ_FALSE; + } + + if (pjsip_inv_send_msg(call->inv, tdata) != PJ_SUCCESS) { + ERROR("Could not send msg for invite"); ++ pjsip_dlg_dec_lock(dialog); + return PJ_FALSE; + } + +@@ -476,6 +482,7 @@ transaction_request_cb(pjsip_rx_data *rd + + if (pjsip_inv_answer(call->inv, PJSIP_SC_RINGING, NULL, NULL, &tdata) != PJ_SUCCESS) { + ERROR("Could not answer invite"); ++ pjsip_dlg_dec_lock(dialog); + return PJ_FALSE; + } + +@@ -485,6 +492,7 @@ transaction_request_cb(pjsip_rx_data *rd + + if (pjsip_inv_send_msg(call->inv, tdata) != PJ_SUCCESS) { + ERROR("Could not send msg for invite"); ++ pjsip_dlg_dec_lock(dialog); + return PJ_FALSE; + } + +@@ -494,6 +502,8 @@ transaction_request_cb(pjsip_rx_data *rd + Manager::instance().incomingCall(*call, account_id); + } + ++ pjsip_dlg_dec_lock(dialog); ++ + return PJ_FALSE; + } + diff --git a/sflphone.spec b/sflphone.spec index 7c993de..8a8d35e 100644 --- a/sflphone.spec +++ b/sflphone.spec @@ -1,6 +1,6 @@ Name: sflphone Version: 1.4.1 -Release: 28%{?dist} +Release: 27%{?dist} Summary: SIP/IAX2 compatible enterprise-class software phone License: GPLv3+ @@ -33,6 +33,8 @@ Patch9: sflphone_gcc6.patch Patch10: sflphone_gcc7.patch # Fix FTBFS due to ERROR: The token "BOOL" is deprecated; use "BOOLEAN" instead Patch11: sflphone_dbus.patch +# Adapt to pjsip API change +Patch12: sflphone-pjspi-api-change.patch BuildRequires: alsa-lib-devel BuildRequires: ccrtp-devel @@ -299,9 +301,6 @@ fi %changelog -* Tue Sep 26 2017 Milan Crha - 1.4.1-28 -- Remove patch to adapt to pjspi API change (works for rawhide only) - * Wed Sep 06 2017 Sandro Mani - 1.4.1-27 - Add patch to fix deprecated dbus marshalling types