ussd: how to stop dialog?

373 views
Skip to first unread message

Gennadiy Dubina

unread,
Apr 29, 2016, 8:17:17 AM4/29/16
to restcomm
Hi everyone,

We have ussd gw + restcomm server + backend app to handle ussd flow.  

We would like to have "cancel" button in our menu. 

So on the server side we return the following RCML: <Response></Hangup></Response>
not sure that i can use it with ussd but seems restcomm just send BYE sip message to ussd gw.

in this case ussd gw throws error.
Also i have tried to return empty RCML: <Response></Response>. i have got the same error

So how to stop dialog in correct way?

Log dump:

12:09:13,259 INFO  [SIPTransactionStack] (pool-36-thread-1) <message
from="10.0.0.101:5060"
to
="10.0.0.101:5080"
time
="1461931753259"
isSender
="true"
transactionId
="z9hg4bkb1152f09_57a5b08a_d1fc4865-d016-4545-94a8-45fa4031acc7"
callId
="03bb545d6326b2bc...@10.0.0.101"
firstLine
="SIP/2.0 200 OK"
>
<![CDATA[SIP/2.0 200 OK
To: <sip:111111@10.0.0.101:5060>;tag=9367
Via: SIP/2.0/UDP 10.0.0.101:5080;branch=z9hG4bKb1152f09_57a5b08a_d1fc4865-d016-4545-94a8-45fa4031acc7
CSeq: 2 BYE
Call-ID: 03bb545d6326b2bc1f473f4bc1f45c51@10.0.0.101
From: <sip:*333%23@10.0.0.101:5080>;tag=17975418_507f0f6d_57a5b08a_b1152f09
Content-Length: 0


]]>
</message>


12:09:13,259 INFO  [SipClientSbbImpl] (pool-36-thread-1) Payload <?xml version='1.0' encoding='UTF-8'?>
<ussd-data>
<language value="en"/
>
<ussd-string value=""/>
<anyExt>
<message-type>processUnstructuredSSRequest_Response</message-type>
</
anyExt>
</ussd-data>
12:09:13,260 ERROR [SipClientSbbImpl] (pool-36-thread-1) Error while processing BYE event
RequestEventWrapper[ EVENT[BYE] DIALOG[ClientDialogWrapper[ handle = 03bb545d6326b2bc1f473f4bc1f45c51@10.0.0.101:9367:null, state = Terminated Dialog, clientTXs = [z9hg4bk-3337-38f2ad8f7e1b2771f2b47227dcdfe442] ]] TX[ServerTransaction[z9hG4bKb1152f09_57a5b08a_d1fc4865-d016-4545-94a8-45fa4031acc7]]]
org
.mobicents.protocols.ss7.map.api.MAPException: Error while encoding the USSDString: data field length must be from 1 to 160 octets
 at org
.mobicents.protocols.ss7.map.primitives.OctetStringBase.encodeData(OctetStringBase.java:135)
 at org
.mobicents.protocols.ss7.map.primitives.OctetStringBase.encodeAll(OctetStringBase.java:122)
 at org
.mobicents.protocols.ss7.map.primitives.OctetStringBase.encodeAll(OctetStringBase.java:114)
 at org
.mobicents.protocols.ss7.map.service.supplementary.ProcessUnstructuredSSResponseImpl.encodeData(ProcessUnstructuredSSResponseImpl.java:163)
 at org
.mobicents.protocols.ss7.map.service.supplementary.MAPDialogSupplementaryImpl.addProcessUnstructuredSSResponse(MAPDialogSupplementaryImpl.java:754)
 at org
.mobicents.slee.resource.map.service.supplementary.wrappers.MAPDialogSupplementaryWrapper.addProcessUnstructuredSSResponse(MAPDialogSupplementaryWrapper.java:81)
 at org
.mobicents.ussdgateway.slee.sip.SipClientSbb.onCallTerminated(SipClientSbb.java:362)
 at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java
.lang.reflect.Method.invoke(Method.java:606)
 at org
.mobicents.slee.runtime.sbbentity.SbbEntityImpl.invokeEventHandler(SbbEntityImpl.java:479)
 at org
.mobicents.slee.runtime.eventrouter.routingtask.EventRoutingTaskImpl.routeQueuedEvent(EventRoutingTaskImpl.java:379)
 at org
.mobicents.slee.runtime.eventrouter.routingtask.EventRoutingTaskImpl.run(EventRoutingTaskImpl.java:126)
 at org
.mobicents.slee.runtime.eventrouter.EventRouterExecutorImpl$EventRoutingTaskStatsCollector.run(EventRouterExecutorImpl.java:76)
 at java
.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at java
.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java
.lang.Thread.run(Thread.java:745)



Charles Roufay

unread,
May 5, 2016, 4:30:15 PM5/5/16
to restcomm
Hi Gennadiy,

How did you initiate the USSD session. Were you using the jSS7 simulator? The simulator has a button that allows you to cancel/close a running USSD session. 

Regards


Charles Roufay
Telestax


On Friday, April 29, 2016 at 6:17:17 AM UTC-6, Gennadiy Dubina wrote:
Hi everyone,

We have ussd gw + restcomm server + backend app to handle ussd flow.  

We would like to have "cancel" button in our menu. 

So on the server side we return the following RCML: <Response></Hangup></Response>
not sure that i can use it with ussd but seems restcomm just send BYE sip message to ussd gw.

in this case ussd gw throws error.
Also i have tried to return empty RCML: <Response></Response>. i have got the same error

So how to stop dialog in correct way?

Log dump:

12:09:13,259 INFO  [SIPTransactionStack] (pool-36-thread-1) <message
from="10.0.0.101:5060"
to
="10.0.0.101:5080"
time
="1461931753259"
isSender
="true"
transactionId
="z9hg4bkb1152f09_57a5b08a_d1fc4865-d016-4545-94a8-45fa4031acc7"

callId
="03bb545d6326b2bc1f473f4bc1f...@10.0.0.101"
firstLine
="SIP/2.0 200 OK"
...

Gennadiy Dubina

unread,
May 5, 2016, 4:57:35 PM5/5/16
to restcomm

My question how to finish dialog from server side?

we would like to have "0 - for cancel" menu item.
so we will gather digits - "0" and we need to provide hangup response. 


четверг, 5 мая 2016 г., 23:30:15 UTC+3 пользователь Charles Roufay написал:

Fernando Mendioroz

unread,
May 5, 2016, 6:40:05 PM5/5/16
to rest...@googlegroups.com

Hi Gennadiy,

 

A “hangup” is not a good analogy for USSD, but a session end (through a TCAP END message, with a MAP processUnstructuredSSRequest operation embedded, see diagram below for a Mobile Originated USSD session). Restcomm generates that SS7 MAP operation by sending a SIP BYE to the USSD Gateway (see attached Wireshark trace). The problem you have is that you’re trying to send an empty USSD string, which is not accepted (if it was, that would not be the proper way to finish a session either, as the user would receive an empty screen in its handset). In the attached trace you can see an easy example where the SIP BYE contains the following in its body (USSD payload is included in SDP within a SIP INVITE/INFO/BYE body for USSI or USSD for the IMS as per 3GPP TS 24.390):

 

Session Initiation Protocol (BYE)

    Request-Line: BYE sip:11...@192.168.93.139:5060 SIP/2.0

    Message Header

    Message Body

        <?xml version='1.0' encoding='UTF-8'?>\n

        <ussd-data>\n

        <language value="en"/>\n

        <ussd-string value="Usted selecciono la opcion 1"/>\n

        <anyExt>\n

        <message-type>processUnstructuredSSRequest_Response</message-type>\n

        </anyExt>\n

        </ussd-data>

 

… which is translated to the following MAP operation inside a TCAP END message by Restcomm USSD Gateway:

 

Transaction Capabilities Application Part

    end

GSM Mobile Application

    Component: returnResultLast (2)

        returnResultLast

            invokeID: 1

            resultretres

                opCode: localValue (0)

                ussd-DataCodingScheme: 0f

                ussd-String: d539bd4c06cdcbecf2789c7ebbdf207618f4868fd36f3728...

                    USSD String: Usted selecciono la opcion 1

 

Try putting a string for that “0- cancel” option, like “Thank you for using the service” or “Goodbye” or whatever (below 160 characters) and surely the problem will go away.

 

 

 

Best regards

Fernando


callId
="03bb545d6326b2bc...@10.0.0.101"
firstLine
="SIP/2.0 200 OK"

>
<![CDATA[SIP/2.0 200 OK


Via: SIP/2.0/UDP 10.0.0.101:5080;branch=z9hG4bKb1152f09_57a5b08a_d1fc4865-d016-4545-94a8-45fa4031acc7
CSeq: 2 BYE

Call-ID: 03bb545d6326b2bc...@10.0.0.101
From: <sip:*333%2...@10.0.0.101:5080>;tag=17975418_507f0f6d_57a5b08a_b1152f09

Content-Length: 0


]]>
</message>


12:09:13,259 INFO  [SipClientSbbImpl] (pool-36-thread-1) Payload <?xml version='1.0' encoding='UTF-8'?>
<ussd-data>
<language value="en"/
>
<ussd-string value=""/>
<anyExt>
<message-type>processUnstructuredSSRequest_Response</message-type>
</
anyExt>
</ussd-data>
12:09:13,260 ERROR [SipClientSbbImpl] (pool-36-thread-1) Error while processing BYE event

RequestEventWrapper[ EVENT[BYE] DIALOG[ClientDialogWrapper[ handle = 03bb545d6326b2bc...@10.0.0.101:9367:null, state = Terminated Dialog, clientTXs = [z9hg4bk-3337-38f2ad8f7e1b2771f2b47227dcdfe442] ]] TX[ServerTransaction[z9hG4bKb1152f09_57a5b08a_d1fc4865-d016-4545-94a8-45fa4031acc7]]]


org
.mobicents.protocols.ss7.map.api.MAPException: Error while encoding the USSDString: data field length must be from 1 to 160 octets
 at org
.mobicents.protocols.ss7.map.primitives.OctetStringBase.encodeData(OctetStringBase.java:135)
 at org
.mobicents.protocols.ss7.map.primitives.OctetStringBase.encodeAll(OctetStringBase.java:122)
 at org
.mobicents.protocols.ss7.map.primitives.OctetStringBase.encodeAll(OctetStringBase.java:114)
 at org
.mobicents.protocols.ss7.map.service.supplementary.ProcessUnstructuredSSResponseImpl.encodeData(ProcessUnstructuredSSResponseImpl.java:163)
 at org
.mobicents.protocols.ss7.map.service.supplementary.MAPDialogSupplementaryImpl.addProcessUnstructuredSSResponse(MAPDialogSupplementaryImpl.java:754)
 at org
.mobicents.slee.resource.map.service.supplementary.wrappers.MAPDialogSupplementaryWrapper.addProcessUnstructuredSSResponse(MAPDialogSupplementaryWrapper.java:81)
 at org
.mobicents.ussdgateway.slee.sip.SipClientSbb.onCallTerminated(SipClientSbb.java:362)
 at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java
.lang.reflect.Method.invoke(Method.java:606)
 at org
.mobicents.slee.runtime.sbbentity.SbbEntityImpl.invokeEventHandler(SbbEntityImpl.java:479)
 at org
.mobicents.slee.runtime.eventrouter.routingtask.EventRoutingTaskImpl.routeQueuedEvent(EventRoutingTaskImpl.java:379)
 at org
.mobicents.slee.runtime.eventrouter.routingtask.EventRoutingTaskImpl.run(EventRoutingTaskImpl.java:126)
 at org
.mobicents.slee.runtime.eventrouter.EventRouterExecutorImpl$EventRoutingTaskStatsCollector.run(EventRouterExecutorImpl.java

...

--
You received this message because you are subscribed to the Google Groups "restcomm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to restcomm+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

image001.emz
image002.png
oledata.mso
TelscaleUSSDgtwy_SIP&MAP_20150509.pcap
Reply all
Reply to author
Forward
0 new messages