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'.



enter image description here



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??!



enter image description here










share|improve this question
























  • 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















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'.



enter image description here



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??!



enter image description here










share|improve this question
























  • 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













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'.



enter image description here



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??!



enter image description here










share|improve this question















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'.



enter image description here



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??!



enter image description here







android c#-4.0 xamarin.android sip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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


















  • 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
















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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







這個網誌中的熱門文章

Hercules Kyvelos

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud