PDA

View Full Version : Can't connect Asterik to Epygi



isstar
06-25-2008, 06:12 AM
I have two Epygi and one Asterisk PBX.

- Asterisk server is hosted in a datacenter with a fixed IP and no NAT.
- Epygi 1 is connect as a client to Asterisk with a fixed IP and NAT. All ports are redirect.
- Epygi 2 is connect as a client to Asterisk with a dyna IP and NAT. Port 5060 is redirect.

Two Epygi have the same configuration to connect to Asterisk (with different usernames). But Epygi 1 is configure with static IP without STUN in NAT Traversal and Epygi 2 use default settings.

The problem is that Epygi 1 register well but Epygi 2 can't register. I suppose it's a problem with dyn IP and NAT. I have this in status "Detected connection type: Symmetric NAT". What can I do ? I have to open more ports on the router ?

Thanks for your help.

davrays
06-25-2008, 11:43 AM
If it shows "Symmetric NAT", that means the redirect of port 5060 is not done correctly. You should make sure the port 5060 of the router routes all UDP packets to port 5060 on the Quadro. If port 5060 has some problem, try to use different port - both on the Quadro and router. If you do everything correctly, you should have "Full Cone NAT" detected.
This should solve the registration problem. But to be able to run audio streams through the router, you'll have to redirect the RTP ports too.

Best regards,
David

isstar
06-25-2008, 12:06 PM
Ok I forgot to save the rule on my router and after reboot it was gone. So now it's OK I have :

Detected connection type: Full Cone NAT

But still no register to Asterisk :(

Thanks for your help.

davrays
06-25-2008, 12:17 PM
Logs please... :)

But before logs, lets try the following
1) reboot the Quadro to make things happen quickly;
2) look into the "Events" to see if there is any event describing the reason for registration failure. There should be one.

isstar
06-25-2008, 03:13 PM
Quadro logs :

New Wed Jun 25 21:07:54 2008
3 SIP registration failure Could not Register user versants on server sip.isstar.net:5060. Reason: Timeout occurred SIP Registration Status

and Asterisk debug :

<--- SIP read from 213.219.134.126:1027 --->
REGISTER sip:sip.isstar.net SIP/2.0
Via: SIP/2.0/UDP 213.219.134.126:5060;rport;branch=z9hG4bKEPSVBUS48 118808-215a-414c-a45a-b4fe07827290
To: "Asterisk" <sip:versants@sip.isstar.net>
From: "Asterisk" <sip:versants@sip.isstar.net>;tag=1214420773980e6b62-a7e7-49df-a122-3ddd712a5ca9
CSeq: 1 REGISTER
Call-ID: 1b4bfe66-4994-474e-9dcf-7555793f85cc@quadro.epygi-config.loc
Contact: "Asterisk" <sip:versants@213.219.134.126:5060>;expires=3600
User-Agent: Epygi Quadro SIP User Agent/v4.1.52 (QUADRO-2X)
Max-Forwards: 70
Content-Length: 0


<------------->
--- (10 headers 0 lines) ---
Using latest REGISTER request as basis request
Sending to 213.219.134.126 : 1027 (NAT)

<--- Transmitting (NAT) to 213.219.134.126:1027 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 213.219.134.126:5060;branch=z9hG4bKEPSVBUS48118808-215a-414c-a45a-b4fe07827290;received=213.219.134.126;rport=1027
From: "Asterisk" <sip:versants@sip.isstar.net>;tag=1214420773980e6b62-a7e7-49df-a122-3ddd712a5ca9
To: "Asterisk" <sip:versants@sip.isstar.net>
Call-ID: 1b4bfe66-4994-474e-9dcf-7555793f85cc@quadro.epygi-config.loc
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:versants@91.121.203.87>
Content-Length: 0


<------------>

<--- Transmitting (NAT) to 213.219.134.126:1027 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 213.219.134.126:5060;branch=z9hG4bKEPSVBUS48118808-215a-414c-a45a-b4fe07827290;received=213.219.134.126;rport=1027
From: "Asterisk" <sip:versants@sip.isstar.net>;tag=1214420773980e6b62-a7e7-49df-a122-3ddd712a5ca9
To: "Asterisk" <sip:versants@sip.isstar.net>;tag=as73124116
Call-ID: 1b4bfe66-4994-474e-9dcf-7555793f85cc@quadro.epygi-config.loc
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="6f3b652b"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '1b4bfe66-4994-474e-9dcf-7555793f85cc@quadro.epygi-config.loc' in 32000 ms (Method: REGISTER)

davrays
06-25-2008, 04:07 PM
Quadro gives the timeout error, because it doesn't get back the answer from asterisk - it just doesn't reach the Quadro.

The question to you: why do you think your astrisk is sending requests to 213.219.134.126:1027, while the Quadro is placed at 213.219.134.126:5060?

The "Contact" field of the REGISTER message from Quadro is ""Asterisk" <sip:versants@213.219.134.126:5060>". That means Asterisk should send back the answer to the port 5060, but in reality it sends that to 1027. There is some misconfiguration in Asterisk. Probably it has something like "send the SIP answer back to the port the request is came from" option. I don't have experience in Asterisk configuration, so I cannot point you to the correct option, but something should be switched OFF, for Asterisk to work according to standard (which tells: send the answer back to the address specified in "Contact" field).

Best regards,
David

isstar
06-29-2008, 08:55 AM
This seems to be working now. I have change nothing since my last message. Maybe I had just not waited enough. Thanks for all your help.