Skip to content

Instantly share code, notes, and snippets.

@libbkmz
Created September 14, 2014 08:53
Show Gist options
  • Save libbkmz/9662ccd76958d6121599 to your computer and use it in GitHub Desktop.
Save libbkmz/9662ccd76958d6121599 to your computer and use it in GitHub Desktop.
[general]
interval=10 ; 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=default ; context for incoming calls
group=0 ; calling group
rxgain=3 ; increase the incoming volume; may be negative
txgain=3 ; 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=+375441111111 ; exten for start incoming calls, only in case of Subscriber Number not available!, also set to CALLERID(ndid)
dtmf=inband ; 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
[dongle0]
audio=/dev/ttyUSB1 ; tty port for audio connection; no default value
data=/dev/ttyUSB2 ; tty port for AT commands; no default value
context=dongle-incoming; контекст
group=0
; 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=123456789012345 ; выставлены - правильно
imsi=123456789012345 ; выставлены - правильно - здесь не показываю просто
; 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
[general]
static=yes
writeprotect=no
clearglobalvars=no
[globals]
CONSOLE=Console/dsp
[dongle-incoming-ussd]
exten => ussd,1,Noop(Incoming USSD: ${BASE64_DECODE(${USSD_BASE64})})
exten => ussd,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME}: ${BASE64_DECODE(${USSD_BASE64})}' >> /var/log/asterisk/ussd.txt)
exten => ussd,n,Hangup()
[dongle-incoming-sms]
exten => sms,1,Noop(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})})
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)
exten => sms,n,Hangup()
[dongle-incoming]
include => dongle-incoming-ussd
include => dongle-incoming-sms
;exten => +375441111111,1,Hangup()
exten => +375441111111,1,NoOp()
same => n,Wait(1)
;same => n,Answer()
;same => n,WaitExten(35)
;exten => _7XXXXXXXXXX,1,NoOp()
;same => n,Dial(SIP/10)
;same => n,Dial(SIP/74951234567@zadarma)
same => n,Dial(SIP/00000@zadarma)
same => n,Hangup()
[default]
exten => 10,1,Dial(Dongle/dongle0/1111111)
exten => 00000,1,Dial(SIP/00000@zadarma)
[general]
limitonpeer=yes
notifyringing=yes
notifyhold=yes
allowsubscribe=yes
context=default
allowguest=no ; no guests
allowoverlap=no ; allow call with additional numbers -> no
alwaysauthreject=yes ; all errors from client gives to him as auth errors(yes), no - disabling this feature
; defaultexpiry=360 ; interval mandatory registration
callevents=yes ; for future. For activating music on hold
tcpenable=yes ; enabling TCP for SIP
rtptimeout=60 ; timeout before kick
language=ru ; language for voice subsystem
bindport=5060
bindaddr=0.0.0.0
;srvlookup=yes ; searching for server address by username <testuser@domain.com>
tos_sip=cs3
tos_audio=ef
match_auth_username=yes
;video=yes
;videosupport=yes
; echocancel=yes
; echocancelwhenbridged=yes
disallow=all
;allow=alaw
;allow=g729
;allow=g723
;allow=ulaw
canreinvite=no
pedantic=no
[zadarma-tpl](!)
type=friend
host=sipde.zadarma.com
fromdomain=sip.zadarma.com
nat=force_rport,comedia
;directmedia=nonat
;nat=yes
dtmfmode=rfc2833
insecure=invite
canreinvite=no
qualify=yes
disallow=all
allow=alaw
allow=ulaw
allow=gsm
[zadarma](zadarma-tpl)
context=from-zadarma
username=11111
secret=xxxxx
fromuser=11111
[defaults](!)
canreinvite=no
disallow=all
;allow=g729
allow=alaw
allow=ulaw
;allow=ilbc
;allow=g726
;allow=g723
;allow=g722
allow=gsm
nat=force_rport,comedia
directmedia=nonat
[peer](!,defaults)
type=friend
dtmfmode=rfc2833
host=dynamic
qualify=yes
call-limit=3
busylevel=1
rtpkeepalive=5
[10](peer) ; username
callerid=username
defaultuser=username
secret=00000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment