Authentication username in Astersik SIP peer
Asterisk use peername as username during SIP inbound digest authentication.
This patch add authuser parameter in SIP peer definition and use authuser in digest authentication:
Peer definition in /etc/asterisk/sip.conf
[pietro](sip-client-base)
authuser=MyUsername
secret=XXXXX
qualify=yes
nat=yes
…
Peer definition in my SIP client (Twinkle)

REGISTER message from my SIP client
Via: SIP/2.0/UDP 88.149.226.66:10458;rport;branch=z9hG4bKkqpevlic
Max-Forwards: 70
To: “Pietro”
From: “Pietro” ;tag=ntlug
Call-ID: mqezxbywgtulavj@bertuccia
CSeq: 681 REGISTER
Contact: ;expires=3600
Authorization: Digest username=”MyUsername”,realm=”bertera.it”,nonce=”27f804de”,uri=”sip:bertera.it”,response=”47dbf0a57d80faffd148b58d84edc2db”,algorithm=MD5 Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
User-Agent: Twinkle/1.4.2
Content-Length: 0
Message in Asterisk CLI:
— Registered SIP ‘pietro’ at 88.149.226.66 port 10458
REGISTER Confirmation from Asterisk:
Via: SIP/2.0/UDP 88.149.226.66:10458;branch=z9hG4bKkqpevlic;received=88.149.226.66;rport=10458
From: “Pietro”
To: “Pietro”
Call-ID: mqezxbywgtulavj@bertuccia
CSeq: 681 REGISTER
Server: Asterisk PBX 1.6.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Expires: 3600
Contact:
Date: Thu, 04 Feb 2010 22:23:35 GMT
Content-Length: 0
http://www.bertera.it/software/asterisk-stuff/asterisk-1.6.2.2-sip-peer-authuser-patch.diff
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.


Comments
No comments yet.
Leave a comment