Problems with POTS line through tdm card


#1

Hi all,
I’ve configured my asterisk to communicate with the POTS line through the tdm card. I’ve two problems and very indeed in need of your help.
First, whenever I place call from the pots line to my asterisk, I always receice tone ringing for 2 times before entering welcome message in the [from-pstn] context in extensions.conf ([from-pstn]: context for incoming call from pots line). It’s my desire that the pots caller will hear the welcom in [from-pstn] immediatly after dialling the digits, without hearing the tone ringing for 2 times.

Second, and disturbs me most, is as follow:
I place a call to asterisk from the pots line.
As receiving the call, Asterisk rings the sip phone [200] in my asterisk system
Then I hang up the pots line immediatly (or for a while later) without picking up the Sip phone.
As a really unexpected fact, the Sip phone continues to ring, ring, and ring...for few seconds (about 3,5, or nearly 10 s...).  :cry: 
I wants the sip phone to stop ringing immediatly right after I hang up the pots phone.
I think something wrong with my zapata.conf, but I couldn't figure it out.
Here is my zapata.conf

zapata.conf
[trunkgroups]
; define any trunk groups

[channels]
; hardware channels

; default
usecallerid=yes
hidecallerid=no
callwaiting=no
transfer=yes
echocancel=yes
echotraining=yes
echotraining=400

; define channels

context=from-pstn ; Incoming calls go to [from-pstn] in extensions.conf
signalling=fxs_ks ; Use FXS signalling for an FXO channel
group=1
channel => 3 ; PSTN attached to port 3

context=from-pstn ; Incoming calls go to [from-pstn] in extensions.conf
signalling=fxs_ks ; Use FXS signalling for an FXO channel
group=1
channel => 4 ; PSTN attached to port 4

and my extensions.conf

[from-pstn]
exten => s,1,Answer()
exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
exten => s,n,Background(welcome-demo)
exten => s,n,WaitExten ; Wait for an extension to be dialed

exten => 200,1,Dial(SIP/200,60)
exten => 200,2,Hangup()
exten => 201,1,Dial(SIP/201,60)
exten => 201,2,Hangup()
exten => t,1,Goto(s,1)

  Any help would be much appreciated.
  Grenouille