ISipRegistrationListener.OnRegistrationDone( ) giving too high values for expiration time
up vote
0
down vote
favorite
I'm successfully registering a SipProfile with 1 hour expiration. I see the REGISTER message in Wireshark on the SIP server machine, re-sent with authorization.
Brekeke replies immediately with a STATUS: 200 OK, passing back 'Expires:3600'.
Both Xamarin's and Android's docs tell me that lExpire
should be duration in seconds before the registration expires, so it represents an interval. I multiply by TimeSpan.TicksPerSecond
to convert to TimeSpan, 3600 would result in 0.01:00:00
:
void ISipRegistrationListener.OnRegistrationDone( string lclPrfUri, long lExpire )
{
long l= DateTime.Now.Ticks;
double d= (double)l / lExpire;
string s= string.Format( "RegSucced( '{0}', {1} ), {2}, {3}", lclPrfUri, lExpire,
new TimeSpan( lExpire * TimeSpan.TicksPerSecond )
.ToString( "d\.hh\:mm\:ss" ), d );
..
}
But i'm getting values in the range of 1.5 trillions (1'541'195'345'242)!
As i saw it constantly growing with time, i thought it might be related to Ticks, so i exposed both and gathered the following statistics (H == T + 1 hour -- expected expiration):
# DT.Now.Ticks (T) lExpire (E) T/E ratio T+36000000000 (H) H/E ratio
1 636767624266839520 1541183611836 413167.918 636767660266839520 413167.941
2 636767669188704010 1541188122398 413166.738 636767705188704010 413166.761
3 636767670260843180 1541188229643 413166.710 636767706260843180 413166.733
4 636767670974718350 1541188301027 413166.691 636767706974718350 413166.715
5 636767693193745790 1541190522922 413166.110 636767729193745790 413166.133
And the ratios look surprisingly consistent, though the magic of 413166 escapes me.. And from that lExpire
looks more like a reference to a point in time, than an interval, no?
But according to docs i should get 3600 without any scaling factors, right? What is going on??!
android c#-4.0 xamarin.android sip
add a comment |
up vote
0
down vote
favorite
I'm successfully registering a SipProfile with 1 hour expiration. I see the REGISTER message in Wireshark on the SIP server machine, re-sent with authorization.
Brekeke replies immediately with a STATUS: 200 OK, passing back 'Expires:3600'.
Both Xamarin's and Android's docs tell me that lExpire
should be duration in seconds before the registration expires, so it represents an interval. I multiply by TimeSpan.TicksPerSecond
to convert to TimeSpan, 3600 would result in 0.01:00:00
:
void ISipRegistrationListener.OnRegistrationDone( string lclPrfUri, long lExpire )
{
long l= DateTime.Now.Ticks;
double d= (double)l / lExpire;
string s= string.Format( "RegSucced( '{0}', {1} ), {2}, {3}", lclPrfUri, lExpire,
new TimeSpan( lExpire * TimeSpan.TicksPerSecond )
.ToString( "d\.hh\:mm\:ss" ), d );
..
}
But i'm getting values in the range of 1.5 trillions (1'541'195'345'242)!
As i saw it constantly growing with time, i thought it might be related to Ticks, so i exposed both and gathered the following statistics (H == T + 1 hour -- expected expiration):
# DT.Now.Ticks (T) lExpire (E) T/E ratio T+36000000000 (H) H/E ratio
1 636767624266839520 1541183611836 413167.918 636767660266839520 413167.941
2 636767669188704010 1541188122398 413166.738 636767705188704010 413166.761
3 636767670260843180 1541188229643 413166.710 636767706260843180 413166.733
4 636767670974718350 1541188301027 413166.691 636767706974718350 413166.715
5 636767693193745790 1541190522922 413166.110 636767729193745790 413166.133
And the ratios look surprisingly consistent, though the magic of 413166 escapes me.. And from that lExpire
looks more like a reference to a point in time, than an interval, no?
But according to docs i should get 3600 without any scaling factors, right? What is going on??!
android c#-4.0 xamarin.android sip
Not quite get the meaning of double d= (double)l / lExpire; As l (long l= DateTime.Now.Ticks;) means the number of ticks that have elapsed since the beginning of the twenty-first century
– AbbyWang
Nov 7 at 9:15
For more info, please refer to docs.microsoft.com/en-us/dotnet/api/…
– AbbyWang
Nov 7 at 9:37
The thought was, maybe observed value is tied to Ticks?
– Astrogator
Nov 7 at 20:07
Why do you useDateTime.Now.Ticks
to divided by lExpire?
– Elvis Xia - MSFT
Nov 8 at 1:05
Because the values oflExpire
that i observe keep growing with time. So i thought maybe they are scaled from Ticks. => i tried to get stats on their ratio. While not exact that ratio is close to 413166±5, which is not magic in any way to me. I'll add stats to the question.
– Astrogator
Nov 8 at 15:27
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm successfully registering a SipProfile with 1 hour expiration. I see the REGISTER message in Wireshark on the SIP server machine, re-sent with authorization.
Brekeke replies immediately with a STATUS: 200 OK, passing back 'Expires:3600'.
Both Xamarin's and Android's docs tell me that lExpire
should be duration in seconds before the registration expires, so it represents an interval. I multiply by TimeSpan.TicksPerSecond
to convert to TimeSpan, 3600 would result in 0.01:00:00
:
void ISipRegistrationListener.OnRegistrationDone( string lclPrfUri, long lExpire )
{
long l= DateTime.Now.Ticks;
double d= (double)l / lExpire;
string s= string.Format( "RegSucced( '{0}', {1} ), {2}, {3}", lclPrfUri, lExpire,
new TimeSpan( lExpire * TimeSpan.TicksPerSecond )
.ToString( "d\.hh\:mm\:ss" ), d );
..
}
But i'm getting values in the range of 1.5 trillions (1'541'195'345'242)!
As i saw it constantly growing with time, i thought it might be related to Ticks, so i exposed both and gathered the following statistics (H == T + 1 hour -- expected expiration):
# DT.Now.Ticks (T) lExpire (E) T/E ratio T+36000000000 (H) H/E ratio
1 636767624266839520 1541183611836 413167.918 636767660266839520 413167.941
2 636767669188704010 1541188122398 413166.738 636767705188704010 413166.761
3 636767670260843180 1541188229643 413166.710 636767706260843180 413166.733
4 636767670974718350 1541188301027 413166.691 636767706974718350 413166.715
5 636767693193745790 1541190522922 413166.110 636767729193745790 413166.133
And the ratios look surprisingly consistent, though the magic of 413166 escapes me.. And from that lExpire
looks more like a reference to a point in time, than an interval, no?
But according to docs i should get 3600 without any scaling factors, right? What is going on??!
android c#-4.0 xamarin.android sip
I'm successfully registering a SipProfile with 1 hour expiration. I see the REGISTER message in Wireshark on the SIP server machine, re-sent with authorization.
Brekeke replies immediately with a STATUS: 200 OK, passing back 'Expires:3600'.
Both Xamarin's and Android's docs tell me that lExpire
should be duration in seconds before the registration expires, so it represents an interval. I multiply by TimeSpan.TicksPerSecond
to convert to TimeSpan, 3600 would result in 0.01:00:00
:
void ISipRegistrationListener.OnRegistrationDone( string lclPrfUri, long lExpire )
{
long l= DateTime.Now.Ticks;
double d= (double)l / lExpire;
string s= string.Format( "RegSucced( '{0}', {1} ), {2}, {3}", lclPrfUri, lExpire,
new TimeSpan( lExpire * TimeSpan.TicksPerSecond )
.ToString( "d\.hh\:mm\:ss" ), d );
..
}
But i'm getting values in the range of 1.5 trillions (1'541'195'345'242)!
As i saw it constantly growing with time, i thought it might be related to Ticks, so i exposed both and gathered the following statistics (H == T + 1 hour -- expected expiration):
# DT.Now.Ticks (T) lExpire (E) T/E ratio T+36000000000 (H) H/E ratio
1 636767624266839520 1541183611836 413167.918 636767660266839520 413167.941
2 636767669188704010 1541188122398 413166.738 636767705188704010 413166.761
3 636767670260843180 1541188229643 413166.710 636767706260843180 413166.733
4 636767670974718350 1541188301027 413166.691 636767706974718350 413166.715
5 636767693193745790 1541190522922 413166.110 636767729193745790 413166.133
And the ratios look surprisingly consistent, though the magic of 413166 escapes me.. And from that lExpire
looks more like a reference to a point in time, than an interval, no?
But according to docs i should get 3600 without any scaling factors, right? What is going on??!
android c#-4.0 xamarin.android sip
android c#-4.0 xamarin.android sip
edited Nov 8 at 22:18
asked Nov 2 at 22:35
Astrogator
550421
550421
Not quite get the meaning of double d= (double)l / lExpire; As l (long l= DateTime.Now.Ticks;) means the number of ticks that have elapsed since the beginning of the twenty-first century
– AbbyWang
Nov 7 at 9:15
For more info, please refer to docs.microsoft.com/en-us/dotnet/api/…
– AbbyWang
Nov 7 at 9:37
The thought was, maybe observed value is tied to Ticks?
– Astrogator
Nov 7 at 20:07
Why do you useDateTime.Now.Ticks
to divided by lExpire?
– Elvis Xia - MSFT
Nov 8 at 1:05
Because the values oflExpire
that i observe keep growing with time. So i thought maybe they are scaled from Ticks. => i tried to get stats on their ratio. While not exact that ratio is close to 413166±5, which is not magic in any way to me. I'll add stats to the question.
– Astrogator
Nov 8 at 15:27
add a comment |
Not quite get the meaning of double d= (double)l / lExpire; As l (long l= DateTime.Now.Ticks;) means the number of ticks that have elapsed since the beginning of the twenty-first century
– AbbyWang
Nov 7 at 9:15
For more info, please refer to docs.microsoft.com/en-us/dotnet/api/…
– AbbyWang
Nov 7 at 9:37
The thought was, maybe observed value is tied to Ticks?
– Astrogator
Nov 7 at 20:07
Why do you useDateTime.Now.Ticks
to divided by lExpire?
– Elvis Xia - MSFT
Nov 8 at 1:05
Because the values oflExpire
that i observe keep growing with time. So i thought maybe they are scaled from Ticks. => i tried to get stats on their ratio. While not exact that ratio is close to 413166±5, which is not magic in any way to me. I'll add stats to the question.
– Astrogator
Nov 8 at 15:27
Not quite get the meaning of double d= (double)l / lExpire; As l (long l= DateTime.Now.Ticks;) means the number of ticks that have elapsed since the beginning of the twenty-first century
– AbbyWang
Nov 7 at 9:15
Not quite get the meaning of double d= (double)l / lExpire; As l (long l= DateTime.Now.Ticks;) means the number of ticks that have elapsed since the beginning of the twenty-first century
– AbbyWang
Nov 7 at 9:15
For more info, please refer to docs.microsoft.com/en-us/dotnet/api/…
– AbbyWang
Nov 7 at 9:37
For more info, please refer to docs.microsoft.com/en-us/dotnet/api/…
– AbbyWang
Nov 7 at 9:37
The thought was, maybe observed value is tied to Ticks?
– Astrogator
Nov 7 at 20:07
The thought was, maybe observed value is tied to Ticks?
– Astrogator
Nov 7 at 20:07
Why do you use
DateTime.Now.Ticks
to divided by lExpire?– Elvis Xia - MSFT
Nov 8 at 1:05
Why do you use
DateTime.Now.Ticks
to divided by lExpire?– Elvis Xia - MSFT
Nov 8 at 1:05
Because the values of
lExpire
that i observe keep growing with time. So i thought maybe they are scaled from Ticks. => i tried to get stats on their ratio. While not exact that ratio is close to 413166±5, which is not magic in any way to me. I'll add stats to the question.– Astrogator
Nov 8 at 15:27
Because the values of
lExpire
that i observe keep growing with time. So i thought maybe they are scaled from Ticks. => i tried to get stats on their ratio. While not exact that ratio is close to 413166±5, which is not magic in any way to me. I'll add stats to the question.– Astrogator
Nov 8 at 15:27
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53126617%2fisipregistrationlistener-onregistrationdone-giving-too-high-values-for-expira%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Not quite get the meaning of double d= (double)l / lExpire; As l (long l= DateTime.Now.Ticks;) means the number of ticks that have elapsed since the beginning of the twenty-first century
– AbbyWang
Nov 7 at 9:15
For more info, please refer to docs.microsoft.com/en-us/dotnet/api/…
– AbbyWang
Nov 7 at 9:37
The thought was, maybe observed value is tied to Ticks?
– Astrogator
Nov 7 at 20:07
Why do you use
DateTime.Now.Ticks
to divided by lExpire?– Elvis Xia - MSFT
Nov 8 at 1:05
Because the values of
lExpire
that i observe keep growing with time. So i thought maybe they are scaled from Ticks. => i tried to get stats on their ratio. While not exact that ratio is close to 413166±5, which is not magic in any way to me. I'll add stats to the question.– Astrogator
Nov 8 at 15:27