Re: [Asterisk-Users] Problem with SIP 407

2004-02-25 Thread Vic Cross
G'day Marc,

On Wed, 25 Feb 2004, Marc Fargas wrote:

 I’m in trouble with SIP. I’ve got a SIP FXS gateway from www.micronet.info
 (SP5002/S) and traed to register to asterisk, It seems to autentícate but
 sniffing the net it shows a 407 proxy authen required error message and I
 cannot make any outgoing calls from that gateway.

I captured a flow between * and an ATA-186 the other day, because I had 
the same problem (well, the symptom was the same).

The 407 message from * is part of the registration flow.  It tells the
client that it needs to resend its REGISTER, this time including a
Proxy-Authentication (sp?) header in the request.  That header contains
the authentication data (authuser, password).

I'd suggest getting into the network with ethereal or the like and start
sniffing the packet flow.  In my case, a hardware incompatibility was 
preventing my client from receiving the 407 from *, so it never responded 
to it...  (Getting a packet trace will also be essential in getting 
further support, either from your FXS vendor or the SIP mavens on this 
list.)

 I’ve tried putting ‘Domain’ = Asterisk on the FXS and other things, also
 played with codecs but everything seems to come from the 407 message, how
 can I avoid that message?

Well, you could try removing the password (secret=XXX) from the entry
in sip.conf, allowing the client to register without authentication.  
Might be something to try, but I don't think I'd run live that way... ;-)

Cheers,
Vic Cross
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Problem with SIP 407

2004-02-25 Thread Olle E. Johansson
Vic Cross wrote:

G'day Marc,

On Wed, 25 Feb 2004, Marc Fargas wrote:


Im in trouble with SIP. Ive got a SIP FXS gateway from www.micronet.info
(SP5002/S) and traed to register to asterisk, It seems to autentcate but
sniffing the net it shows a 407 proxy authen required error message and I
cannot make any outgoing calls from that gateway.


I captured a flow between * and an ATA-186 the other day, because I had 
the same problem (well, the symptom was the same).

The 407 message from * is part of the registration flow.  It tells the
client that it needs to resend its REGISTER, this time including a
Proxy-Authentication (sp?) header in the request.  That header contains
the authentication data (authuser, password).
Let's clear this up:

A SIP ua sends a REGISTER to a location server to tell the server where
it can be reached. At registration, the server challenges the UA with a
www-authentication. When authenticated, the server stores the IP address
and contact header for some time (expiry=) to be able to place calls to
the UA. This is a SIP peer in asterisk.
The standard sip channels has a bug here and issues a Proxy-authentication.
The chan_sip2 channel issues a www-auth.
When a SIP UA want to call through asterisk, asterisk want's to know
for certain who it is before admitting any services (except default context).
To let the SIP ua through, we issue a Proxy-auth. If it succeeds, the asterisk
sip user is allowed to reach whatever is reachable in the user's SIP context.
A type=friend SIP client is both a user and a peer.

Neither form of authentication sends the password in clear. This is nowadays
forbidden in SIP. We use digest authentication, a challenge-response mechanism.
I'm a bit afraid that Asterisk's authentication in the SIP channels is a bit
out of date and that may be your problem. Please forward SIP debug output
so we can go through the various stages that leads to the 407.
Ive tried putting Domain = Asterisk on the FXS and other things, also
played with codecs but everything seems to come from the 407 message, how
can I avoid that message?


Well, you could try removing the password (secret=XXX) from the entry
in sip.conf, allowing the client to register without authentication.  
Might be something to try, but I don't think I'd run live that way... ;-)
If so, add an ACL so you limit the IP addresses that may use this account.

/O
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Problem with SIP 407

2004-02-25 Thread Marc Fargas
On this cuts note that the gateway has username 'Republica', you could see
some reference to Republica2 which corresponds to a  second line on the
gateway that I have disabled.

Thanks for your help!

That's SIP debug when dialling '9' (9 would do Goto(s,1))
===
*CLI 
*CLI 
11 headers, 2 lines
Reliably Transmitting:
NOTIFY sip:[EMAIL PROTECTED] SIP/2.0
Via: SIP/2.0/UDP 192.168.2.2:5060;branch=z9hG4bK0f92815a
From: asterisk sip:[EMAIL PROTECTED];tag=as0bc66d50
To: sip:[EMAIL PROTECTED]
Contact: sip:[EMAIL PROTECTED]
Call-ID: [EMAIL PROTECTED]
CSeq: 102 NOTIFY
User-Agent: Asterisk PBX
Event: message-summary
Content-Type: application/simple-message-summary
Content-Length: 36

Messages-Waiting: no
Voicemail: 0/0
 (no NAT) to 192.168.6.2:5060


Sip read: 
SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP
192.168.2.2:5060;received=192.168.2.2;branch=z9hG4bK0f92815a
From: asterisksip:[EMAIL PROTECTED] ;tag=as0bc66d50
To: sip:[EMAIL PROTECTED] ;tag=c0a80602-13c4-30d-bef46-6225
Call-ID: [EMAIL PROTECTED]
CSeq: 102 NOTIFY
Content-Length:0


7 headers, 0 lines
Feb 25 21:03:04 WARNING[98311]: chan_sip.c:4875 handle_response: Host
'192.168.6.2' does not implement 'NOTIFY'


Sip read: 
INVITE sip:[EMAIL PROTECTED]:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.6.2:5060
Contact: sip:[EMAIL PROTECTED]:5060
User-Agent: FXS_GW (2asipfxs.106)
From: sip:[EMAIL PROTECTED] ;tag=c0a80602-13c4-30e-befaf-7ba1
To: sip:[EMAIL PROTECTED]:5060;user=phone
Call-ID: [EMAIL PROTECTED]
CSeq: 1 INVITE
Content-Type: application/sdp
Content-Length:234

v=0
o=FXS_GW 12367 0 IN IP4 192.168.6.2
s=Audio Session
i=Audio Session
c=IN IP4 192.168.6.2
t=0 0
m=audio 16384 RTP/AVP 18 4 0 8
a=rtpmap:18 G729/8000/1
a=rtpmap:4 G723/8000/1
a=rtpmap:0 PCMU/8000/1
a=rtpmap:8 PCMA/8000/1

10 headers, 11 lines
Using latest request as basis request
Sending to 192.168.6.2 : 5060 (non-NAT)
Found audio format UNKN
Found audio format ULAW
Found audio format UNKN
Found audio format ALAW
Found description format G729
Found description format G723
Found description format PCMU
Found description format PCMA
Capabilities: us - 6, them - 269/854015, combined - 6
Non-codec capabilities: us - 1, them - 0, combined - 1
Reliably Transmitting (no NAT):
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.6.2:5060
From: sip:[EMAIL PROTECTED] ;tag=c0a80602-13c4-30e-befaf-7ba1
To: sip:[EMAIL PROTECTED]:5060;user=phone;tag=as76b77fc8
Call-ID: [EMAIL PROTECTED]
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: sip:[EMAIL PROTECTED]
Proxy-Authenticate: Digest realm=asterisk, nonce=2f9d85fe
Content-Length: 0


 to 192.168.6.2:5060


Sip read: 
ACK sip:[EMAIL PROTECTED]:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.6.2:5060
Contact: sip:[EMAIL PROTECTED]:5060
User-Agent: FXS_GW (2asipfxs.106)
From: sip:[EMAIL PROTECTED] ;tag=c0a80602-13c4-30e-befaf-7ba1
To: sip:[EMAIL PROTECTED]:5060;user=phone ;tag=as76b77fc8
Call-ID: [EMAIL PROTECTED]
CSeq: 1 ACK
Content-Length:0


9 headers, 0 lines


Sip read: 
INVITE sip:[EMAIL PROTECTED]:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.6.2:5060
Contact: sip:[EMAIL PROTECTED]:5060
Proxy-Authorization: Digest username=Republica, realm=asterisk,
nonce=2f9d85fe, uri=sip:[EMAIL PROTECTED]:5060;user=phone, re
sponse=4b434a0e18166c573b006cf9cbd2f3bc, algorithm=MD5
User-Agent: FXS_GW (2asipfxs.106)
From: sip:[EMAIL PROTECTED] ;tag=c0a80602-13c4-30e-befaf-7ba1
To: sip:[EMAIL PROTECTED]:5060;user=phone
Call-ID: [EMAIL PROTECTED]
CSeq: 2 INVITE
Content-Type: application/sdp
Content-Length:234

v=0
o=FXS_GW 12367 0 IN IP4 192.168.6.2
s=Audio Session
i=Audio Session
c=IN IP4 192.168.6.2
t=0 0
m=audio 16384 RTP/AVP 18 4 0 8
a=rtpmap:18 G729/8000/1
a=rtpmap:4 G723/8000/1
a=rtpmap:0 PCMU/8000/1
a=rtpmap:8 PCMA/8000/1

