Problems registering with proxy


#1

Hi, I’m having problems using a sip proxy… outgoing calls are working perfect, the problem is with incoming calls… they are coming from a different IP, and asterisk reject them with a 404 Not Found error… I can’t find how to tell asterisk to accept that calls…

Here is part of my sip.conf and a tcpdump of a call session… I’ve changed IP addresses for security reasons…

------------------- 
 sip.conf
-------------------
register => 1157114748:XXXX:1157114748@172.16.5.1

[172.16.5.1]
type=friend
dtmfmode=rfc2833
host=172.16.5.1
fromuser=1157114748
context=incoming

You can see here, that the sip proxy is configured as 172.16.5.1… outgoing calls using:

are working just perfect… but, this is how an incoming call looks like, you will find that this appears as destination sip:1157114748@172.16.5.30:11798 which I guess asterisk reject, because its not configured to accept calls for 172.16.5.30.

brief

SIP Proxy IP: 172.16.5.1 <-- This is the ip where I’m registering
Incoming SIP Proxy IP: 172.16.5.30 <-- This is the ip of incomming messages
AsteriskBox IP: 192.168.0.1 <-- This is my asterisk pbx ip

[code]

tcp dump

********* 172.16.5.1 --> 192.168.0.1

Request: INVITE sip:1157114748@192.168.0.1:5060 SIP/2.0

From: sip:172.16.5.10:5062;tag=E798.9167
To: sip:1157114748@172.16.5.30:11798
Call-ID: 00C0.95C9.F9B0.443F.E798.1169
CSeq: 7872 INVITE
Max-Forwards: 70
Via: SIP/2.0/UDP 172.16.5.1:5060;branch=z9hG4bK443F.E798.91677872.66323ec8.00002e16
Via: SIP/2.0/UDP 172.16.5.10:5062;branch=z9hG4bK443F.E798.91677872
Contact: sip:172.16.5.1:5060
Session-Expires: 180;refresher=uac
Alert-Info:
Allow: INVITE,BYE,INFO,PRACK,CANCEL,ACK,OPTIONS,SUBSCRIBE,NOTIFY,REGISTER,REFER,UPDATE
Supported: timer,100rel
Content-Type: application/sdp
Content-Length: 142

********* 192.168.0.1 --> 172.16.5.1

Status: SIP/2.0 404 Not Found

Via: SIP/2.0/UDP 172.16.5.1:5060;branch=z9hG4bK443F.E798.91677872.66323ec8.00002e16
Via: SIP/2.0/UDP 172.16.5.10:5062;branch=z9hG4bK443F.E798.91677872
From: sip:172.16.5.10:5062;tag=E798.9167
To: sip:1157114748@172.16.5.30:11798;tag=as4cb0e278
Call-ID: 00C0.95C9.F9B0.443F.E798.1169
CSeq: 7872 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: sip:1157114748@192.168.0.1
Content-Length: 0

********* 172.16.5.1 --> 192.168.0.1

Request: ACK sip:1157114748@192.168.0.1:5060 SIP/2.0

From: sip:172.16.5.10:5062;tag=E798.9167
To: sip:1157114748@172.16.5.30:11798;tag=as4cb0e278
Call-ID: 00C0.95C9.F9B0.443F.E798.1169
CSeq: 7872 ACK
Max-Forwards: 70
Via: SIP/2.0/UDP 172.16.5.1:5060;branch=z9hG4bK443F.E798.91677872.66323ec8.00002e16
Via: SIP/2.0/UDP 172.16.5.10:5062;branch=z9hG4bK443F.E798.91677872
Content-Length: 0[/code]

Thanx


#2

Weired config …
Why not incoming and outgoing via the same IP/Proxy ?

You are using 2 diff. classes of private net, where is the router and what is the setup like ?

Is this a Red/Green/Orange setup?
NAT ? Portforwarding ?


#3

[quote]Weired config …
Why not incoming and outgoing via the same IP/Proxy ? [/quote]

Because this is not my decision, its my providers configuration, and I can’t make them change it just for me.

about this:

as I said, I’ve changed ip addresses for security reasons, these are not real ip, as the problem is not a network problem, just an asterisk configuration… all I need is to tell asterisk that it must accept calls for sip:1157114748@172.16.5.30:11798, though I don’t know how.

May be I wasn’t clear, so here it goes again, an scenario description:

SIP Proxy IP: 172.16.5.1
This is the ip where I’m registering, it’s my providers ip, and it’s a public ip, the real ip is 200.80.xxx.xxx

Incoming SIP Proxy IP: 172.16.5.30
This is the ip of incomming messages, I didn’t change it, because it’s a private ip, may be the internal ip of any one of my provider’s servers.

AsteriskBox IP: 192.168.0.1
This is my asterisk pbx ip, it has a public ip, the real one is 200.85.xxx.xxx

I hope this make the situation more clear

cheers,
Hernán


#4

I believe you need to add the following to the SIP channel definition:

insecure=invite

or, if you have multiple SIP devices behind NAT then possibly:

insecure=invite,port


#5

nop :frowning:

I tried adding insecure option, but nothing changed.


#6

Ok, now it becomes clearer with the real IPs, must have missed it.

The “fake IP config” was total crap tbh… :laughing:

Ok, lemme reread carefully…brb


#7

Ok, one question:

The SIP Proxy is located in your rooms with the IP you posted.
The proxy is configured and holding the REAL public IP of the SIP Provider.

Is the IP of the provider configured in the proxy the same as the one you are registering with ?

If yes: Do the outgoings through the proxy as well, so register with the proxy instead of provider.

If not change the provider, lol…serious:
Define 2 context in your sip.conf

One for outgoing pointing to the provider’s IP.
The incomings via a second context accepting the proxy’s IP.

Should work ? Yes…or do i miss something ?
No…should work.