Hi Antoni,
To proxy all requests through your app you have to create a new dialog with remaining TCAP DialogId from original and changed SccpCallingParty to GT of your platform and SCCPCalledParty to GT to:
- for SRIForSM to B-num
- for MT-FSM to real MSC Address which you get from SRIForSM and stored in your cache.
In this case, your app doesn't generate any new TCAP DialogId and all communications through your App will be transparent.
Now all responses from HLR or MSC should come to your app and you can resend them to origin by changing SccpCalledParty back (don't forget to save it).
I'll show you based on Camel InitialDP, but for SRI-ForSM and MT-FSM logic states the same.
#Incoming IDP
open fun onInitialDpRequest(event: InitialDPRequest, aci: ActivityContextInterface, eventContext: EventContext?) {
withRestMdcContext(event.capDialog.remoteDialogId) {
logger.debug("onInitialDpRequest EVENT = {}, ACI = {}, EVENT_CONTEXT = {}", event, aci, eventContext)
val call = callBuilder.build(event, eventContext)
CapLoggingUtil.logInitialDpRequest(call)
setCall(call)
logger.debug("onInitialDpRequest CALL = {}", call)
val newCalledGT = "79061111111"
capHandler?.forwardIDP(event, newCalledGT)
}
}
#Change SccpCalledGT and send in a new capDialog with the same TCAP DialogId and other parameters.
@Throws(CapGatewayException::class)
override fun forwardIDP(event: InitialDPRequest, newCalledGT: String) {
try {
logger.debug("forwardIDP event = {}", event)
val remoteCapDialog = event.capDialog
val capDialog = capProvider.capServiceCircuitSwitchedCall.createNewDialog(getCAPApplicationContext(), getSCCPCallingPartyAddress(event.mscAddress.address, remoteCapDialog.remoteAddress.subsystemNumber), getSCCPCalledPartyAddress(newCalledGT, remoteCapDialog.localAddress.subsystemNumber), remoteCapDialog.remoteDialogId)
capDialog.networkId = NETWORK_ID
capDialog.returnMessageOnError = true
val serviceKey = event.serviceKey
val calledPartyNumber = event.calledPartyNumber
val callingPartyNumber = event.callingPartyNumber
val callingPartysCategory = event.callingPartysCategory
val cgEncountered = event.cgEncountered
val ipsspCapabilities = event.ipsspCapabilities
val locationNumber = event.locationNumber
val originalCalledPartyID = event.originalCalledPartyID
val extensions = event.extensions
val highLayerCompatibility = event.highLayerCompatibility
val additionalCallingPartyNumber = event.additionalCallingPartyNumber
val bearerCapability = event.bearerCapability
val eventTypeBCSM = event.eventTypeBCSM
val redirectingPartyID = event.redirectingPartyID
val redirectionInformation = event.redirectionInformation
val cause = event.cause
val serviceInteractionIndicatorsTwo = event.serviceInteractionIndicatorsTwo
val carrier = event.carrier
val cugIndex = event.cugIndex
val cugInterlock = event.cugInterlock
val cugOutgoingAccess = event.cugOutgoingAccess
val imsi = event.imsi
val subscriberState = event.subscriberState
val locationInformation = event.locationInformation
val extBasicServiceCode = event.extBasicServiceCode
val callReferenceNumber = event.callReferenceNumber
val mscAddress = event.mscAddress
val calledPartyBCDNumber = event.calledPartyBCDNumber
val timeAndTimezone = event.timeAndTimezone
val callForwardingSSPending = event.callForwardingSSPending
val initialDPArgExtension = event.initialDPArgExtension
capDialog.addInitialDPRequest(serviceKey, calledPartyNumber, callingPartyNumber, callingPartysCategory, cgEncountered, ipsspCapabilities, locationNumber, originalCalledPartyID, extensions, highLayerCompatibility, additionalCallingPartyNumber, bearerCapability, eventTypeBCSM, redirectingPartyID, redirectionInformation, cause, serviceInteractionIndicatorsTwo, carrier, cugIndex, cugInterlock, cugOutgoingAccess, imsi, subscriberState, locationInformation, extBasicServiceCode, callReferenceNumber, mscAddress, calledPartyBCDNumber, timeAndTimezone, callForwardingSSPending, initialDPArgExtension)
logger.debug("forwardIDP capDialog = {}", capDialog)
capDialog.send()
} catch (e: Exception) {
logger.error("Error while sending forwardIDP request:", e)
throw CapGatewayException("Error while forwardIDP SRIForSM request:", e)
}
}
Best regards,
Sergey Yashchenkov
четверг, 14 ноября 2019 г., 18:16:17 UTC+3 пользователь Armache Antoni написал:
Thanks Bro