How to set up inbound calls in asterisk with DDI?

Hi,

I have an issue I am struggling with longer time.

I need to set up inbound calls for DDI and relate to the internal number.

To be honest the asterisk is installed together with vicidial but need to set up normal telephones with simple possibility of reverting with DID number what is not possible in vicidila.

How ever I need to configure ordinary telephones with DID numbers and record all talks on it.

I have the following configuration in extensions.conf

[ipfon]

exten => _X.,1,SIPAddHeader(X-Fid: ${SIPCALLID})
exten => _X.,2,Dial(sip/${EXTEN}@ipfon)
exten => przychodzace,3,Set(TOHDR=${SIP_HEADER(To)})
exten => przychodzace,4,Gotoif($["${REGEX(“XXXXXXXX” ${TOHDR})}" = “1”]?wewnetrzne,200,1)
exten => t,5,Hangup
exten => h,1,Hangup

[tel1]
include => wewnetrzne

exten => _X.,1,Set(CALLERID(num)=XXXXXXXX)
exten => _X.,2,Dial(SIP/${EXTEN}@ipfon)
exten => t,3,Hangup
exten => h,4,Hangup

[wewnetrzne]
exten => 200,1,Dial(SIP/user1,45,Tf)

sip.conf is the following:

register => user:passwd@sip.voip.pl/przychodzace
[ipfon]
type=peer
username=user
secret=passwd
outboundproxy=sip.voip.pl
outboundproxyport=5060
fromdomain=sip.voip.pl
fromuser=user
context=ipfon
host=sip.voip.pl
port=5060
isecure=port,invite
sendrpid=yes
allowguest=no
disallow=all
allow=alaw
allow=ulaw
allow=g729
insecure=no
nat=no

[user1]
context=tel1
type=friend
username=user1
secret=1234
callerid=“200” <200>
host=dynamic
nat=no
accountcode=Jacek
disallow=all
allow=alaw

Something is wrong but I don’t know what.

I would really appreciate your help what may be wrong that I still can hear only music when calling inbound ???

Thank you in advance, Jacek

You don’t have enough priority 1s!

Thanks for your help.

However I would kindly ask for more clarification. What dose it mean I don’t have priority one ?

Thanks in advance, Jacek

You don’t understand how priorities work. You really need to review the basic documentation.

Each extension must have a priority one. Neither t nor przychodzace have one.

Should it be in the following way ?

exten => przychodzace,1,Set(TOHDR=${SIP_HEADER(To)})
exten => przychodzace,1,Gotoif($["${REGEX(“XXXXXXXX” ${TOHDR})}" = “1”]?wewnetrzne,200,1)

No. You are stabbing the dark. Please go back and read up on how dialplans work.

are you able to recommend any docs, web sites. I have read many in Internet and still no good ideas.

asteriskdocs.org/

The sample extensions.conf from the source distribution.