RestComm / jss7

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

SmsTpdu handle SCA prefix #278

Closed smarek closed 6 years ago

smarek commented 6 years ago

Hi, I'm integrating subset ('org.mobicents.protocols.ss7.map:map-impl:8.0.112') in Android environment.

SMS PDUs (SUBMIT, DELIVER and responses), in form that is retrieved from Android API, are always prefixed with SCA (Service Center Address), ie. 0x07 0x91 0x24 0x70 0x33 0x80 0x16 0x00

Stripping the SCA away, allows me to use simple interface of SmsTpdu via SmsTpduImpl.createInstance(byte[], boolean, Charset) Current code-sample doing fallback in case of SCA prefix can be seen here com/itds/sms/ping/MainActivity.java#L297

Is there any MAP api class that handles SmsTpdu prefixed with SCA?

knosach commented 6 years ago

Hi @smarek ForwardShortMessageRequest has ASN.1 format encoded message (as all MAP messages), therefore, it has its own headers related to ASN.1 you can check API here: https://github.com/RestComm/jss7/blob/71f24a37a2e313524084149696a1efd791b07cba/map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/sms/ForwardShortMessageRequest.java#L42 and implementation here : https://github.com/RestComm/jss7/blob/71f24a37a2e313524084149696a1efd791b07cba/map/map-impl/src/main/java/org/mobicents/protocols/ss7/map/service/sms/ForwardShortMessageRequestImpl.java#L56

However it looks like android cleans up ASN1 format and provides some custom byte array data. Its neither ASN1 format encoded message, nor specific encoded byte array. It is not supported by SS7 stack.