Artigos‎ > ‎VoIP‎ > ‎

Asterisk PBX and Linksys SPA-3102


Primeiramente gostaria de salientar que não sou o autor principal do conteúdo deste artigo. A minha intenção é de mostrar o que outros autores tem realizado (referenciando links para o conteúdo original) neste blog até como um guia pessoal para uso próprio e ainda compartilhar minhas anotações e pequenas modificações que realizo no conteúdo, desejando que possa ajudar mais alguém em algum lugar.
First and foremost, I take no credit for any of this post’s content. I am really just taking what others have done (which I have links to bellow) and am putting it on my blog for a personal reference and hopefully the small changes that I made to their guides will help someone somewhere.

link: http://blog.pathennessy.org/2009/01/01/configuring-linksys-spa-3102-for-asterisk/
link: http://forum.voxilla.com/linksys-sipura-voip-support-forum/starter-spa3102-asterisk-setup-18612.html
link: http://www.jmgtechnology.com.au/spa_3000_guide.pdf
link:  http://www.fredshack.com/docs/linksys_3102.html 

Atualize o firmware de seu linksys e depois faça um factory reset: Dial **** to access the IVR. Dial 73738# to perform full factory reset. Dial 1# to confirm.

Configurações da interface web:

Guia Router -> WAN Setup tab
  • Connection Type:DHCP (ajustei o roteador para fixar o MAC 00-0E-08-CB-30-CE com 192.168.1.21)
  • Enable WAN Web Server:yes and port 80
  • HostName "phone21" and Domain "casa.lan"
  • Primary NTP Server:  200.160.0.8  and Secondary NTP Server: 200.189.40.8

Guia Router -> LAN Setup tab
  • Networking Service to "Bridge".
  • Set Enable DHCP Server to "no".
Click "Submit All Changes" button

Guia Voice -> System tab
  • admin password and user password
Click "Submit All Changes" button

Guia Voice -> Sip tab
  • RTP Packet Size: 0.020
Click "Submit All Changes" button

Guia Voice -> Regional tab
  • Vertical Service Activation Codes.  Note: I read a forum post that said to clear all of these out so Asterisk would handle them if entered.  I have not done that yet.
  • Miscellaneous, set the Time Zone.
Click "Submit All Changes" button

Guia Voice -> Line 1 tab
  • NAT Settings.  Note: I did not need to enable the NAT settings.  If you do, you will need to enable all of the NAT and STUN server settings under the SIP tab as well.  See the Admin Guide for more information.
  • Proxy to your Asterisk server hostname and Register to "yes"
  • Make Call Without Reg to "no". and Ans Call Without Reg to "no". Eu deixei como yes e deu certo.
  • Display Name to "phone21" and User Id to "phone21" and Password to something secret
  • Preferred Codec: G711u and Second Preferred Codec: G711a and Use Pref Codec Only: "no" and Third Preferred Codec: G723
  • Dial Plan. "(xx.|<#,:>xx.< :@gw0>)" Significa: digite # para fazer uma chamada pela linha telefonica e digite diretamente o numero desejado para fazer uma chamada voip (se não funcionar tente  (xx.|<#>xx.<:@gw0>). Eu acabei usando o Dial Plan (<:0>xx.|<#,:>xx.< :@gw0>) que coloca um zero antes do numero discado.
  • Emergency Number: 190
Click "Submit All Changes" button

Guia Browse to Voice -> PSTN Line tab
  • Proxy to your Asterisk server hostname and Register to "yes"
  • Make Call Without Reg to "no". and Ans Call Without Reg to "no". Eu deixei como yes e deu certo.
  • Display Name to "pstn21" and User Id to "pstn21" and Password to something secret
  • Dial Plan 1 to "(xx.)"
  • Dial Plan 7 to S0<:s>
  • Dial Plan 8 to "(S0<:61>)"
  • VoIP-To-PSTN Gateway Enable to "yes".
  • Line 1 VoIP Caller DP to "1" and VoIP Caller Default DP to "1"
  • PSTN-To-VoIP Gateway Enable to "yes"
  • PSTN Ring Thru Line 1 to "no"
  • PSTN CID For VoIP CID to "yes"
  • PSTN Caller Default DP to "7"
  • PSTN Answer Delay to "5".  Note: This is to allow enough time for caller id.
If the voip-to-pstn gateway enable is YES then I would check the on-hook and off-hook voltage of the PBX. You can read the voltage on the INFO tab of the SPA attached to the PBX with the circuit on-hook and off-hook. The PSTN Line-in-Use voltage setting on the PSTN tab should be about half way between the two. Standard PSTN voltages are 48v on-hook, about 7v off-hook and the default setting of the pstn line-in-use voltage is 30. This means if the voltage reading is less than 30 the SPA will not take the FXO line off hook to dial a number because it considers the line to be already in use. PBX voltages are often lower than this and the line-in-use setting needs to be adjusted. 
Line-In-Use Voltage: 8

