Help with DID landing on Linksys IP phone

Hey all, I’m new to asterisk and can’t seem to get my ip phone to accept a call from a pstn did on our pri.

My sip.conf file contains:
[general]
; only allow registered users and registered users use default context
allowguest=no
context=agi
externip=[my externip]
localnet=[my gateway]/255.255.255.0
; deny access from all
;deny=0.0.0.0/0.0.0.0
disallow=all
allow=ulaw
allow=alaw
allow=g729
allow=gsm
port=5060

[2001]
type=friend
host=dynamic
permit=[my ip phone’s ip]
username=2001
secret=password
callerid="Roger 2001"
dtmfmode=inband
canreinvite=yes
;nat=yes

My phone is connect to the same lan as my asterisk server and my phone is configured on the ext 1 page to match the user id and password as specified in my sip.conf. When I press the ext1 key on my ip phone I do get dialtone.

My extensions.conf contains:

exten => _5191233,1,Answer()
exten => _5191233,n,Dial(SIP/2001,20)
exten => _5191233,n,hangup()

Where 5191233 is the DID that lands on the pri.

When I dial that DID expecting it to land on my sip phone, I get the error:
spawn extension (from-pstn, 5191233, 3) exited non-zero on dahdi/2-1

1)How do I get it to ring on my ip phone?
2)What is the command to record all incoming calls?
3)If I’m on the call with a caller and a second caller calls in, can I get to ring on ext2 on my ip-phone?
4)Can I put the first caller on hold while getting the second caller?

We are running custom software on this box and I can’t download freepbx or other software solutions that will alter the .conf files. I would like to be able to add the appropriate commands myself.

Any help would be much appreciated, thank you.

I would show the section of the console log that pertains to an inbound call rather than just trying to pick out one line.

Really no need for the _ on the exten lines that you posted, since you are not pattern matching. The number is an exact match.

On the VOIP phones the dialtone doesn’t mean to much. It is simulated. Makes people feel warm and fuzy. On some phones it may not be present if it hasn’t registered to a provider, but I have some that it is there even if there is no network wire plugged in.

You only have one IP phone? I would think the first thing to do is get two of them going and able to dial each other. Then worry about getting a PSTN incoming call to ring the phone.

Many IP phones when the have multiple lines, if you are registered only to one account, when that account receives multiple calls will use the different line keys for the incoming calls.

That is the only line that appears as an error in my console log. Do you know what changes I need to make for extensions.conf to make it work? I do not have a 2nd sip phone. The sip extension is registered successfully.

ok so I just solved my problem( I had some includes in the extensions.conf so I had to goto the include files and put the dial command there). Now I would like my sip phone to ring on ext2 when a 2nd call lands on that DID, how would I do that? Also I would like hold music played to either caller when I put one on hold?

did you try a second call?

What is the model of your Linksys IP phone?

Do you have a musiconhold.conf file? I’m using wav files, because I kept having problems getting mp3 to work. The wavs need to be in the right format for Asterisk. I used to following to convert mp3 to wav.

ffmpeg -i infile.mp3 -ar 8000 -ac 1 -ab 64 outfile.wav

[default]
mode=files
directory=/var/lib/asterisk/moh/
random=yes