-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sipsess: add sipsess_msg getter function #1225
Conversation
d66e220
to
19194c3
Compare
src/sipsess/sess.c
Outdated
if (!sess) | ||
return false; | ||
|
||
return sess->msg == msg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it more robust to compare the Call-ID instead of a raw pointer ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe yes. I have to check how the re-send mechanism is handled in re/baresip and how the postponed call to ua_accept() may influence this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sip->ht_strans
hash table is used to avoid that two SIP messages with equal via.branch are processed twice. This avoids also that two SIP message (with different pointers) with equal call-id are processed twice. This is handled all by re
.
So I think that comparing the pointers are perfect in order to avoid that multiple call objects are allocated for one SIP INVITE.
edit: Comparing call-id would also work. Does it have any benefit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edit: Comparing call-id would also work. Does it have any benefit?
Let's say you duplicate the sip_msg
for some reason (multi threading...):
struct sip_msg msg = *msg_orig;
sipsess_msg_equal(csess, &msg);
This would fail.
Used for: baresip/baresip#3236