SIP注册失败

时间:2015-04-07 10:36:13

标签: vb.net visual-studio-2012 sip voip

我正在尝试在Visual Studio 2012中创建一个小型VoIP客户端。 我正在尝试通过UDP从PC向AsteriskNOW PBX发送REGISTER SIP消息。这些设备如下:

IP PBX AsteriskNOW: 192.168.1.37
PC that sends REGISTER message: 192.168.1.104
SIP account username: 117
SIP account password: abcd1234

所以,我试图发送的REGISTER消息如下:

REGISTER sip:192.168.1.37 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.104:5060;branch=z9hG4bK213760691;rport
From: <sip:117@192.168.1.37>;tag=1270517038
To: <sip:117@192.168.1.37>
Call-ID: 1808066864-5060-1@BJC.BGI.B.D
CSeq: 2001 REGISTER
Contact: <sip:117@192.168.1.104:5060>;reg-id=1;
+sip.instance="<urn:uuid:00000000-0000-1000-8000-AABBCCDDEEFF>"
Max-Forwards: 70
User-Agent: Grandstream GXP1165 1.0.6.7
Supported: path
Expires: 3600
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, 
UPDATE, MESSAGE
Content-Length: 0 

当然,在

+sip.instance="<urn:uuid:00000000-0000-1000-8000-AABBCCDDEEFF>"

有PC,网络适配器MAC,而不是“AABBCCDDEEFF”。 但是,当我尝试发送消息时,我从服务器得到以下响应:

SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
192.168.1.104:5060;rport=5060;received=192.168.1.104;branch=z9hG4bK213760691
Call-ID: 1808066864-5060-1@BJC.BGI.B.D
From: <sip:117@192.168.1.37>;tag=1270517038
To: <sip:117@192.168.1.37>;tag=z9hG4bK2137606914
CSeq: 2001 REGISTER
WWW-Authenticate: Digest
realm="asterisk",nonce="1428402653/99967d603c38695f1c328332db91a43b",
opaque="416e7e1767513798",algorithm=md5,qop="auth"
Server: FPBX-AsteriskNOW-12.0.43(13.0.1)
Content-Length:  0

可能是什么问题?谢谢!

1 个答案:

答案 0 :(得分:0)

我通过使用ozeki库来解决SIP消息问题 我在这里找到了这个图书馆

http://www.voip-sip-sdk.com/p_179-windows-forms-softphone-vb-net-voip.html

谢谢!