RestComm / jss7

RestComm Java SS7 Stack and Services
http://www.restcomm.com/
GNU Affero General Public License v3.0
186 stars 221 forks source link

JSS7 routing issue #314

Closed gasandjalilov closed 4 years ago

gasandjalilov commented 5 years ago

The problem is that I have configured the Client to connect to mss the MSS address is (It is a real production mss)

protected final String SERVER_IP = "10.65.12.167";
protected final int SERVER_PORT = 4000;

my application that should work as ussdgw(Client association) address is

protected final String CLIENT_IP = "10.2.39.11";
protected final int  CLIENT_PORT= 9988;

the issue is that I can receive the message:

643477 [Mtp3-DeliveryExecutor-5-6-1] DEBUG org.mobicents.protocols.ss7.sccp.impl.SccpStackImpl-MapLoadServerSccpStack  - Rx : SCCP message from MTP Sccp Msg [Type=UDT networkId=0 sls=5 incomingOpc=13313 incomingDpc=13043 outgoingDpc=-1 CallingAddress(pc=0,ssn=7,AI=18,gt=GlobalTitle0100Impl [digits=998930150000, natureOfAddress=INTERNATIONAL, numberingPlan=ISDN_TELEPHONY, translationType=0, encodingScheme=BCDEvenEncodingScheme[type=BCD_EVEN, code=2]]) CalledParty(pc=0,ssn=5,AI=18,gt=GlobalTitle0100Impl [digits=998930195002, natureOfAddress=INTERNATIONAL, numberingPlan=ISDN_TELEPHONY, translationType=0, encodingScheme=BCDEvenEncodingScheme[type=BCD_EVEN, code=2]]) DataLen=122]

643477 [Mtp3-DeliveryExecutor-5-6-1] DEBUG org.mobicents.protocols.ss7.sccp.impl.SccpRoutingControl  - Matching rule found: [ruleId(2);ruleType(Solitary);originatingType(RemoteOriginated);patternSccpAddress(pc=13313,ssn=5,AI=83,gt=GlobalTitle0100Impl [digits=998930195002, natureOfAddress=INTERNATIONAL, numberingPlan=ISDN_TELEPHONY, translationType=0, encodingScheme=BCDEvenEncodingScheme[type=BCD_EVEN, code=2]]);paddress(2);saddress(-1);mask(R);networkId(0)] CalledPartyAddress after translation = pc=13043,ssn=7,AI=19,gt=GlobalTitle0100Impl [digits=998930195002, natureOfAddress=INTERNATIONAL, numberingPlan=ISDN_TELEPHONY, translationType=0, encodingScheme=BCDEvenEncodingScheme[type=BCD_EVEN, code=2]]

643477 [Mtp3-DeliveryExecutor-5-6-1] DEBUG org.mobicents.protocols.ss7.sccp.impl.SccpRoutingControl  - Local deliver : SCCP Data Message=Sccp Msg [Type=UDT networkId=0 sls=5 incomingOpc=13313 incomingDpc=13043 outgoingDpc=-1 CallingAddress(pc=0,ssn=7,AI=18,gt=GlobalTitle0100Impl [digits=998930150000, natureOfAddress=INTERNATIONAL, numberingPlan=ISDN_TELEPHONY, translationType=0, encodingScheme=BCDEvenEncodingScheme[type=BCD_EVEN, code=2]]) CalledParty(pc=13043,ssn=7,AI=19,gt=GlobalTitle0100Impl [digits=998930195002, natureOfAddress=INTERNATIONAL, numberingPlan=ISDN_TELEPHONY, translationType=0, encodingScheme=BCDEvenEncodingScheme[type=BCD_EVEN, code=2]]) DataLen=122]

2019-08-13 15:45:02.569  INFO 22973 --- [yExecutor-5-6-1] uz.rdu.ussd.servers.SS7Client            : On Dialog Request Recieved ...
2019-08-13 15:45:02.570  INFO 22973 --- [yExecutor-5-6-1] uz.rdu.ussd.servers.SS7Client            : On Dialog Request Recieved ... dest:434054305088581  orig:998930150000
onMAPMessage for DialogId=2. Ussd String=0
2019-08-13 15:45:02.571  INFO 22973 --- [yExecutor-5-6-1] uz.rdu.ussd.servers.SS7Client            : onProcessUnstructuredSSRequestIndication for DialogId=2. Ussd String=*1071#
2019-08-13 15:45:02.571  INFO 22973 --- [yExecutor-5-6-1] uz.rdu.ussd.servers.SS7Client            : On Dialog Delimeter
2019-08-13 15:45:02.571  INFO 22973 --- [yExecutor-5-6-1] uz.rdu.ussd.servers.SS7Client            : GlobalTitle0100Impl [digits=998930150000, natureOfAddress=INTERNATIONAL, numberingPlan=ISDN_TELEPHONY, translationType=0, encodingScheme=BCDEvenEncodingScheme[type=BCD_EVEN, code=2]]

