Commit 4fe39b5a authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2618] Remove 'sip:' prefix from incoming calls

If present, teh call is interpreted as an IP2IP call and not
associated to its account when redialing from call history.
parent e3ee8ce2
......@@ -3520,7 +3520,7 @@ mod_on_rx_request (pjsip_rx_data *rdata)
_debug ("UserAgent: The receiver is: %s@%s",,;
_debug ("UserAgent: The callee account id is %s", account_id.c_str());
_debug ("UserAgent: The callee account is %s", account_id.c_str());
/* Now, it is the time to find the information of the caller */
uri = rdata->msg_info.from->uri;
......@@ -3534,6 +3534,13 @@ mod_on_rx_request (pjsip_rx_data *rdata)
std::string peerNumber (tmp, length);
//Remove sip: prefix
size_t found = peerNumber.find("sip:");
if (found!=std::string::npos)
peerNumber.erase(found, found+4);
_debug("UserAgent: Peer number: %s", peerNumber.c_str());
// Get the server voicemail notification
// Catch the NOTIFY message
if (rdata->msg_info.msg-> == PJSIP_OTHER_METHOD) {
......@@ -3662,6 +3669,8 @@ mod_on_rx_request (pjsip_rx_data *rdata)
call->setDisplayName (displayName);
_debug("UserAgent: DisplayName: %s", displayName.c_str());
// Have to do some stuff with the SDP
// Set the codec map, IP, peer number and so on... for the SIPCall object
......@@ -3704,7 +3713,6 @@ mod_on_rx_request (pjsip_rx_data *rdata)
// Explicitly set the transport, set_transport methods increment transport's reference counter
status = pjsip_dlg_set_transport (dialog, tp);
// Associate the call in the invite session
......@@ -3713,11 +3721,9 @@ mod_on_rx_request (pjsip_rx_data *rdata)
// Send a 180 Ringing response
_info ("UserAgent: Send a 180 Ringing response");
status = pjsip_inv_initial_answer (inv, rdata, PJSIP_SC_RINGING, NULL, NULL, &tdata);
status = pjsip_inv_send_msg (inv, tdata);
// Associate invite session to the current call
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment