How to browse throught USSD menu on softphone side (Dongle, GSM)

The problem is that if I execute the command over CLI (Asterisk 13.19):

dongle ussd dongle0 *100#

I got the menu without problem, and if I do again:

dongle ussd dongle0 5

Then I can nicely browse over USSD menu.

The main problem is that if I execute this over my SIP phone (CSIPSimple, Zoiper), the USSD code are sent with command:

exten => _*.,1,DongleSendUSSD(dongle0,${EXTEN})

and I can see in the CLI window, but nothing comming back to my client (Softphone).
What I need to add, change in dialplan to be able to browse USSD menu drom client side?
If some log is need it I will show!
Thx

Anyone?
Any kind of help!

I doubt if any chan_dongle user regularly reads this forum, and I believe it is community supported code, so the Digium people here probably know little about it.

Can u suggest me where to look for help?

I’ll confirm that; our knowledge of chan_dongle is zilch. I’ve heard of it. :wink:

Yes I understand…but maybe uyou can help me to understand better the error message os Asterisk itself. When I execute command:

exten => _*.,1,DongleSendUSSD(dongle0,${EXTEN})

I got message (at the end):

[Apr  5 16:42:05] WARNING[15496][C-0000000f]: pbx.c:4416 __ast_pbx_run: Channel 'Local/ussd@from-gsm-00000007;1' sent to invalid extension but no invalid handler: context,exten,priority=from-gsm,ussd,1
       > 0xb6521fa0 -- Strict RTP learning after remote address set to: 192.168.xx.xxx:4012
    -- Executing [*797#@from-sip-phone:1] DongleSendUSSD("SIP/myusername-00000006", "dongle0,*797#") in new stack
    -- Auto fallthrough, channel 'SIP/myusername-00000006' status is 'UNKNOWN'
    -- [dongle0] Successfully sent USSD 0xb6100488
[Apr  5 16:42:03] NOTICE[3553]: at_response.c:266 at_response_ok: [dongle0] Successfully sent USSD 0xb6100488
 [dongle0] Got USSD type 1 'USSD Request': 'mts vodic
 Stanje: 13.6 din. (bez PDV-a)
 Izaberite:
 
 1. Stanje racuna
 2. Roming
 3. Roming DATA dodaci
 4. Nacionalni DATA dodaci
 5. Pripejd dopuna
 6. Usluge
 '
[Apr  5 16:42:05] WARNING[15496][C-0000000f]: pbx.c:4416 __ast_pbx_run: Channel 'Local/ussd@from-gsm-00000007;1' sent to invalid extension but no invalid handler: context,exten,priority=from-gsm,ussd,1

Why?
What is here wrong?
I sending only one message in dialplan!

You need to provide that error message in the context of the rest of the logging.

My guess is that it is saying that something, possibly internal chan_dongle, tried to start a local channel at the ussd extension in the from-gsm context, but there was either no from-gsm context, or that context did not have a ussd extension.

1 Like

Thank for trying helping me…
I did it and it work.
So the main asking of USSD code going through dialpad, and the answer comes as “message” on softphone. All the browsing through the USSD menu continuing through “message” of softphone. I personally using CSIPSimple apk.
Here is mine extension:
dongle.conf

[general]

interval=5			; Number of seconds between trying to connect to devices

;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
jbenable = yes
jbforce = no
jbmaxsize = 200
jbresyncthreshold = 1000
jbimpl = fixed
;jbtargetextra = 40	
;jblog = no
;-----------------------------------------------------------------------------------
[defaults]

group=0				; calling group
rxgain=0			; increase the incoming volume; may be negative
txgain=0			; increase the outgoint volume; may be negative
autodeletesms=yes		; auto delete incoming sms
resetdongle=yes			; reset dongle during initialization with ATZ command
u2diag=-1			; set ^U2DIAG parameter on device (0 = disable everything except modem function) ; -1 not use ^U2DIAG command
usecallingpres=yes		; use the caller ID presentation or not
callingpres=allowed_passed_screen ; set caller ID presentation		by default use default network settings
disablesms=no

language=en			; set channel default language
smsaspdu=yes			; if 'yes' send SMS in PDU mode, feature implementation incomplete and we strongly recommend say 'yes'
mindtmfgap=45			; minimal interval from end of previews DTMF from begining of next in ms
mindtmfduration=8000		; minimal DTMF tone duration in ms
mindtmfinterval=200		; minimal interval between ends of DTMF of same digits in ms

callwaiting=auto
disable=no

initstate=start

;exten=+xxxxxxxxxxxxx		; exten for start incoming calls, only in case of Subscriber Number not available!, also set to CALLERID(ndid)

dtmf=off

; dongle required settings
[dongle0]
audio=/dev/DONGLE-3G-MODEM-1		; tty port for audio connection
data=/dev/DONGLE-3G-MODEM-2			; tty port for AT commands
context=from-gsm			 ; context for incoming calls

sip.conf

[general]

dtmfmode=info
relaxdtmf=no
alwaysauthreject=yes

externhost=my_dns:my_udp_port
localnet = 192.168.xx.0/255.255.255.0
bindaddrr=0.0.0.0
bindport = my_udp_port
tcpbindaddr=0.0.0.0:my_tcp_port
tcpenable = yes
externtcpport = my_tcp_port
transport=udp,tcp
keepalive=yes
directmedia=no
defaultexpiry = 3600

canreinvite = no
subscribe_network_change_event = yes

disallow = all
allow = g729
;allow = gsm
;allow = ulaw
;allow = alaw
nat=force_rport,comedia

textsupport=yes
accept_outofcall_message = yes                                                                                                                                  

[username]
context=from-gsm
outofcall_message_context=from-gsm
context=from-sip-phone

host = dynamic
type = friend
mailbox=xxx@default
username=username
secret=password
qualifyfreq=30
busylevel=1

and extension.conf:

[globals]

[general]
autofallthrough=yes


[dongle-incoming-sms]
exten => sms,1,Set(MESSAGE(body)=${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,Noop(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,System(echo '${STRFTIME(${EPOCH},,%d.%m.%Y %H:%M:%S)} From: ${CALLERID(num)}: ${BASE64_DECODE(${SMS_BASE64})}' >> /var/log/asterisk/incoming-sms.txt)
exten => sms,n,MessageSend(sip:username,"${CALLERID(num)}"<${CALLERID(num)}>)
exten => sms,n,NoOp(Send status: ${MESSAGE_SEND_STATUS})
exten => sms,n,Hangup()

[dongle-outgoing-sms]
exten => _X.,1,NoCDR
exten => _X.,n,NoOp(SMS receiving dialplan invoked)
exten => _X.,n,NoOp(To ${MESSAGE(to)})
exten => _X.,n,NoOp(From ${MESSAGE(from)})
exten => _X.,n,NoOp(Body ${MESSAGE(body)})
exten => _X.,n,Set(IS_IT_ZERO=${EXTEN:0:1})
exten => _X.,n,GotoIf($[${IS_IT_ZERO} = 0]?8:13)
exten => _X.,n,Set(CHANGED_NO=$[381${EXTEN:1}])
exten => _X.,n,NoOp(Number is:${CHANGED_NO})
exten => _X.,n,DongleSendSMS(dongle0,${CHANGED_NO},${MESSAGE(body)},1440,yes)
exten => _X.,n,System(echo '${STRFTIME(${EPOCH},,%d.%m.%Y %H:%M:%S)} - To: ${EXTEN} - Message: ${MESSAGE(body)} ' >> /var/log/asterisk/outgoing-sms.txt)
exten => _X.,n,Hangup()
exten => _X.,n,DongleSendSMS(dongle0,${EXTEN},${MESSAGE(body)},1440,yes)
exten => _X.,n,System(echo '${STRFTIME(${EPOCH},,%d.%m.%Y %H:%M:%S)} - To: ${EXTEN} - Message: ${MESSAGE(body)} ' >> /var/log/asterisk/outgoing-sms.txt)
exten => _X.,n,Hangup()

[dongle-outgoing-sms-plus-prefix]
exten => _+X.,1,NoCDR
exten => _+X.,n,NoOp(SMS receiving dialplan invoked)
exten => _+X.,n,NoOp(To ${MESSAGE(to)})
exten => _+X.,n,NoOp(From ${MESSAGE(from)})
exten => _+X.,n,NoOp(Body ${MESSAGE(body)})
;dongle sms dongle0 +XXXXXXXXXX From:+XXXXXXXXXX Msg:testing 123
exten => _+X.,n,Set(IS_IT_ZERO=${EXTEN:0:1})
exten => _+X.,n,GotoIf("$[${IS_IT_ZERO}" = "+"]?8:12)
exten => _+X.,n,Set(CHANGED_NO=$[${EXTEN:1}])
exten => _+X.,n,NoOp(Number is:${CHANGED_NO})
exten => _+X.,n,DongleSendSMS(dongle0,${CHANGED_NO},${MESSAGE(body)},1440,yes)
exten => _+X.,n,System(echo '${STRFTIME(${EPOCH},,%d.%m.%Y %H:%M:%S)} - To: ${EXTEN} - Message: ${MESSAGE(body)} ' >> /var/log/asterisk/outgoing-sms.txt)
exten => _+X.,n,Hangup()

[from-gsm]
exten => s,1,System(echo '${STRFTIME(${EPOCH},,%d.%m.%Y %H:%M:%S)} - Incoming call from: ${CALLERID(num}' >> /var/log/asterisk/incoming-calls.txt)
exten => s,n,Dial(SIP/username)
exten => s,n,Hangup()

; This part commuicate over message at softphone side
exten => asterisk,1,Answer()
exten => asterisk,n,DongleSendUSSD(dongle0,${MESSAGE(body)})
exten => asterisk,n,NoOp(Number is:${MESSAGE(body)})
exten => asterisk,n,MessageSend(sip:username)
exten => asterisk,n,Hangup

include => dongle-incoming-sms
include => dongle-outgoing-sms
include => dongle-incoming-ussd
include => dongle-outgoing-sms-plus-prefix



[from-sip-phone]
exten => _0[1,2,3,6,800].,1,System(echo '${STRFTIME(${EPOCH},,%d.%m.%Y %H:%M:%S)} - Called Number: ${EXTEN}' >> /var/log/asterisk/outgoing-calls.txt)
exten => _0[1,2,3,6,800].,n,Dial(Dongle/dongle0/${EXTEN})
exten => _0[1,2,3,6,800].,n,Hangup()

exten => _+381[1,2,3,6,800].,1,System(echo '${STRFTIME(${EPOCH},,%d.%m.%Y %H:%M:%S)} - Called Number: ${EXTEN}' >> /var/log/asterisk/outgoing-calls.txt)
exten => _+381[1,2,3,6,800].,n,Dial(Dongle/dongle0/${EXTEN})
exten => _+381[1,2,3,6,800].,n,Hangup()

; -------------------------------   This part is responsable for sending USSD code from dialpad, and replay creating message on softphone.   ------------------------------------
; Browsing through USSD menu will continue in message part of softphone app
exten => _*.,1,DongleSendUSSD(dongle0,${EXTEN})

[dongle-incoming-ussd]
exten => ussd,1,Noop(Incoming USSD: ${BASE64_DECODE(${USSD_BASE64})})
exten => ussd,n,Set(ussd_multiline=${BASE64_DECODE(${USSD_BASE64})})
exten => ussd,n,Set(MESSAGE(body)=${ussd_multiline})
exten => ussd,n,MessageSend(sip:username,[username]); Message form is: MessageSend(to,[from])
exten => ussd,n,Hangup()
;--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------