|
169 private void RemoveExpiredNonces()
170 {
171 lock(m_pNonces){
172 for(int i=0;i<m_pnonces.count;i++){
173 nonce="" expired,="" remove="" it.
174="" <b=""> if(m_pNonces[i].CreateTime.AddSeconds(m_ExpireTime) > DateTime.Now){
175 m_pNonces.RemoveAt(i);
176 i--;
177 }
178 }
179 }
180 }
179 }
180 }
|
|
|
|
|
|
IPPhone IP is 192.168.1.2; Sip Proxy IP is 192.168.1.253
When IPPhone Register , the SIP fails the process and shows the error.
What can I do to resolve it ?
////// error log//////////
System.FormatException: 輸入字串格式不正確。(translation: input string wrong)
於 System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
於 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
於 System.Convert.ToInt32(String value)
於 LumiSoft.Net.AUTH.Auth_HttpDigest.Parse(String digestResponse) 於 D:\Csharp Book\LumiSoft.Net\Net\Net\AUTH\Auth_HttpDigest.cs: 行(row) 126
於 LumiSoft.Net.AUTH.Auth_HttpDigest..ctor(String digestResponse, String requestMethod) 於 D:\Csharp Book\LumiSoft.Net\Net\Net\AUTH\Auth_HttpDigest.cs: 行 35
於 LumiSoft.Net.SIP.SIP_Utils.GetCredentials(SIP_Request request, String realm) 於 D:\Csharp Book\LumiSoft.Net\Net\Net\SIP\SIP_Utils.cs: 行 145
於 LumiSoft.Net.SIP.Proxy.SIP_Proxy.AuthenticateRequest(SIP_RequestReceivedEventArgs e, String& userName) 於 D:\Csharp Book\LumiSoft.Net\Net\Net\SIP\Proxy\SIP_Proxy.cs: 行 823
於 LumiSoft.Net.SIP.Proxy.SIP_Proxy.ForwardRequest(Boolean statefull, SIP_RequestReceivedEventArgs e, Boolean addRecordRoute) 於 D:\Csharp Book\LumiSoft.Net\Net\Net\SIP\Proxy\SIP_Proxy.cs: 行 351
於 LumiSoft.Net.SIP.Proxy.SIP_Proxy.OnRequestReceived(SIP_RequestReceivedEventArgs e) 於 D:\Csharp Book\LumiSoft.Net\Net\Net\SIP\Proxy\SIP_Proxy.cs: 行 174
///////reg log////////
Transaction [branch='z9hG4bK4e8808b81af58f0f0f98f9fae0fa8ac6';method='REGISTER';IsServer=true] timer I(Non-INVITE request retransmission wait) triggered.
Transaction [branch='z9hG4bK4e8808b81af58f0f0f98f9fae0fa8ac6';method='REGISTER';IsServer=True] switched to 'Terminated' state.
Request [method='REGISTER'; cseq='781'; transport='UDP'; size='401'; received '192.168.1.2:5060' -> '192.168.1.253:5060'.
REGISTER sip:192.168.1.253 SIP/2.0
Call-ID: 4099112003-3E8B-0007
Contact:
CSeq: 781 REGISTER
Expires: 3600
From: "101" ;tag=50-831083433
Max-Forwards: 70
To: "101"
User-Agent: AmRoad
Via: SIP/2.0/UDP 192.168.1.2:5060;rport=5060;branch=z9hG4bKed119c3b6e431f736168068fd9086387;received=192.168.1.2
Content-Length: 0
Transaction [branch='z9hG4bKed119c3b6e431f736168068fd9086387';method='REGISTER';IsServer=true] created.
Transaction [branch='z9hG4bKed119c3b6e431f736168068fd9086387';method='REGISTER';IsServer=True] switched to 'Trying' state.
Response [flowReuse=true; transactionID='z9hG4bKed119c3b6e431f736168068fd9086387'; method='REGISTER'; cseq='781'; transport='UDP'; size='505'; statusCode='407'; reason='Proxy Authentication Required'; sent '192.168.1.253:5060' -> '192.168.1.2:5060'.
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.1.2:5060;rport=5060;branch=z9hG4bKed119c3b6e431f736168068fd9086387;received=192.168.1.2
From: "101" ;tag=50-831083433
To: "101" ;tag=91b64c1f81bef5e95e30cea3
Call-ID: 4099112003-3E8B-0007
CSeq: 781 REGISTER
Allow: INVITE,ACK,CANCEL,BYE,MESSAGE
Proxy-Authenticate: digest realm="",nonce="61bc850c786241f19f57580448a9480b",opaque="1d795f4460ec4cfd9892f4ecd50d91c7"
Content-Length: 0
Transaction [branch='z9hG4bKed119c3b6e431f736168068fd9086387';method='REGISTER';IsServer=True] switched to 'Completed' state.
Transaction [branch='z9hG4bKed119c3b6e431f736168068fd9086387';method='REGISTER';IsServer=true] timer J(Non-INVITE request retransmission wait) started, will trigger after 32000.
Request [method='REGISTER'; cseq='782'; transport='UDP'; size='626'; received '192.168.1.2:5060' -> '192.168.1.253:5060'.
REGISTER sip:192.168.1.253 SIP/2.0
Call-ID: 4099112003-3E8B-0007
Contact:
CSeq: 782 REGISTER
Expires: 3600
From: "101" ;tag=50-831083433
Max-Forwards: 70
Proxy-Authorization: Digest username="101@test.com",realm="",nonce="61bc850c786241f19f57580448a9480b",uri="sip:192.168.1.253",response="5dce688c47b46a36dddfe8b8c162fbf8",opaque="1d795f4460ec4cfd9892f4ecd50d91c7",nc=0000030e
To: "101"
User-Agent: AmRoad
Via: SIP/2.0/UDP 192.168.1.2:5060;rport=5060;branch=z9hG4bK32d8da85d26639c06759a5a1082c56fa;received=192.168.1.2
Content-Length: 0
Response [transactionID=''; method='REGISTER'; cseq='782'; transport='UDP'; size='409'; statusCode='500'; reason='Server Internal Error: 輸入字串格式不正確。'; sent '' -> '192.168.1.2:5060'.
SIP/2.0 500 Server Internal Error: 頛詨摮葡?澆?銝迤蝣箝?
Via: SIP/2.0/UDP 192.168.1.2:5060;rport=5060;branch=z9hG4bK32d8da85d26639c06759a5a1082c56fa;received=192.168.1.2
From: "101" ;tag=50-831083433
To: "101" ;tag=0f7c40ad88cb505d4fb3ece3
Call-ID: 4099112003-3E8B-0007
CSeq: 782 REGISTER
Allow: INVITE,ACK,CANCEL,BYE,MESSAGE
Content-Length: 0
Transaction [branch='z9hG4bKed119c3b6e431f736168068fd9086387';method='REGISTER';IsServer=true] timer I(Non-INVITE request retransmission wait) triggered.
Transaction [branch='z9hG4bKed119c3b6e431f736168068fd9086387';method='REGISTER';IsServer=True] switched to 'Terminated' state.
|
|
|
|
|
Hi,
One thing what i see ... is :
To: Can not be just "101", it must be URI.
Normally valu like "sip:101@somedomian.com"
|
|
|
|
|
Finally I set the Registrar as URL, than Register process is successful.
IP Phone : IP: 192.168.1.2, UserName: 101, Account: 101, PassWord:1234 , SIP Proxy: 192.168.1.253, Registrar: test.com
SIP Proxy: Setting Tab -> IP: 192.168.1.253, User Account: 101, PassWord:1234 , Address: 101@test.com
///////////////
But new problem happen. After the Communication between two IP Phones and the sip flows disposed, I redial a phone but get a error message as following:
=========error log======================================
System.ObjectDisposedException: Fail to access the Disposed object 。
object name: 'SIP_Flow'。
於 LumiSoft.Net.SIP.Stack.SIP_Flow.get_ID() 於 D:\Csharp Book\LumiSoft.Net\Net\Net\SIP\Stack\SIP_Flow.cs: 行 477
於 LumiSoft.Net.SIP.Proxy.SIP_ProxyContext.TargetHandler.SendToFlow(SIP_Flow flow, SIP_Request request) 於 D:\Csharp Book\LumiSoft.Net\Net\Net\SIP\Proxy\SIP_ProxyContext.cs: 行 615
於 LumiSoft.Net.SIP.Proxy.SIP_ProxyContext.TargetHandler.Start() 於 D:\Csharp Book\LumiSoft.Net\Net\Net\SIP\Proxy\SIP_ProxyContext.cs: 行 532
於 LumiSoft.Net.SIP.Proxy.SIP_ProxyContext.Start() 於 D:\Csharp Book\LumiSoft.Net\Net\Net\SIP\Proxy\SIP_ProxyContext.cs: 行 1025
於 LumiSoft.Net.SIP.Proxy.SIP_Proxy.ForwardRequest(Boolean statefull, SIP_RequestReceivedEventArgs e, Boolean addRecordRoute) 於 D:\Csharp Book\LumiSoft.Net\Net\Net\SIP\Proxy\SIP_Proxy.cs: 行 587
於 LumiSoft.Net.SIP.Proxy.SIP_Proxy.OnRequestReceived(SIP_RequestReceivedEventArgs e) 於 D:\Csharp Book\LumiSoft.Net\Net\Net\SIP\Proxy\SIP_Proxy.cs: 行 174
===========sip log=============================
Transaction [branch='z9hG4bK0b3458bd91bbc9dbac04f955c639d475';method='BYE';IsServer=True] switched to 'Completed' state.
Transaction [branch='z9hG4bK0b3458bd91bbc9dbac04f955c639d475';method='BYE';IsServer=true] timer J(Non-INVITE request retransmission wait) started, will trigger after 32000.
Transaction [branch='z9hG4bK-75d6c012c1be4f818bf8a145592ddeee';method='BYE';IsServer=False] switched to 'Completed' state.
Transaction [branch='z9hG4bK-75d6c012c1be4f818bf8a145592ddeee';method='BYE';IsServer=false] timer K(Non-INVITE 3xx - 6xx response retransmission wait) started, will trigger after 5000.
Transaction [branch='z9hG4bK-75d6c012c1be4f818bf8a145592ddeee';method='BYE';IsServer=false] timer K(Non-INVITE 3xx - 6xx response retransmission wait) triggered.
Transaction [branch='z9hG4bK-75d6c012c1be4f818bf8a145592ddeee';method='BYE';IsServer=False] switched to 'Terminated' state.
Transaction [branch='z9hG4bK-75d6c012c1be4f818bf8a145592ddeee';method='BYE';IsServer=false] disposed.
Transaction [branch='z9hG4bK-75d6c012c1be4f818bf8a145592ddeee';method='BYE';IsServer=False] switched to 'Disposed' state.
ProxyContext(id='c4251e80-8ba0-40bb-b172-97f8980427fa') disposed.
Request [method='INVITE'; cseq='8'; transport='UDP'; size='780'; received '192.168.1.2:5060' -> '192.168.1.253:5060'.
INVITE sip:103@test2.com SIP/2.0
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,REGISTER,INFO,PRACK,REFER,UPDATE
Call-ID: 4190661699-2B8D-0006
Contact: "102"
Content-Type: application/sdp
CSeq: 8 INVITE
Expires: 180
From: "102" ;tag=40-1766746275
Max-Forwards: 70
Supported: replaces,timer
To:
User-Agent: AmRoad
Via: SIP/2.0/UDP 192.168.1.2:5060;rport=5060;branch=z9hG4bK3e67bd1a77d7ca7954d700aceac28d13;received=192.168.1.2
Content-Length: 263
v=0
o=102 4190661697 4190661697 IN IP4 192.168.1.2
s=Session SDP
c=IN IP4 192.168.1.2
t=0 0
m=audio 9016 RTP/AVP 18 0 8 101
a=ptime:20
a=rtpmap:18 G729/8000
a=rtpmap PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000/1
a=fmtp:101 0-15
Transaction [branch='z9hG4bK3e67bd1a77d7ca7954d700aceac28d13';method='INVITE';IsServer=true] created.
Transaction [branch='z9hG4bK3e67bd1a77d7ca7954d700aceac28d13';method='INVITE';IsServer=True] switched to 'Proceeding' state.
ProxyContext(id='5b232fdc-fdae-4828-a96a-e771034269e4') created.
Response [transactionID=''; method='INVITE'; cseq='8'; transport='UDP'; size='423'; statusCode='500'; reason='Server Internal Error: Fail to access the Disposed object。
object name: 'SIP_Flow'。'; sent '' -> '192.168.1.2:5060'.
SIP/2.0 500 Server Internal Error:
object name: 'SIP_Flow'
Via: SIP/2.0/UDP 192.168.1.2:5060;rport=5060;branch=z9hG4bK3e67bd1a77d7ca7954d700aceac28d13;received=192.168.1.2
From: "102" ;tag=40-1766746275
To: ;tag=a18f4a78a3a52b0e8ff37026
Call-ID: 4190661699-2B8D-0006
CSeq: 8 INVITE
Allow: INVITE,ACK,CANCEL,BYE,MESSAGE
Content-Length: 0
Request [transactionID='z9hG4bK3e67bd1a77d7ca7954d700aceac28d13'; method='ACK'; cseq='8'; transport='UDP'; size='332'; received '192.168.1.253:5060' <- '192.168.1.2:5060'.
ACK sip:103@test2.com SIP/2.0
Call-ID: 4190661699-2B8D-0006
CSeq: 8 ACK
From: "102" ;tag=40-1766746275
Max-Forwards: 70
To: ;tag=a18f4a78a3a52b0e8ff37026
Via: SIP/2.0/UDP 192.168.1.2:5060;rport=5060;branch=z9hG4bK3e67bd1a77d7ca7954d700aceac28d13;received=192.168.1.2
Content-Length: 0
Response [flowReuse=true; transactionID='z9hG4bK3e67bd1a77d7ca7954d700aceac28d13'; method='INVITE'; cseq='8'; transport='UDP'; size='344'; statusCode='100'; reason='Trying'; sent '192.168.1.253:5060' -> '192.168.1.2:5060'.
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.2:5060;rport=5060;branch=z9hG4bK3e67bd1a77d7ca7954d700aceac28d13;received=192.168.1.2
From: "102" ;tag=40-1766746275
To: ;tag=a18f4a78a3a52b0e8ff37026
Call-ID: 4190661699-2B8D-0006
CSeq: 8 INVITE
Allow: INVITE,ACK,CANCEL,BYE,MESSAGE
Content-Length: 0
Transaction [branch='z9hG4bK0b3458bd91bbc9dbac04f955c639d475';method='BYE';IsServer=true] timer I(Non-INVITE request retransmission wait) triggered.
Transaction [branch='z9hG4bK0b3458bd91bbc9dbac04f955c639d475';method='BYE';IsServer=True] switched to 'Terminated' state.
|
|
|
|
|
Conatct and from fields must be URI too, not sure if that changes anything.
|
|
|
|
|
THX !
But My IP Phone(wvp-800) do not have a item to set domain name but IP.
ps: IP Phone : model: wvp-800 url: http://www.welltech.com/product_e_0l.htm
|
|
|
|
|
Hi Ivar,
Recentlly I got a task to navigate phone calls done from voip adapter (using sip protocol). Your solution seems to be exellent, but I do not know how to connect and set all these things. I run your Sip Proxy demo on my comuter and create users [test1; test2] in Settings tab. After setting voip adapter [sip proxy=MyComputerIP; Line1=test1; Line2=test2], the lines are appeared in Registrations tab. Also in Gateways tab I added corectlly sip gateway (sip.example_sip.com or IP of the sip proxy), but I can not make a call. When I try to make a call there is a busy tone (Destination not found).
Please help me with this, Thanks
|
|
|
|
|
Hi,
You should not fill gateway. Gateway is meant for other URI than sip like "tel:".
This proxy application can only forward call to public endpoint server.
It' just uses domain name from URI and finds right server for it.
I guess that you try to forward call to internal server, thats why you get this answer.
|
|
|
|
|
Hello,
i would like to ask you if you know any source code for sip client with Video support that works fine ?
Thanks
wael
|
|
|
|
|
Hi,
Sorry i don't know any.
|
|
|
|
|
Hi,
I have a few questions about RTCP.
Let's assume that a SIP connection between 2 soft-phones, A and B, is established.
1. Subsequently, if A sends a RTCP sender report to B, is B required to send something like ACK back to A?
2. How often is A supposed to send a RTCP sender/receiver report to B?
3. If A sends a RTCP packet with RTP version set to 0 (instead of 2), will B complain and cause some delay?
Thanks.
|
|
|
|
|
Hi,
>1. Subsequently, if A sends a RTCP sender report to B, is B required to send something like ACK back to A?
No.
>2. How often is A supposed to send a RTCP sender/receiver report to B?
It depends how many participants in session. The formula is defined in RTP rfc.
>3. If A sends a RTCP packet with RTP version set to 0 (instead of 2), will B complain and cause some delay?
No. Also RTCP is optional.
|
|
|
|
|
Thanks for your reply.
I am having a problem calling from a landline to a sip client via a sip provider. (Landline-->SIP provider-->Asterisk (NATed)-->SIP client)
The problem is that after a session is established, I always have to wait about 19 seconds before I can hear things from the SIP client.
WireShark shows SIP packets are exchanged properly as soon as a call comes in.
And during the wait, I also see a few "Unknown RTP version 0" packets in WireShark.
Some people on the Internet said this may have something to do with incorrect codec, but in my case, I can still hear things from the SIP client.
What might be causing this problem? How do I narrow down the problem? Thanks again.
|
|
|
|
|
There can be NAT/firewall problems. It't may block data communication on one way.
|
|
|
|
|
When using the AuthContext.get, the function can get the user name, realm, algorithm...but the password is empty.
What is the problem? In the userInfo of the server can get the password, but when compare witht the e.AuthContext.password, it is empty.
In the application: For registration, it need:
Domain : <server ip=""> (without port:5060)
User : 100
Password: 123456
Auth ID: 100
Expire Time: 1000
In the AuthContext can get username = Auth ID....why not User property?? Is me set the wrong property?
|
|
|
|
|
This is because you need to set password: e.AuthContext = password;
Then server authenticates user.
|
|
|
|
|
But in the private void SIP_Authenticate(SIP_AuthenticateEventArgs e)
See the property,it cannot found the value of password.
Where can i set it again?
|
|
|
|
|
Server must know user password.
|
|
|
|
|
e.AuthContext = {realm="192.168.1.1",username="100",nonce="613b61d6c7054dcb97b6bc9009fb80a1",nc="1",
cnonce="",response="25a1a0b3f387d627164b93b8f76cdb71",opaque="c9ca6ab13eff454092ec20d02d0fb591",
uri="sip:192.168.1.1"}
There is no password in the authContext. And see the property, the value is empty. The other information is correct.
|
|
|
|
|
As i said already you need to "PROVIDE" password for conecting client there.
If you provide it, server will calculate Digest-MD5 and compares it to client diegst.
|
|
|
|
|
In the client application has provide the password. Using other server, the server can get the password correctly.
But use the same configuration, in the sip proxy server can get the username, realm...only missing password.
So it will show the error 407 proxy authentication.
|
|
|
|
|
Demo app searches user/word auto matically: If user is created in demo apllication and realm of demo application and connecting client matches.
|
|
|
|
|
When i try the demo version, the log can see the realm is missing.
|
|
|
|
|
I have try the other client application"X-Lite 4"
In Server:
Hostname = 192.168.1.1
Listening Port = 5060
create account:
user = 100
pw = 123456
AOR = 100@192.168.1.1
In Client:
User ID = 100
Domain = 192.168.1.1
Password = 123456
Display name = 100
Authorization name = 100
Domain Proxy
(selected) Register with domain and receive call
Send outbound via: Proxy and IP = 192.168.1.124
But use the demo the password is also missing. Do you have idea?
Is setting problem or other problem?
Is it possible to change SIP_AuthenticateEventArgs e?
modified on Friday, March 4, 2011 4:11 AM
|
|
|
|
|