Sample dongle.conf and dialplan that works for me

4,138 views
Skip to first unread message

Robert Nediyakalaparambil

unread,
Feb 26, 2014, 4:41:01 AM2/26/14
to chan_...@googlegroups.com
Here are the samples. Please note that I patched chan dongle to get SMS with Alphanumeric CallerID to work, but that should not matter.

dongle.conf:


[general]

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

;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
;jbenable = yes                        ; Enables the use of a jitterbuffer on the receiving side of a
                                ; Dongle channel. Defaults to "no". An enabled jitterbuffer will
                                ; be used only if the sending side can create and the receiving
                                ; side can not accept jitter. The Dongle channel can't accept jitter,
                                ; thus an enabled jitterbuffer on the receive Dongle side will always
                                ; be used if the sending side can create jitter.

;jbforce = no                        ; Forces the use of a jitterbuffer on the receive side of a Dongle
                                ; channel. Defaults to "no".

;jbmaxsize = 200                ; Max length of the jitterbuffer in milliseconds.

;jbresyncthreshold = 1000        ; Jump in the frame timestamps over which the jitterbuffer is
                                ; resynchronized. Useful to improve the quality of the voice, with
                                ; big jumps in/broken timestamps, usually sent from exotic devices
                                ; and programs. Defaults to 1000.

;jbimpl = fixed                        ; Jitterbuffer implementation, used on the receiving side of a Dongle
                                ; channel. Two implementations are currently available - "fixed"
                                ; (with size always equals to jbmaxsize) and "adaptive" (with
                                ; variable size, actually the new jb of IAX2). Defaults to fixed.

;jbtargetextra = 40                ; This option only affects the jb when 'jbimpl = adaptive' is set.
                                ; The option represents the number of milliseconds by which the new jitter buffer
                                ; will pad its size. the default is 40, so without modification, the new
                                ; jitter buffer will set its size to the jitter value plus 40 milliseconds.
                                ; increasing this value may help if your network normally has low jitter,
                                ; but occasionally has spikes.

;jblog = no                        ; Enables jitterbuffer frame logging. Defaults to "no".
;-----------------------------------------------------------------------------------

[defaults]
; now you can set here any not required device settings as template
;   sure you can overwrite in any [device] section this default values

context=dongle-in                        ; context for incoming calls
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                        ; disable of SMS reading from device when received
                                ;  chan_dongle has currently a bug with SMS reception. When a SMS gets in during a
                                ;  call chan_dongle might crash. Enable this option to disable sms reception.
                                ;  default = 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=80                ; minimal DTMF tone duration in ms
mindtmfinterval=200                ; minimal interval between ends of DTMF of same digits in ms

callwaiting=auto                ; if 'yes' allow incoming calls waiting; by default use network settings
                                ; if 'no' waiting calls just ignored
disable=no                        ; OBSOLETED by initstate: if 'yes' no load this device and just ignore this section

initstate=start                        ; specified initial state of device, must be one of 'stop' 'start' 'remote'
                                ;   'remove' same as 'disable=yes'

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

dtmf=relax                        ; control of incoming DTMF detection, possible values:
                                ;   off           - off DTMF tones detection, voice data passed to asterisk unaltered
                                ;              use this value for gateways or if not use DTMF for AVR or inside dialplan
                                ;   inband - do DTMF tones detection
                                ;   relax  - like inband but with relaxdtmf option
                                ;  default is 'relax' by compatibility reason

; dongle required settings
[gsm-v]
audio=/dev/ttyUSB1                ; tty port for audio connection;         no default value
data=/dev/ttyUSB2                ; tty port for AT commands;                 no default value

; or you can omit both audio and data together and use imei=123456789012345 and/or imsi=123456789012345
;  imei and imsi must contain exactly 15 digits !
;  imei/imsi discovery is available on Linux only
imei=<use your own>
imsi=<use your own>

; if audio and data set together with imei and/or imsi audio and data has precedence
;   you can use both imei and imsi together in this case exact match by imei and imsi required

Dialplan snippets / extensions.conf:

[dongle-in] 
exten => sms,1,Verbose(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})}) 
;exten => sms,n,Set(MESSAGE(body)=Incoming GSM Vodafone SMS: ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME} - ${CALLERID(num)}: ${BASE64_DECODE(${SMS_BASE64})})
;exten => sms,n,MessageSend(xmpp:max...@gmail.com,xmpp:google)
exten => sms,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME} - ${CALLERID(num)}: ${BASE64_DECODE(${SMS_BASE64})}' >> /var/log/asterisk/sms.txt) ; be careful this may not be safe if sms/ussd contains shell code
exten => sms,n,Hangup() 

