Incoming calls with trunk sip

Hellow,

I have a PBX Asterisk and a SIP trunk to make the external calls.
With the outgoing calls I have no problem, but I can’t make my Asterisk to receive incoming calls.

the configuration is the next:

outgoing settings:

username=1001
user=1001
fromdomain=colabora.es
fromuser=1001
secret=u1281001
type=friend
insecure=very
host=213.60.204.6
nat=yes
canreinvite=no
dtmfmode=rfc2833
disallow=all
allow=all

incoming settings:

user context=1001

username=1001
user=1001
fromdomain=colabora.es
fromuser=1001
secret=u1281001
type=user
insecure=very
host=213.60.204.6
nat=yes
canreinvite=no
dtmfmode=rfc2833
disallow=all
allow=all

If anyone can help me I’ll be very gratefully.

Check out the register command in the sip.conf file. If your NATed your asterisk box will have to reach out to the SIP provider to tell it how to send calls to you asterisk box.

Your outgoing and incoming settings are redundant.

under sip.conf you should only have 1 entry for your sip provider

BUT,
you seem to be missing the ‘Context’ variable

You should have something like:
[mySIPprovider]
username=1001
user=1001
fromdomain=colabora.es
fromuser=1001
secret=u1281001
type=friend
insecure=very
host=213.60.204.6
nat=yes
canreinvite=no
dtmfmode=rfc2833
disallow=all
allow=all
context=default

the added line ‘context=default’ tells it where to drop the incoming calls in your dialplan. You need to have a corresponding section in your extensions.conf.

for example
[default]
exten => _THENUMBERTHEYDIALED,1,answer()
exten => _THENUMBERTHEYDIALED,2,DIAL(SIP/THERECIPIENT, 15)