From 4b95c0d570c64406b7f7e8e9a07e048188f26b74 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 13 Jun 2018 18:07:14 +0200 Subject: [PATCH] Reimplement commit 6368bc of master branch "Fix problem where address family is not guessed as it should (if we receive the INVITE just after sending the REGISTER but before receiving the response of the REGISTER)" --- src/sal/op.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sal/op.cpp b/src/sal/op.cpp index b53be38c3..b8df469df 100644 --- a/src/sal/op.cpp +++ b/src/sal/op.cpp @@ -457,8 +457,8 @@ int SalOp::getAddressFamily() const { if (mRefresher) { - belle_sip_response_t *resp = belle_sip_transaction_get_response(tr); - belle_sip_header_via_t *via = resp ?belle_sip_message_get_header_by_type(resp,belle_sip_header_via_t):NULL; + belle_sip_message_t *msg = belle_sip_transaction_get_response(tr) ? (belle_sip_message_t*) belle_sip_transaction_get_response(tr) : (belle_sip_message_t*) belle_sip_transaction_get_request(tr); + belle_sip_header_via_t *via = msg ? belle_sip_message_get_header_by_type(msg,belle_sip_header_via_t):NULL; const char *host; if (!via){ ms_error("Unable to determine IP version from signaling operation, no via header found.");