Incoming SIP trunk

Hi All,

I am trying to setup an incoming SIP trunk, and I have a strange behavior from Asterisk.
When an incoming arrives it seems Asterisk is trying to identify by the “contact” field instead of the “Invite”

INVITE sip:0427XXXXX@91.XXX.XXX.XXX SIP/2.0
Via: SIP/2.0/UDP 85.119.XXX.XXX:5060;branch=z9hG4bK76a4e8dd;rport
From: "0495XXXXXX" <sip:0495XXXXXX@85.119.XXX.XXX>;tag=as4019bede
To: <sip:0427XXXXX@91.XXX.XXX.XXX>
Contact: <sip:0495XXXXXX@85.119.XXX.XXX>
Call-ID: 3859b9767dd66cb44cd907636b838e15@85.119.XXX.XXX
CSeq: 102 INVITE
User-Agent: Remote PBX
Max-Forwards: 70
Date: Mon, 04 Jul 2011 23:39:16 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Diversion: <sip:0427XXXXXX@ast2>
Content-Type: application/sdp
Content-Length: 336

v=0
o=root 12453 12453 IN IP4 85.119.XXX.XXX
s=session
c=IN IP4 85.119.XXX.XXX
t=0 0
m=audio 14398 RTP/AVP 0 8 18 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
<------------->
--- (15 headers 16 lines) ---
Sending to 85.119.XXX.XXX:5060 (no NAT)
Using INVITE request as basis request - 3859b9767dd66cb44cd907636b838e15@85.119.XXX.XXX
No matching peer for '0495XXXXXX' from '85.119.XXX.XXX:5060'
[Jul  5 01:38:34] NOTICE[7156]: chan_sip.c:21512 handle_request_invite: Sending fake auth rejection for device "0495XXXXXX" <sip:0495XXXXXX@85.119.XXX.XXX>;tag=as4019bede

My Asterisk installed version is : 1.8.4.2
I have a peer defined in my sip.conf (which is working for outbound calls)
I defined a register: username:password@host
In the extension.conf a context (used in the context field of my peer) is routing the “s” extension.

I tried a lot of combination without success, I am still having this message except if I am defining “allowguest=yes”, but I would like to avoid this.

Thanks in advance for you help.

Christian

User type entries in sip.conf are matched on the Contact field. The invite field is matched against extensions.conf, although, as you haven’t specified a destination user on the register, that will be “s”.

The host entry in your sip.conf peer entry should match the IP address from which the INVITE came. It presumably doesn’t, and that is why the call isn’t matching.

Incidentally, SIP trunks only exist in Asterisk GUIs. Asterisk itself makes no distinction between a trunk and a phone that can accept concurrent calls.

Hi David,

Thank you for your answer.
The problem is the provider sent the invite from multiple addresses.
Is there a way to accept invites from a range of addresses?

Thanks in advance,
Regards,

Christian

One obvious way is multiple sip.conf entries, but there may be others. Have you tried a domain name?

I tried to add a domain per ip address but the result was the same.
I don’t understand why the provider is sending the invites from multiples addresses :-s

Hi David,

I think you drove me to discover the root cause of my issue.
By comparing and analyzing traces I discovered the provider doesn’t send me a “Via” header with the host address used in my peer, but only one “Via” header with the server which sent the invite.
When the provider is configuring the account one to one (one account - one number) I am receiving 2 “Via” headers.

Does my analysis good or wrong?

Thanks in advance.
Regards,

Christian

I believe the match is done on Contact, not on Via.

I think is from “Via” because I have a working configuration like this:

register (peer) 10.10.10.10

Via 1 = 10.10.10.10
Via 2 = 10.10.10.20

Contact = 10.10.10.20

My no working configuration is:

register (peer) 10.10.10.10

Via = 10.10.10.20

Contact = 10.10.10.20

And on the last one i am receiving the error

Regards,
Christian

Is the somebody to confirm or not confirm?

Thanks in advance.
Regards,

Christian