exten => ussd,1,Verbose(Incoming USSD: ${BASE64_DECODE(${USSD_BASE64})}) 
;exten => ussd,n,Set(MESSAGE(body)=Incoming GSM Vodafone USSD: ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME}: ${BASE64_DECODE(${USSD_BASE64})})
;exten => ussd,n,MessageSend(xmpp:max...@gmail.com,xmpp:google)
exten => ussd,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME}: ${BASE64_DECODE(${USSD_BASE64})}' >> /var/log/asterisk/ussd.txt) ; be careful this may not be safe if sms/ussd contains shell code
exten => ussd,n,Hangup() 

exten => s,1,NoOp(Inbound GSM Vodafone Call to: ${EXTEN} / Caller-ID: ${CALLERID(num)})
;exten => s,2,Macro(automon)
;exten => s,3,Set(MESSAGE(body)=Incoming Vodafone GSM Call: ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME} - Caller-ID: ${CALLERID(all)})
;exten => s,4,MessageSend(xmpp:max...@gmail.com,xmpp:google)
exten => s,5,GotoIf($["${CALLERID(num):0:4}" = "9114"]?9:6)  ; divert spam calls starting with 9114 to speaker extension on computer / not needed
exten => s,6,GotoIf($["${CALLERID(num):0:12}" = "<any number>"]?9:7) ; divert this particular number (fill any number) to speaker on computer / not needed
exten => s,7,Dial(SIP/<your exten / id>)
exten => s,8,Hangup()
;exten => s,9,Set(MESSAGE(body)=Incoming Vodafone GSM Spam Call: ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME} - Caller-ID: ${CALLERID(all)})
;exten => s,10,MessageSend(xmpp:max...@gmail.com,xmpp:google)
exten => s,11,Dial(console/dsp,20,A(beep))
exten => s,12,Hangup()

write...@gmail.com

unread,
Aug 12, 2018, 3:02:43 PM8/12/18
to dongle
Hello
I am using pbx in flash (freepbx). Where do i place this context for 'from-internal' in extentions_coustom.conf? I stuck last few month, please help me.
Do you get sms & ussd in ussd.text file only or get softphone side too?
;exten => sms,n,MessageSend(xmpp:...@gmail.com,xmpp:google)
exten => sms,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME} - ${CALLERID(num)}: ${BASE64_DECODE(${SMS_BASE64})}' >> /var/log/asterisk/sms.txt) ; be careful this may not be safe if sms/ussd contains shell code
exten => sms,n,Hangup() 

exten => ussd,1,Verbose(Incoming USSD: ${BASE64_DECODE(${USSD_BASE64})}) 
;exten => ussd,n,Set(MESSAGE(body)=Incoming GSM Vodafone USSD: ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME}: ${BASE64_DECODE(${USSD_BASE64})})
;exten => ussd,n,MessageSend(xmpp:max...@gmail.com,xmpp:google)
exten => ussd,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME}: ${BASE64_DECODE(${USSD_BASE64})}' >> /var/log/asterisk/ussd.txt) ; be careful this may not be safe if sms/ussd contains shell code
exten => ussd,n,Hangup() 

exten => s,1,NoOp(Inbound GSM Vodafone Call to: ${EXTEN} / Caller-ID: ${CALLERID(num)})
;exten => s,2,Macro(automon)
;exten => s,3,Set(MESSAGE(body)=Incoming Vodafone GSM Call: ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME} - Caller-ID: ${CALLERID(all)})
;exten => s,4,MessageSend(xmpp:...@gmail.com,xmpp:google)
exten => s,5,GotoIf($["${CALLERID(num):0:4}" = "9114"]?9:6)  ; divert spam calls starting with 9114 to speaker extension on computer / not needed
exten => s,6,GotoIf($["${CALLERID(num):0:12}" = "<any number>"]?9:7) ; divert this particular number (fill any number) to speaker on computer / not needed
exten => s,7,Dial(SIP/<your exten / id>)
exten => s,8,Hangup()
;exten => s,9,Set(MESSAGE(body)=Incoming Vodafone GSM Spam Call: ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME} - Caller-ID: ${CALLERID(all)})
;exten => s,10,MessageSend(xmpp:...@gmail.com,xmpp:google)
Reply all
Reply to author
Forward
0 new messages