[Asterisk-Users] extension and PSTN connection

Ronald Wiplinger ronald at elmit.com
Wed Dec 1 00:55:36 MST 2004


I got two phones on an ATA-186 (601, 602) and two phones on the TDM22B 
(603, 604). I have two lines on the TDM22B.

I cannot figure out some of the problems:

1. 601 dials via ZAP/3-1 to local phone number at PSTN:
ringing
pickup on PSTN  (empty)
still ringing in the phone set 601

2. call from PSTN back:
601 picks up ... everything works !!!
No caller id shows up

3. For testing I have only one phone line plugged into the TDM22B.
If it is the first one ZAP/3 it works, if it is plugged in to ZAP/3 
there is only silent!!!
Is there a settings that it says the line is "broken" or that it goes to 
the second line?

4. If I call from PSTN and do not pickup, but hang up the phone of the 
PSTN, than the phone sets 601 and 603 continue to ring!


below is my zapta.conf and extensions.conf. If you spot other problems, 
please tell me too.



Zapata.conf:
=========

[trunkgroups]

[channels]

usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1

immediate=no
busydetect=yes
callprogress=yes
progzone=tw

context=phone1-outbound
signalling=fxo_ls
immediate=no
busydetect=no
echocancel=yes ; You can set this to 32, 64, 128, tweak to your needs.
echocancelwhenbridge=yes
echotrainig=400 ; Asterisk trains to the beginning of the call, number is in milliseconds
callerid="603 Cordless" <603>
group=1
callgroup=1
pickupgroup=1
 channel => 1              ; dial ZAP/1 to ring this phone

context=phone2-outbound
callerid="604 Private" <604>
 channel => 2              ; dial ZAP/2 to ring this phone 


context=incoming_88097680
signalling=fxs_ls
group=2
usecallerid=no
callerid=asreceived
 channel => 3


context=incoming_88097074
 channel => 4


=============================================================================



extensions.conf:
================



[general]
static=yes
writeprotect=no

[globals]

 ;IAXINFO=xxxxxxxxxxxx:xxxxxxxxxx
 ;FWDNUMBER=xxxxxxxxx
 ;FWDPASSWORD=xxxxxxxxxxxxx
 ;NUFONEUSER=xxxxxxxxxxx
 ;INTERCOMPASSWORD=xxxxxxxxxxxxx
 ;IAXCOMMPASSWORD=xxxxxxxxxxxxxx
#include "passwords"   ; above info is in that file!

CONSOLE=Console/dsp				; Console interface for demo
TRUNK=Zap/g1					; Trunk interface
TRUNKMSD=1					; MSD digits to strip (usually 1 or 0)
FWDCIDNAME="Ronald Wiplinger"
FWDRINGS=sip/601
FWDVMBOX=601                                    ; CHANGE THAT !!!

PHONE_601=SIP/601				; office 601  Ronald
PHONE_602=SIP/602				; office 602  Ronald
PHONE_603=ZAP/1					; living room 603 cordless
PHONE_604=ZAP/2					; bed room 604
PHONE_610=IAX2/610				; soft phone PC	

PHONE_710=IAX/610				; soft phone PC 610's Intercom

LINE_TPE_1=ZAP/3				; Taipei +886 2 8809-7680
LINE_TPE_2=ZAP/4				; Taipei +886 2 8809-7074

PSTN=ZAP/g2

[phone1-outbound]
exten => s,1,DigitTimeout,2				; give them 2 seconds between digits
exten => s,2,ResponseTimeout,30				; give them 30 seconds to make a choice
exten => _9N.,1,Macro(dial-pstn,${EXTEN:1},${LONGTIMEOUT})
exten => _91NN,1,Macro(dial-pstn,${EXTEN:1},${LONGTIMEOUT})
exten => _90X.,1,Macro(dial-pstn,${EXTEN:1},${LONGTIMEOUT})
exten => _9008X.,1,Macro(dial-pstn,${EXTEN:1},${LONGTIMEOUT})
exten => _90204X.,1,Congestion
include => inhouse
exten => i,1,Background(invalid)			; "That's not valid, try again"
exten => i,2,Background(silence/1)
exten => i,3,Goto(s,1)

[phone2-outbound]
exten => s,1,DigitTimeout,2				; give them 2 seconds between digits
exten => s,2,ResponseTimeout,30				; give them 30 seconds to make a choice
exten => _9N.,1,Macro(dial-pstn,${EXTEN},${LONGTIMEOUT})
exten => _91NN,1,Macro(dial-pstn,${EXTEN},${LONGTIMEOUT})
exten => _90X.,1,Macro(dial-pstn,${EXTEN},${LONGTIMEOUT})
exten => _9008X.,1,Macro(dial-pstn,${EXTEN},${LONGTIMEOUT})
exten => _90204X.,1,Congestion
include => inhouse
exten => i,1,Background(invalid)			; "That's not valid, try again"
exten => i,2,Background(silence/1)
exten => i,3,Goto(s,1)

