From 0b08a64fc8826807d02448941279074da206b8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Tue, 13 Oct 2015 18:35:12 -0400 Subject: [PATCH] sip/im: use the full peer SIP URI Account level text messages only reported the SIP userrname instead of the full SIP URI username@hostname. This prevented clients to preperly recorgnise the sender. The proper URI is now reported. Issue: #81724 Change-Id: Id37b658340d07e14d6cda685d68872b634429306 --- src/sip/sipvoiplink.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sip/sipvoiplink.cpp b/src/sip/sipvoiplink.cpp index 21cd5b6564..7f9c324f40 100644 --- a/src/sip/sipvoiplink.cpp +++ b/src/sip/sipvoiplink.cpp @@ -205,6 +205,8 @@ transaction_request_cb(pjsip_rx_data *rdata) size_t length = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, sip_from_uri, tmp, PJSIP_MAX_URL_SIZE); std::string peerNumber(tmp, length); sip_utils::stripSipUriPrefix(peerNumber); + if (not remote_user.empty() and not remote_hostname.empty()) + peerNumber = remote_user + "@" + remote_hostname; auto link = getSIPVoIPLink(); if (not link) { @@ -279,9 +281,6 @@ transaction_request_cb(pjsip_rx_data *rdata) return PJ_FALSE; } - if (not remote_user.empty() and not remote_hostname.empty()) - peerNumber = remote_user + "@" + remote_hostname; - // RING_DBG("transaction_request_cb viaHostname %s toUsername %s addrToUse %s addrSdp %s peerNumber: %s" , // viaHostname.c_str(), toUsername.c_str(), addrToUse.toString().c_str(), addrSdp.toString().c_str(), peerNumber.c_str()); -- GitLab