JBoss.orgCommunity Documentation
MAP Resource Adaptor Type is defined by Mobicents team as part of effort to standardize RA Types.
An MAP activity object represents a set of related events in an MAP resource. This RA Type defines only one activity object:
All the events related to MAP Dialog and events related to Service are fired on this activity.
This activity ends implicitly when MAP stack sends P-Abort or explicitly when user aborts the
Dialog or end's the Dialog.
Class name is
org.mobicents.protocols.ss7.map.api.MAPDialog
New
MAPDialog
activity objects are created via specific MAP Service interface. Check Section 2.4, “Resource Adaptor Interface” section for available services.
Depending on service used, activity object provides additional set of methods. For instance USSD
dialog: org.mobicents.protocols.ss7.map.api.service.supplementary.MAPDialogSupplementary
exposes
methods specific for exchange of USSD
messages.
Events represent's MAP's common services as well as services related to USSD Events are fired on
MAPDialog
For proper render of this table prefixes, for entries on some columns are ommited. For prefix values, for each column, please see list below:
org.mobicents.protocols.ss7.map.
org.mobicents.slee.resource.map.
Version for all defined events is 1.0
Vendor for all defined events is org.mobicents
Spaces where introduced in
Name
column values, to correctly render the table. Please remove them when using copy/paste.
Table 2.1. Dialog events
Name | Event Class | Comments |
---|---|---|
DIALOG_DELIMITER | DialogDelimiter | Indicates end of MAP commands that triggered other events to be fired. |
DIALOG_REQUEST | DialogRequest | Generic event representing ANY map request. This event is fired for ALL incoming requests. |
DIALOG_ACCEPT | DialogAccept | Indicates that remote peer acknowledged dialog. This event is fired prior to any other event in such case. |
DIALOG_REJECT | DialogReject | Opposite to DIALOG_ACCEPT. Indicates that remote peer rejected dialog for some reason. This event is fired prior to one indicating reason. |
DIALOG_USERABORT | DialogUserAbort | Fired when remote MAP user aborts dialog. |
DIALOG_PROVIDERABORT | DialogProviderAbort | Fired when when dialog is aborted due to transport level error. |
DIALOG_CLOSE | DialogClose | Fired when dialog is closed via TCAP-END primitive. |
DIALOG_NOTICE | DialogNotice | Fired when abnormal message is received within dialog. For instance when when duplicated InvokeID or wrong operation is received(for running MAP service). |
DIALOG_TIMEOUT | DialogTimeout | Fired when dialog is about to timeout. Depending on configuration RA may sustain dialog or let it timeout. This event is fired when there is no activity on dialog for extended period of time. |
For proper render of this table prefixes, for entries on some columns are ommited. For prefix values, for each column, please see list below:
org.mobicents.protocols.ss7.map.
org.mobicents.protocols.ss7.map.api.service.supplementary.
Version for all defined events is 1.0
Vendor for all defined events is org.mobicents
Spaces where introduced in
Name
column values, to correctly render the table. Please remove them when using copy/paste.
Table 2.2. Dialog service events
Name | Event Class | Comments |
---|---|---|
PROCESS_UNSTRUCTURED _SS_REQUEST_INDICATION | ProcessUnstructuredSSIndication | Fired when initial USSD request is received. |
UNSTRUCTURED_SS _REQUEST_INDICATION | UnstructuredSSIndication | Fired for each subsequent USSD request. |
For proper render of this table prefixes, for entries on some columns are ommited. For prefix values, for each column, please see list below:
org.mobicents.protocols.ss7.map.
org.mobicents.slee.resource.map.
Version for all defined events is 1.0
Vendor for all defined events is org.mobicents
Spaces where introduced in
Name
column values, to correctly render the table. Please remove them when using copy/paste.
Table 2.3. Component events
Name | Event Class | Comments |
---|---|---|
INVOKE_TIMEOUT | InvokeTimeout | Fired when localy initiated Invoke does not receive any answer for extended period of time. |
ERROR_COMPONENT | ErrorComponent | Fired when remote peer indicates abnormal component. It indicates some protocol error in component sent from local peer. |
PROVIDER_ERROR_COMPONENT | ProviderErrorComponent | Fired when transport provider encounters error on parsing MAP message. It is similar in meaning to ERROR_COMPONENT, but for component received from remote peer. |
REJECT_COMPONENT | RejectComponent | Fired when remote end rejects component for some reason. |
The interface of the MAP resource adaptor type specific Activity Context Interface Factory is defined as follows:
package org.mobicents.slee.resource.map; import org.mobicents.protocols.ss7.map.api.MAPDialog; import javax.slee.ActivityContextInterface; import javax.slee.FactoryException; import javax.slee.UnrecognizedActivityException; public interface MAPContextInterfaceFactory { public ActivityContextInterface getActivityContextInterface(MAPDialog dialog) throws NullPointerException, UnrecognizedActivityException, FactoryException; }
The MAP Resource Adaptor SBB Interface provides SBBs with access to the MAP objects required for creating a new, aborting, ending a MAPdialog and sending USSD Request/Response. It is defined as follows:
package org.mobicents.protocols.ss7.map.api; public interface MAPProvider { public abstract void addMAPDialogListener(MAPDialogListener mapdialoglistener); public abstract void removeMAPDialogListener(MAPDialogListener mapdialoglistener); public abstract MapServiceFactory getMapServiceFactory(); public abstract MAPErrorMessageFactory getMAPErrorMessageFactory(); public abstract MAPDialog getMAPDialog(Long long1); public abstract MAPServiceSupplementary getMAPServiceSupplementary(); public abstract MAPServiceSms getMAPServiceSms(); public abstract MAPServiceLsm getMAPServiceLsm(); }
this method is not supported. Call to it causes NotSupportedException to be thrown.
this method is not supported. Call to it causes NotSupportedException to be thrown.
retrieves factory for generic MAP components(interface name is missleading, will be changed in CR1)
retrieves implementation of MAP error message factory. Error messages are used to indicate erroneous conditions.
retrieves active dialog by its ID
.
retrieves MAP sumplementary service. It is used to create USSD dialogs.
retrieves MAP SMS service. It is used to create SMS dialogs. In current release it is not supported.
retrieves MAP LMS service. It is used to create LMS dialogs. In current release it is not supported.
As MAP stack is beeing completed, it will support more services, this list of getMAPServiceX
will expand to support all implemented services.
The resource adaptor implementation should prevent SBBs from adding themselves as MAP listeners, or changing the MAP network configuration. Any attempt to do so should be rejected by throwing a SecurityException.
The following code shows complete flow of application receiving the MAP Dialog request and then USSD Request. Application sends back Unstructured SS Response and finally on receiving Unstructured SS Request, application closes the MAPDialog
public abstract class SipSbb implements Sbb { private SbbContext sbbContext; private MAPContextInterfaceFactory mapAcif; private MAPProvider mapProvider; private MapServiceFactory mapServiceFactory; private static byte ussdDataCodingScheme = 0x0F; private Tracer logger; /** Creates a new instance of CallSbb */ public SipSbb() { } /** * MAP USSD Event Handlers */ public void onProcessUnstructuredSSRequest( ProcessUnstructuredSSIndication evt, ActivityContextInterface aci) { try { long invokeId = evt.getInvokeId(); this.setInvokeId(invokeId); String ussdString = evt.getUSSDString().getString(); this.setUssdString(ussdString); int codingScheme = evt.getUSSDDataCodingScheme() & 0xFF; String msisdn = evt.getMSISDNAddressString().getAddress(); if (this.logger.isFineEnabled()) { this.logger .fine("Received PROCESS_UNSTRUCTURED_ SS_REQUEST_INDICATION for MAP Dialog Id " + evt.getMAPDialog().getDialogId()+ " ussdString = "+ussdString); } USSDString ussdStringObj = this.mapServiceFactory .createUSSDString("1. Movies 2. Songs 3. End"); evt.getMAPDialog().addUnstructuredSSResponse(invokeId, false, ussdDataCodingScheme, ussdStringObj); evt.getMAPDialog().send(); } catch (Exception e) { logger.severe("Error while sending MAP USSD message", e); } } public void onUnstructuredSSRequest(UnstructuredSSIndication evt, ActivityContextInterface aci) { if (this.logger.isFineEnabled()) { this.logger .fine("Received UNSTRUCTURED_SS_REQUEST_INDICATION for MAP Dialog Id " + evt.getMAPDialog().getDialogId()); } try{ MAPDialog mapDialog = evt.getMAPDialog(); USSDString ussdStrObj = evt.getUSSDString(); long invokeId = evt.getInvokeId(); USSDString ussdStringObj = this.mapServiceFactory.createUSSDString("Thank you"); evt.getMAPDialog().addUnstructuredSSResponse(invokeId, false, ussdDataCodingScheme, ussdStringObj); //End MAPDialog evt.getMAPDialog().close(false); }catch(Exception e){ logger.severe("Error while sending MAP USSD ", e); } } ... public void setSbbContext(SbbContext sbbContext) { this.sbbContext = sbbContext; this.logger = sbbContext.getTracer("USSD-SIP"); try { Context ctx = (Context) new InitialContext() .lookup("java:comp/env"); mapAcif = (MAPContextInterfaceFactory) ctx .lookup("slee/resources/map/2.0/acifactory"); mapProvider = (MAPProvider) ctx .lookup("slee/resources/map/2.0/provider"); this.mapServiceFactory = this.mapProvider.getMapServiceFactory(); } catch (Exception ne) { logger.severe("Could not set SBB context:", ne); } } public void unsetSbbContext() { this.sbbContext = null; this.logger = null; } public void sbbCreate() throws CreateException { } public void sbbPostCreate() throws CreateException { } public void sbbActivate() { } public void sbbPassivate() { } public void sbbLoad() { } public void sbbStore() { } public void sbbRemove() { } public void sbbExceptionThrown(Exception exception, Object object, ActivityContextInterface activityContextInterface) { } public void sbbRolledBack(RolledBackContext rolledBackContext) { } }