Not able to receive calls in softphones

hi i had installed asterisk, i am using Sangoma USB FXO (u100) . i had made a very simple dial plan. i want that calls coming to pstn should be received by extensions which are made in sip and extentions.conf. heres the configuration files

1 /etc/zaptel.conf
2 /etc/asterisk/zapata.conf
3 /etc/asterisk/zapata.confc
4 /etc/asterisk/sip.conf
5 /etc/asterisk/extensions.conf

#######################################################
vi /etc/zaptel.conf

#autogenerated by /usr/sbin/wancfg_zaptel do not hand edit
#autogenrated on 2010-02-09
#Zaptel Channels Configurations
#For detailed Zaptel options, view /etc/zaptel.conf.bak
loadzone=us
defaultzone=us

#Sangoma USB U100 [bus:2-3 span:1]
fxsks=1
fxsks=2
######################################################

vi /etc/asterisk/zapata.conf

;autogenerated by /usr/sbin/wancfg_zaptel do not hand edit
;autogenrated on 2010-02-09
;Zaptel Channels Configurations
;For detailed Zaptel options, view /etc/asterisk/zapata.conf.bak

[trunkgroups]

[channels]
context=default
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no

;Sangoma AU100 [slot:0 bus: span:1]
context=from-zaptel
group=0
signalling = fxs_ks
channel => 1

context=from-zaptel
group=0
signalling = fxs_ks
channel => 2

#######################################################

vi /etc/asterisk/sip.conf

[general]
port = 5060
bindaddr = 0.0.0.0
context = others

[2000]
type=friend
context=my-phones
secret=1234
host=dynamic

[2001]
type=friend
context=my-phones
secret=1234
host=dynamic

######################################################

vi /etc/asterisk/extensions.conf

[others]

[from-zaptel]

exten => _X.,1,Dial(SIP/2000)
exten => _X.,n,Playback(thank-you)
exten => _X.,n,Hangup

[my-phones]
exten => 2000,1,Dial(SIP/2000)
exten => 2001,1,Dial(SIP/2001)

exten => _X.,1,Dial(Zap/1-1/${EXTEN})
exten => _X.,n,Hangup

######################################################

here is the message when i call to PSTN from mobile

[root@localhost ~]# asterisk -vvvvvr
Asterisk 1.4.29, Copyright © 1999 - 2009 Digium, Inc. and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

== Parsing ‘/etc/asterisk/asterisk.conf’: Found
== Parsing ‘/etc/asterisk/extconfig.conf’: Found
Connected to Asterisk 1.4.29 currently running on localhost (pid = 2312)
Verbosity is at least 5
– Starting simple switch on ‘Zap/1-1’
[Jan 2 06:18:01] NOTICE[12066]: chan_dahdi.c:6850 ss_thread: Got event 18 (Ring Begin)…
[Jan 2 06:18:01] NOTICE[12066]: chan_dahdi.c:6850 ss_thread: Got event 17 (Polarity Reversal)…
[Jan 2 06:18:01] NOTICE[12066]: chan_dahdi.c:6850 ss_thread: Got event 18 (Ring Begin)…
== Starting Zap/1-1 at from-zaptel,s,1 failed so falling back to exten ‘s’
== Starting Zap/1-1 at from-zaptel,s,1 still failed so falling back to context ‘default’
[Jan 2 06:18:01] WARNING[12066]: pbx.c:2454 __ast_pbx_run: Channel ‘Zap/1-1’ sent into invalid extension ‘s’ in context ‘default’, but no invalid handler
– Hungup ‘Zap/1-1’
– Starting simple switch on ‘Zap/1-1’

hope some 1 will help me out n tell where i had done mistake.

You dont have defined a DID or the extension ‘s’, the last was a warning in your CLI.

If doesn’t matter what DID is called use the extension ‘s’:

[from-zaptel]
exten=> s,1,wait(2)
same=>n,dial(sip/2000)
same=>n,background(yourivr)

*edit:

[from-zaptel]
exten=> s,1,wait(2)
exten=> s,2,dial(sip/2000)
exten=> s,3,background(yourivr)

thx buddy now i can rceieve calls in exten 2000, but now outgoing is stopped. here is the extentions.conf

vi /etc/asterisk/extensions.conf

[others]

[from-zaptel]

exten => s,1,wait(2)
exten => s,2,dial(sip/2000)
exten => s,3,Playback(tt-weasels)

The rule for extension S only work for incoming calls, add your outgoings rules in your phone context like:

exten=>_9XXX.,1,dial(Zap/1/${EXTEN:1})
exten=>_9XXX.,2,hangup()

hi,
as i told u now i am 2 make and receive calls from exten 2000, i had made two exten - 2000,2001 i can make calls and receive calls from exten 2000 but from exten 2001 i can only make calls, i cant receive calls here is the message when i dial from my mobile to PSTN line i had configured exten - 2001 in softphone

[Jan 2 19:38:01] NOTICE[2823]: chan_dahdi.c:6850 ss_thread: Got event 18 (Ring Begin)…
[Jan 2 19:38:01] NOTICE[2823]: chan_dahdi.c:6850 ss_thread: Got event 17 (Polarity Reversal)…
[Jan 2 19:38:01] NOTICE[2823]: chan_dahdi.c:6850 ss_thread: Got event 17 (Polarity Reversal)…
– Executing [s@from-zaptel:1] Wait(“Zap/1-1”, “2”) in new stack
– Executing [s@from-zaptel:2] Dial(“Zap/1-1”, “sip/2000”) in new stack
[Jan 2 19:38:04] WARNING[2823]: app_dial.c:1296 dial_exec_full: Unable to create channel of type ‘sip’ (cause 20 - Unknown)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@from-zaptel:3] Playback(“Zap/1-1”, “tt-weasels”) in new stack
– <Zap/1-1> Playing ‘tt-weasels’ (language ‘en’)
== Auto fallthrough, channel ‘Zap/1-1’ status is ‘CHANUNAVAIL’
– Hungup ‘Zap/1-1’

here is extensions.conf

vi /etc/asterisk/extensions.conf

[from-zaptel]

exten => s,1,wait(2)
exten => s,2,dial(sip/2000)
exten => s,3,Playback(tt-weasels)

[my-phones]

exten => 2000,1,Answer()
exten => 2000,2,Dial(SIP/2000)

exten => _X.,1,Dial(Zap/1-1/${EXTEN})
exten => _X.,n,Hangup
~

solved the problem by using n in extensions.conf

vi /etc/asterisk/extensions.conf

[from-zaptel]

exten => s,1,wait(2)
exten => s,n,dial(sip/2000)
exten => s,n,dial(sip/2001)
exten => s,n,Playback(tt-weasels)

[my-phones]

exten => 2000,1,Answer()
exten => 2000,2,Dial(SIP/2000)

exten => _X.,1,Dial(Zap/1-1/${EXTEN})
exten => _X.,n,Hangup

thx