From 6368bc0ba0dff0f59397159fdc75f9810023ab70 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 10 Apr 2018 15:57:20 +0200 Subject: [PATCH] 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). --- coreapi/bellesip_sal/sal_op_impl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreapi/bellesip_sal/sal_op_impl.c b/coreapi/bellesip_sal/sal_op_impl.c index 33d1b5eaa..59ae5c5f6 100644 --- a/coreapi/bellesip_sal/sal_op_impl.c +++ b/coreapi/bellesip_sal/sal_op_impl.c @@ -812,8 +812,8 @@ int sal_op_get_address_family(SalOp *op){ if (op->refresher) { - 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; if (!via){ ms_error("Unable to determine IP version from signaling operation, no via header found."); return AF_UNSPEC;