11 headers, 11 lines
Using latest request as basis request
Sending to 192.168.6.2 : 5060 (non-NAT)
Found audio format UNKN
Found audio format ULAW
Found audio format UNKN
Found audio format ALAW
Found description format G729
Found description format G723
Found description format PCMU
Found description format PCMA
Capabilities: us - 6, them - 269/854015, combined - 6
Non-codec capabilities: us - 1, them - 0, combined - 1
Looking for 9 in nacer
list_route: hop: sip:[EMAIL PROTECTED]:5060
Transmitting (no NAT):
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.6.2:5060
From: sip:[EMAIL PROTECTED] ;tag=c0a80602-13c4-30e-befaf-7ba1
To: sip:[EMAIL PROTECTED]:5060;user=phone;tag=as76915db6
Call-ID: [EMAIL PROTECTED]
CSeq: 2 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: sip:[EMAIL PROTECTED]
Content-Length: 0


 to 192.168.6.2:5060
-- Executing Goto(SIP/Republica-a2aa, default|s|1) in new stack
-- Goto (default,s,1)
-- Executing Answer(SIP/Republica-a2aa, ) in new stack
We're at 192.168.2.2 port 19466
Video is at 192.168.2.2 port 18490
Answering with preferred capability 4
Answering with preferred capability 2
Answering with 

Re: [Asterisk-Users] Problem with SIP 407

2004-02-25 Thread Olle E. Johansson
Seems like republica registers ok, but not republica2. Republica2 failes to authenticate.

You have a normal registration sequense here:

-Client sends a REGISTER without authentication
-Server sends trying...
-Server sends 407 Proxy auth (should be WWW auth) with challenge
-Clients ACK
-Client sends a new REGISTER with authentication
-Server tries auth
-If auth fails (propably wrong secret/password) a 401 unauthorized is issued
-If auth succeeds a 200 OK is issued
Apart from that, the Asterisk server after authentication wants to tell
the client that it has voicemail, and the client responds that it has no
clue of what the server is trying to say. Take away the mailbox= parameter
in sip.conf to avoid this.
You client seems to send a lot of REGISTERs without waiting for response.

Other than that, check the passwords for republica2.
Republica1 should be able to receive calls from asterisk.
/O
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Problem with SIP 407

2004-02-25 Thread Marc Fargas
I have commented de Republica2 in sip.conf 'cause if I uncomment it neither
Republica and Republica2 register (maybe because they're on the same
gateway?)

Well, inspite it register well when I try tocall any extension It plays
'busy' tone immediately after Asterisk takes the calls I thought it was a
codecs problem but I have another gateway similar with H.323 and hav codecs
configured same way both on asterisk and the gateways, the H.323 one goes
right but the SIP one can't do anything, it just plays around with 'busy'
tones.

In my previous post you can see the output of sip debug on Asterisk when
trying to call an extension, on the gateway side that's what I get:


 Line : 1, Start Inviting 
strDes To:sip:[EMAIL PROTECTED]:5060;user=phone, strOri
From:sip:[EMAIL PROTECTED]
1-RvSipCallLegMgrCreateCallLeg() ok!
 Success to rvSdpMsgEncodeToBuf  *
-- Message Sent (Message type: 0) (call-leg 58e04c)
INVITE sip:[EMAIL PROTECTED]:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.6.2:5060
Contact: sip:[EMAIL PROTECTED]:5060
User-Agent: FXS_GW (2asipfxs.106)
From: sip:[EMAIL PROTECTED] ;tag=c0a80602-13c4-403d1740-5870d2-7301
To: sip:[EMAIL PROTECTED]:5060;user=phone
Call-ID: [EMAIL PROTECTED]
CSeq: 1 INVITE
Content-Type: application/sdp
Content-Length:234

v=0
o=FXS_GW 12367 0 IN IP4 192.168.6.2
s=Audio Session
i=Audio Session
c=IN IP4 192.168.6.2
t=0 0
m=audio 16384 RTP/AVP 18 4 0 8
a=rtpmap:18 G729/8000/1
a=rtpmap:4 G723/8000/1
a=rtpmap:0 PCMU/8000/1
a=rtpmap:8 PCMA/8000/1

1-RVSIP_CALL_LEG_STATE_INVITING
-- Message Received (Message Type: 1) (call-leg 58e04c)
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.6.2:5060
User-Agent: Asterisk PBX
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER
Contact: sip:[EMAIL PROTECTED]
From: sip:[EMAIL PROTECTED] ;tag=c0a80602-13c4-403d1740-5870d2-7301
To: sip:[EMAIL PROTECTED]:5060;user=phone ;tag=as07a0b938
Call-ID: [EMAIL PROTECTED]
CSeq: 1 INVITE
Content-Length:0


1-RVSIP_CALL_LEG_STATE_TERMINATED

1-Gen_BusyTone



___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users