[macro-dial-pstn];
exten => s,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s,2,Dial(${PSTN}/w${ARG1},${ARG2})
exten => s,3,NoOp(${DIALSTATUS})
exten => s,4,Goto(s-${DIALSTATUS},1)
exten => s,103,NoOp(${DIALSTATUS})
exten => s,104,Goto(s-${DIALSTATUS},1)
exten => s-BUSY,1,BackGround(the-party-you-are-calling)
exten => s-BUSY,2,BackGround(is-curntly-busy)
exten => s-BUSY,3,SetGlobalVar(FOUNDME=BUSY)
exten => s-BUSY,4,Goto(s-CLEANEXIT,1)
exten => s-CANCEL,1,BackGround(canceled)
exten => s-CANCEL,2,SetGlobalVar(FOUNDME=CANCEL)
exten => s-CANCEL,3,Goto(s-CLEANEXIT,1)
exten => s-CHANUNAVAIL,1,BackGround(channel)
exten => s-CHANUNAVAIL,2,BackGround(is-curntly-unavail)
exten => s-CHANUNAVAIL,3,SetGlobalVar(FOUNDME=CHANUNAVAIL)
exten => s-CHANUNAVAIL,4,Goto(s-CLEANEXIT,1)
exten => s-CONGESTION,1,BackGround(channel)
exten => s-CONGESTION,2,BackGround(is-curntly-unavail)
exten => s-CONGESTION,3,SetGlobalVar(FOUNDME=CHANUNAVAIL)
exten => s-CONGESTION,4,Goto(s-CLEANEXIT,1)
exten => s-NOANSWER,1,BackGround(nbdy-avail-to-take-call)
exten => s-NOANSWER,2,SetGlobalVar(FOUNDME=NOANSWER)
exten => s-NOANSWER,3,Goto(s-CLEANEXIT,1)
exten => s-ANSWER,1,SetGloabalVar(FOUNDME=ANSWER)
exten => s-ANSWER,2,Goto(s-CLEANEXIT,3)
exten => s-.,1,BackGround(something-terrible-wrong)
exten => s-.,2,NoOp(${DIALSTATUS)
exten => s-.,3,SetGlobalVar(FOUNDME=ERROR)
exten => s-.,4,Goto(s-CLEANEXIT,1)
exten => s-CLEANEXIT,1,NoOp
exten => s-CLEANEXIT,2,Hangup
exten => s-CLEANEXIT,3,NoOp

[default]
include => inhouse
include => phone1-outbound
include => phone2-outbound

[inhouse]
exten => 601,1,Dial(${PHONE_601},60,tr)
exten => 601,2,Voicemail,u601
exten => 601,102,Voicemail,b601
exten => 602,1,SetVar(ALERT_INFO=Bellcore-dr3)
exten => 602,2,Dial(${PHONE_602},60,trm)
exten => 602,3,Voicemail,u602
exten => 602,103,Voicemail,b602
exten => 603,1,Dial(${PHONE_603},60,tr)
exten => 603,2,Voicemail,u603
exten => 603,102,Voicemail,b603
exten => 604,1,Dial(${PHONE_604},60,tr)
exten => 604,2,Voicemail,u604
exten => 604,102,Voicemail,b604

[Grandstream]
exten => 608,1,Dial(${PHONE_608},60,tr)
exten => 608,2,Voicemail,u608
exten => 608,103,Voicemail,b608

exten => 609,1,Dial(${PHONE_609},60,tr)
exten => 609,2,Voicemail,u609
exten => 609,103,Voicemail,b609


[incoming_88097680]
 exten => s,1,NoOp
 exten => s,2,NoOp
 exten => s,3,NoOp
 exten => s,4,GotoIfTime(08:00-21:20|sun-sat|*|*?house-day,s,1)
 exten => s,5,Goto(house-night,s,1)

[incoming_88097074]
 exten => s,1,Goto(incoming_88097680,s,1)

[house-day]
 exten => s,1,Answer
exten => s,2,NoOp 
exten => s,3,NoOp
 exten => s,4,Dial(${PHONE_601}&${PHONE_603},30,tr)  ; ring phone_601 & 603 for 30 seconds
 exten => s,5,VoiceMail(u${DefaultVM})  ; if no one answers send to
 exten => s,105,VoiceMail(b${DefaultVM})  ; if busy send to voicemail

[house-night]
 exten => s,1,Answer
 exten => s,2,NoOp
 exten => s,3,NoOp
 exten => s,4,Dial(${PHONE_601}&${PHONE_603}&${PHONE_604},30,tr)  
 exten => s,5,VoiceMail(u${DefaultVM})  ; no one answers so send to
 exten => s,6,Hangup



-- 
Ronald Wiplinger  (CEO of ELMIT)
http://www.elmit.com    +886 (0) 939--77-55-16
- I'm a SpamCon Foundation Member, #694, Verify it at http://www.spamcon.org


PS: Spam prevention!
Our system is protected with a spam prevention program. 
If you send us an e-mail, our system will send you a confirmation message back. Just reply to this confirmation message please. 
After receiving this confirmation message, our system will send the hold message (one) and all future messages (after the received confirmation message) to me without asking you again.





More information about the asterisk-users mailing list