403 Forbidden when receiving from sip trunk

I got an OneStream gsm to voip adapter. It is designed to work with ip phones, then I registered freepbx as an extension and redirected all the gsm incoming calls to this extension.

The IP of the adapter is 192.168.100.120. The IP of Asterisk is 192.168.100.4.

My configuration is this:

Peer details:
context=from-trunk
host=192.168.100.120
qualify=yes
nat=no
type=peer
insecure=invite
disallow=all
allow=ulaw
username=2001
secret=xxxx

Register string: 2001:[email protected]

Outgoin calls work ok, but incomming calls are rejected by asterisk with the following error:

SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 192.168.100.120:5060;branch=z9hG4bK28902eff;received=192.168.100.120;rport=5060
From: “5045” sip:[email protected];tag=OneStream4534ad57
To: sip:[email protected];tag=as3d780b27
Call-ID: [email protected]
CSeq: 103 INVITE
Server: FPBX-2.9.0(1.6.2.18.2)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0

Any help please?

Shouldn;t the type be user or friend? for incoming…?

I’ve tried with friend. The same problem. It seems that asteisk is rejecting the from… but the type=peer or friend should allow any cid, isn’t it?

what does asterisk log when the call is rejected ? turn sip trace off

I found the problem. I am calling from a short-number phone. This number is equal to the number of an extension.

Then, the call goas from [email protected] to [email protected] but there is an 5045 extension at 192.168.100.4

It seems that Asterisk is rejecting the call because a [email protected]… I don’ t know if there is a solution for this other than patching the number at the gsm gateway…

change the type of the extension 5045 to be peer instead of friend. I do not know how many times this issue needs to bite people in the a** before the default is changed:
http://www.freepbx.org/trac/ticket/5309