RestComm / Restcomm-Connect

The Open Source Cloud Communications Platform
http://www.restcomm.com/
GNU Affero General Public License v3.0
242 stars 215 forks source link

SIP REFER method is now working with organizations #2906

Closed JuankGarcia closed 6 years ago

JuankGarcia commented 6 years ago

What this PR does / why we need it: When Restcomm Connect (RC) receives a REFER request and RC is configured with a domain name as hostname, the Sip-URI in Request-URI header is always coming with the RC IP address. So, we have to use the Refer-To header to get Sip-URI that contains the domain name, then it can get the destination Organization SID properly.

Which issue(s) this PR fixes Fixes #2902

Special notes for your reviewer: The SipURI is taken from Refer-To header. The searchOrganizationBySIPRequest method is used by SIP methods: INVITE and REFER in CallManager class, so I validate into the method if the request is REFER.