trunk dialout add blacklist validate
This commit is contained in:
parent
6f345f45d2
commit
8a270e4a9d
@ -8,6 +8,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import com.pudonghot.yo.model.domain.PhoneAlias;
|
import com.pudonghot.yo.model.domain.PhoneAlias;
|
||||||
import com.pudonghot.yo.mapper.PhoneAliasMapper;
|
import com.pudonghot.yo.mapper.PhoneAliasMapper;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
|
import com.pudonghot.yo.model.domain.PhoneBlacklist;
|
||||||
|
import com.pudonghot.yo.mapper.PhoneBlacklistMapper;
|
||||||
import com.pudonghot.yo.fsagent.service.dialplan.Call;
|
import com.pudonghot.yo.fsagent.service.dialplan.Call;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.pudonghot.yo.fsagent.service.dialplan.DialplanConfig;
|
import com.pudonghot.yo.fsagent.service.dialplan.DialplanConfig;
|
||||||
@ -23,6 +25,8 @@ public class DialplanService28AgentToTrunkPrefix extends BaseDialplanService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PhoneAliasMapper phoneAliasMapper;
|
private PhoneAliasMapper phoneAliasMapper;
|
||||||
|
@Autowired
|
||||||
|
private PhoneBlacklistMapper phoneBlacklistMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
@ -52,13 +56,22 @@ public class DialplanService28AgentToTrunkPrefix extends BaseDialplanService {
|
|||||||
val calledNumberObj = getCalledNumber(tenantId, trunkInfo.getRight());
|
val calledNumberObj = getCalledNumber(tenantId, trunkInfo.getRight());
|
||||||
if (!calledNumberObj.isAlias()) {
|
if (!calledNumberObj.isAlias()) {
|
||||||
if (!callerAgent.getTrunkDialAllowed()) {
|
if (!callerAgent.getTrunkDialAllowed()) {
|
||||||
log.debug("Caller [{}] is not allowed to dial trunk.", callerAgent);
|
log.info("Caller [{}] is not allowed to dial trunk.", callerAgent);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// number without trunk prefix
|
// number without trunk prefix
|
||||||
val calledNumber = calledNumberObj.getNumber();
|
val calledNumber = calledNumberObj.getNumber();
|
||||||
|
|
||||||
|
if (phoneBlacklistMapper.exists(
|
||||||
|
new Search(PhoneBlacklist.TENANT_ID, tenantId)
|
||||||
|
.eq(PhoneBlacklist.PHONE, calledNumber)
|
||||||
|
.eq(PhoneBlacklist.ACTIVE, true))) {
|
||||||
|
log.info("Called number [{}] is in blacklist", calledNumber);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
model.put("calledNumber", calledNumber);
|
model.put("calledNumber", calledNumber);
|
||||||
model.put("targetNumber", trunkService.calledNumber(trunk, calledNumber));
|
model.put("targetNumber", trunkService.calledNumber(trunk, calledNumber));
|
||||||
recFile(model, connId, callerAgent.getAccount(), md5(calledNumber));
|
recFile(model, connId, callerAgent.getAccount(), md5(calledNumber));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user