But I cant send the response back, here is my sccp route

private void initSCCP() throws Exception {
                logger.info("Initializing SCCP Stack ....");
                logger.info("new changes");
                 logger.debug("Initializing SCCP Stack ....");
                this.sccpStack = new SccpStackImpl("MapLoadServerSccpStack");
                this.sccpStack.setMtp3UserPart(1, this.clientM3UAMgmt);

                this.sccpStack.start();
                this.sccpStack.removeAllResourses();

                this.sccpStack.getSccpResource().addRemoteSpc(0, CLIENT_SPC, 0, 0);
                this.sccpStack.getSccpResource().addRemoteSsn(0, CLIENT_SPC, SSN, 0, false);

                this.sccpStack.getSccpResource().addRemoteSpc(1, SERVER_SPC, 0, 0);
                this.sccpStack.getSccpResource().addRemoteSsn(1, SERVER_SPC, SSN, 0, false);

                this.sccpStack.getRouter().addMtp3ServiceAccessPoint(1, 1, CLIENT_SPC, NETWORK_INDICATOR, 0);
                this.sccpStack.getRouter().addMtp3Destination(1, 1, SERVER_SPC, SERVER_SPC, 0, 255, 255);

                //this.sccpStack.getRouter().addMtp3ServiceAccessPoint(2, 1, SERVER_SPC, NETWORK_INDICATOR, 0);
                //this.sccpStack.getRouter().addMtp3Destination(2, 1, CLIENT_SPC, CLIENT_SPC, 0, 255, 255);

                this.sccpProvider = this.sccpStack.getSccpProvider();

                // SCCP routing table

                //used GlobalTitleIndicator(GTI) class for createGlobalTitle is GlobalTitle0100(used for MAP)
                GlobalTitle called = this.sccpProvider.getParameterFactory().createGlobalTitle
                        ("998930195002", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                                NatureOfAddress.INTERNATIONAL);
                GlobalTitle calling = this.sccpProvider.getParameterFactory().createGlobalTitle
                        ("998930150000", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                                NatureOfAddress.INTERNATIONAL);

                //      -1-
                this.sccpStack.getRouter().addRoutingAddress
                        (1, this.sccpProvider.getParameterFactory().createSccpAddress
                                (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, calling, SERVER_SPC, 8));
                //      -2-
                this.sccpStack.getRouter().addRoutingAddress
                        (2, this.sccpProvider.getParameterFactory().createSccpAddress(
                                RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, called, CLIENT_SPC, 7));

                called = this.sccpProvider.getParameterFactory().createGlobalTitle
                        ("998930195002", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                                NatureOfAddress.INTERNATIONAL);
                calling = this.sccpProvider.getParameterFactory().createGlobalTitle
                        ("998930150000", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                                NatureOfAddress.INTERNATIONAL);

                SccpAddress patternLocal = this.sccpProvider.getParameterFactory().createSccpAddress(
                        RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, called, SERVER_SPC,5);

                 SccpAddress patternRemote = this.sccpProvider.getParameterFactory().createSccpAddress
                        (RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, calling, SERVER_SPC,5);
}

And here is the request that I want to send back

@Override
        public void onProcessUnstructuredSSRequest(ProcessUnstructuredSSRequest procUnstrReqInd) {
                // TODO Auto-generated method stub
                try{
                        logger.info(String.format("onProcessUnstructuredSSRequestIndication for DialogId=%d. Ussd String=%s",
                        procUnstrReqInd.getMAPDialog().getLocalDialogId(), procUnstrReqInd.getUSSDString().getString(null)));
                        long invokeId = procUnstrReqInd.getInvokeId();

                        USSDString ussdStrObj = this.mapProvider.getMAPParameterFactory().createUSSDString(
                                        "USSD String : Hello World <CR> 1. Balance <CR> 2. Texts Remaining");
                        CBSDataCodingScheme ussdDataCodingScheme = new CBSDataCodingSchemeImpl(0x0F);
                        MAPDialogSupplementary dialog = procUnstrReqInd.getMAPDialog();

                        dialog.setUserObject(invokeId);

                        ISDNAddressString msisdn = this.mapProvider.getMAPParameterFactory().createISDNAddressString(
                                        AddressNature.international_number, NumberingPlan.ISDN, "998930150000");

                        dialog.addProcessUnstructuredSSRequest(ussdDataCodingScheme, ussdStrObj, null, msisdn);
                        dialog.send();
                } catch (MAPException e) {
                        logger.error("Error while sending UnstructuredSSRequest ", e);
                }
        }
yulianoifa-mobius commented 4 years ago

Hi Please use https://groups.google.com/forum/#!forum/mobicents-public Or request commercial support for support enquiries

naseemr commented 2 years ago

Were you able to figure out what was the issue? I am having same issue, I can not send a response back.