Click "Submit All Changes" button

link:  http://www.planetwayne.com/forums/viewtopic.php?t=287
You may have to play with these to get the spa to detect call ending...
Detect CPC = yes
Detect Polarity Reversal = yes This made the biggest difference with NTL - as soon as the line drops this picks it straight away! I used to use a x100p clone card which took a while to detect disconnection - this is right on the button!
Detect Disconnect Tone = yes 
Brazilian Disconnect Tone = from 480@-30,620@-30;4(.25/.25/1+2) to 425@-19,425@-19;5(.25/.25/1+2) ou 420@8;60(.1/.1/1)

Outros tons brazileiros:
Dial Tone: de 350@-19,440@-19;10(*/0/1+2) para 425@-19;*(9.75/.6/1) ou 425@-19;*(9.75/.6/1)
Outside Dial: de 420@-16;10(*/0/1) para 425@-19;*(*/0/1) ou 425@-19;*(*/0/1)
Busy Tone: de 480@-19,620@-19;10(.5/.5/1+2) para 425@-19;20(.25/.25/1) ou 425@-19;20(.25/.25/1
Reorder Tone: de 480@-19,620@-19;10(.25/.25/1+2) para 425@-19;20(.25/.25/1) ou 425@-19;20(.25/.25/1)
Ring Back Tone: de 440@-19,480@-19;*(2/4/1+2) para 425@-19;60(1/4/1) o 425@-19;60(1/4/1)

Brazil (Federative Republic of) 
Busy tone - 425 0.25 on 0.25 off 
Dial tone - 425 continuous
Dial tone - pabx 425 0.975 on 0.05 off 
Executive override tone - 750 0.02 on 1.0 off 
Function acknowledge tone - 425 0.1 on 0.1 off 0.1 on 2.0 off 
Number unobtainable tone - 425 0.75 on 0.25 off 0.25 on 0.25 off
Pay tone - 300 0.75 on 
Ringing tone - 425 1.0 on 4.0 off 
Waiting tone - 425 0.05 on 1.0 off

link: http://gabrielerich.blogspot.com.br/2012/08/adequacao-padrao-brasileiro-ata-linksys.html
Como existem outros tons entenda o que foi feito para fazer sozinho ou modificar O tom é escrito usando a seguinte sintax: TOMs;COMPORTAMENTO TOMs = freqüência@Volume, freqüência@Volume, .... COMPORTAMENTO = Tempo total de tempo(Tempo de tom/Tempo de silencio/Tom)

Salve as configurações do SPA-3102 acessando:

Agora configurando o Asterisk:

Arquivo sip.conf
 
; Line1 on SPA3102
;
[phone21]
type=friend
host=dynamic
context=internal
username=phone21
secret=secret
callerid="Linha 21" <21>
nat=yes canreinvite=no dtmfmode=rfc2833 qualify=yes disallow=all allow=ulaw
allow=alaw

; PSTN on SPA3102 ; [pstn21] type=friend host=dynamic context=pstn username=pstn21 secret=secret nat=yes canreinvite=no dtmfmode=rfc2833 qualify=yes insecure=port,invite disallow=all allow=ulaw
allow=alaw

[softphone31]
type=friend
context=internal secret=secret callerid="Ademar Arvati" <31> host=dynamic ; This device needs to register
nat=yes
canreinvite=no ; Typically set to NO if behind NAT
disallow=all
allow=gsm allow=ulaw
allow=alaw

Arquivo extensions.conf
 [internal]
;Configurações dos ramais internos
exten => 21,1,Dial(SIP/phone21)  ;send these call to the FXS (Line1) port
exten => 31,1,Dial(SIP/softphone31) ; send these calls to the softphone
;; extension 61 is for incoming PSTN calls
;; in the SPA3102 PSTN tab dialplan S0<:61@asterisk.domain.com>
;; causes the incoming PSTN to VoIP calls to be redirected to this extension

[pstn] exten => 61,1,NoOP(${CALLERID}) ; show the caller ID info in the console exten => 61,n,Ringing() exten => 61,n,Answer() exten => 61,n,Playback(silence/1) exten => 61,n,Playback(pls-wait-connect-call) exten => 61,n,Wait(3) exten => 61,n,Dial(SIP/phone21,60) exten => 61,n,Congestion



registrando em outro sip provider:  http://www.beardy.se/how-to-set-up-a-sip-trunk-in-the-asterisk-pbx 






Comments