Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIP REFER method is now working with organizations #2906

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
import org.restcomm.connect.dao.ClientsDao;
import org.restcomm.connect.dao.DaoManager;
import org.restcomm.connect.dao.NotificationsDao;
import org.restcomm.connect.dao.OrganizationsDao;
import org.restcomm.connect.dao.RegistrationsDao;
import org.restcomm.connect.dao.common.OrganizationUtil;
import org.restcomm.connect.dao.entities.Account;
Expand Down Expand Up @@ -1108,6 +1109,7 @@ private void transfer(SipServletRequest request) throws Exception {

CallDetailRecord cdr = null;
CallDetailRecordsDao dao = storage.getCallDetailRecordsDao();
OrganizationsDao orgDao = storage.getOrganizationsDao();

SipServletResponse servletResponse = null;

Expand Down Expand Up @@ -1165,7 +1167,7 @@ private void transfer(SipServletRequest request) throws Exception {

String phone = cdr.getTo();
Sid sourceOrganizationSid = storage.getAccountsDao().getAccount(cdr.getAccountSid()).getOrganizationSid();
Sid destOrg = SIPOrganizationUtil.searchOrganizationBySIPRequest(storage.getOrganizationsDao(), request);
Sid destOrg = orgDao.getOrganizationByDomainName(((SipURI) request.getAddressHeader("Refer-To").getURI()).getHost()).getSid();
IncomingPhoneNumber number = numberSelector.searchNumber(phone, sourceOrganizationSid, destOrg);

if (number == null || (number.getReferUrl() == null && number.getReferApplicationSid() == null)) {
Expand Down