Vahan Yerkanian
2005-Jul-26 09:23 UTC
[Asterisk-Users] SIP INVITE and caller id / proxy-authorization strange behaviour
Hi all, Today I've stumbled upon a very strange behaviour with an analog fxs/fxo gateway (AddPac AP1002, http://www.addpac.com/english/AP1002.html) connected to a CVS HEAD(from today) Asterisk server. This manifested itself after enabling the CallerID on the pstn lines connected to the FXO ports of the module. Both FXO modules have their own sip username/passwords and are registered to the asterisk box in question, same with the fxs ports on the same device. All of them register from the same ip:port combination. With caller-id disabled, whenever a call comes from pstn to one of the pstn lines, the line is picked up and immediately dialed into an extension on the asterisk box (an ivr menu). Call is authenticated and call flow is ok. For the sake of bandwidth conservation I'm including only the SIP INVITE, I'll post full debug if it's required on request. the sip entry for the FXO port is as follows: [582760] type=friend username=582760 secret=xxxxxx host=dynamic qualify=yes the sip invite without the caller-id enabled: INVITE sip:411@195.250.77.70 SIP/2.0 Via: SIP/2.0/UDP 195.250.76.28:5060;branch=z9hG4bK8d423c2ca428 From: <sip:582760@195.250.77.70>;tag=8d423c2ca4 To: <sip:411@195.250.77.70> Call-ID: 8dffe442-3c48-3c18-802c-0002a4019126@195.250.76.28 CSeq: 28 INVITE Supported: timer, replaces Min-SE: 1800 Date: Mon, 25 Jul 2005 15:04:45 GMT User-Agent: AddPac SIP Gateway Contact: <sip:582760@195.250.76.28> Accept: application/sdp Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE, REFER, NOTIFY, INFO Content-Type: application/sdp Content-Length: 237 Max-Forwards: 70 v=0 o=582760 1122303885 1122303885 IN IP4 195.250.76.28 s=AddPac Gateway SDP c=IN IP4 195.250.76.28 t=1122303885 0 m=audio 23026 RTP/AVP 18 101 a=rtpmap:18 G729/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20 Now, if I enable the callerid for that port, the caller gets identified, and the following SIP INVITE is sent to the server: INVITE sip:411@195.250.77.70 SIP/2.0 Via: SIP/2.0/UDP 195.250.76.28:5060;branch=z9hG4bKd8424c26a424 From: <sip:010527911@195.250.77.70>;tag=d8424c26a4 To: <sip:411@195.250.77.70> Call-ID: d8fee442-2a0b-4c38-8026-0002a4019126@195.250.76.28 CSeq: 24 INVITE Supported: timer, replaces Min-SE: 1800 Date: Mon, 25 Jul 2005 15:01:44 GMT User-Agent: AddPac SIP Gateway Contact: <sip:010527911@195.250.76.28> Accept: application/sdp Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE, REFER, NOTIFY, INFO Content-Type: application/sdp Content-Length: 240 Max-Forwards: 70 v=0 o=010527911 1122303704 1122303704 IN IP4 195.250.76.28 s=AddPac Gateway SDP c=IN IP4 195.250.76.28 t=1122303704 0 m=audio 23022 RTP/AVP 18 101 a=rtpmap:18 G729/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20 Note the "From" tag: From: <sip:010527911@195.250.77.70>;tag=d8424c26a4 So here it is: it uses the detected caller-id instead of the FXO's username. Still, later on the auth challenge step it resends the invite with the proper auth info: Proxy-Authorization: Digest username="582760", realm="sip.arminco.com", nonce="1886728b", uri="sip:411@195.250.77.70", response="487250bb2f1f17a8b15e9ad727e87a6f", algorithm=MD5 ..asterisk rejects the call with Failed auth on 010527911@195.250.77.70 :( Is there a limitation in Asterisk and it uses the "From" address as the auth user? This seems buggy.. I'll send the full debugs off-list if someone is interested. regards, Vahan -------------- next part -------------- A non-text attachment was scrubbed... Name: vahan.vcf Type: text/x-vcard Size: 287 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20050726/39e1d848/vahan.vcf