[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sr-dev
Subject:    Re: [sr-dev] dlg_isflagset not working on CANCEL request
From:       Henning Westerholt <hw () gilawa ! com>
Date:       2022-04-27 17:53:42
Message-ID: PAXPR05MB85584D6F417F7D8ED6FA774DBFFA9 () PAXPR05MB8558 ! eurprd05 ! prod ! outlook ! com
[Download RAW message or body]

[Attachment #2 (text/plain)]

Hello,

thanks for the message. Please open a pull request against git master branch for \
easier review and possible discussion on our github tracker.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com<https://gilawa.com/>

From: sr-dev <sr-dev-bounces@lists.kamailio.org> On Behalf Of David Escartín
Sent: Monday, April 11, 2022 3:56 PM
To: Kamailio (SER) - Development Mailing List <sr-dev@lists.kamailio.org>; Javier \
                Gallart <jgallart@sonoc.io>; Vicente Hernando <vhernando@sonoc.io>
Subject: [sr-dev] dlg_isflagset not working on CANCEL request

hello all

Using kamailio 5.4 version, we have seen that dlg_isflagset is not detecting a dialog \
flag set in the request route for the initial INVITE, when a CANCEL request arrives. \
We have applied this change to set the dialog context unique ide for this request. \
Since it's done on dlg_onreply, dlg_onroute and dlg_ontimeout functions. This way, \
dlg_get_by_iuid(&dctx->iuid) in the function ki_dlg_isflagset is not NULL and dialog \
flags are detected. Is this change correct? Or can it generate any kind of issues?

diff --git a/src/modules/dialog/dlg_handlers.c b/src/modules/dialog/dlg_handlers.c
index 3f8adefb79..f1df4a76c5 100644
--- a/src/modules/dialog/dlg_handlers.c
+++ b/src/modules/dialog/dlg_handlers.c
@@ -1255,6 +1255,9 @@ dlg_cell_t *dlg_lookup_msg_dialog(sip_msg_t *msg, unsigned int \
                *dir)
                                msg->callid->body.len, msg->callid->body.s);
                return NULL;
        }
+        if(msg->first_line.u.request.method_value == METHOD_CANCEL) {
+                dlg_set_ctx_iuid(dlg);
+        }
        if(dir) *dir = vdir;
        return dlg;
 }

thanks a lot and regards
David


--
[https://www.sonoc.io/wp-content/uploads/2020/07/Logo_SONOC_emails.png]<http://www.sonoc.io/>
 David Escartín
NOC engineer
www.sonoc.io<http://www.sonoc.io/>
[LinkedIn]<https://www.linkedin.com/company/sonoc>
[Twitter]<https://twitter.com/sonoc_>
[Facebook]<https://www.facebook.com/SONOCio/>
This e-mail is for the exclusive use of its recipients and may contain business \
secrets or other confidential or privileged information. Any unauthorised use, \
copying, publication or distribution of this e-mail is strictly prohibited. If you \
are not the intended recipient, please inform us immediately by replying to this \
e-mail and delete it, including any attachments or copies on your system.

In accordance with the GDPR (EU) 2016/679 and the LOPDGDD 3/2018, we inform you that \
this e-mail address and/or any other personal data you have provided us with will be \
treated by SONOC with absolute confidentiality and with the only purpose of providing \
you with the requested services, due to your condition as a client, supplier or \
because you have requested information from us at any time. These data will only be \
kept for as long as required to comply with legal obligations. You can exercise your \
rights at any time by sending an e-mail to: \
dataprotection@sonoc.io<mailto:dataprotection@sonoc.io>.<mailto:dataprotection@sonoc.io>



[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.E-MailFormatvorlage19
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span \
style="mso-fareast-language:EN-US">Hello,<o:p></o:p></span></p> <p \
class="MsoNormal"><span \
style="mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">thanks for \
the message. Please open a pull request against git master branch for easier review \
and possible discussion on our github tracker.<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US">Henning<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">-- <o:p> \
</o:p></span></p> <p class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US">Henning Westerholt – </span><span \
style="mso-fareast-language:EN-US"><a href="https://skalatan.de/blog/"><span \
lang="EN-GB" style="color:#0563C1">https://skalatan.de/blog/</span></a></span><span \
lang="EN-GB" style="mso-fareast-language:EN-US"><o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Kamailio \
services – </span><span style="mso-fareast-language:EN-US"><a \
href="https://gilawa.com/"><span lang="EN-GB" \
style="color:#0563C1">https://gilawa.com</span></a></span><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-GB" style="mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p> <div \
style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm"> <p \
class="MsoNormal" style="margin-left:35.4pt"><b>From:</b> sr-dev \
&lt;sr-dev-bounces@lists.kamailio.org&gt; <b>On Behalf Of </b>David Escartín<br>
<b>Sent:</b> Monday, April 11, 2022 3:56 PM<br>
<b>To:</b> Kamailio (SER) - Development Mailing List \
&lt;sr-dev@lists.kamailio.org&gt;; Javier Gallart &lt;jgallart@sonoc.io&gt;; Vicente \
Hernando &lt;vhernando@sonoc.io&gt;<br> <b>Subject:</b> [sr-dev] dlg_isflagset not \
working on CANCEL request<o:p></o:p></p> </div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">hello all<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Using kamailio 5.4 version, we have \
seen that dlg_isflagset is not detecting a dialog flag set in the request route for \
the initial INVITE, when a CANCEL request arrives.<o:p></o:p></p> </div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">We have applied this change to set \
the dialog context unique ide for this request. Since it's done on&nbsp;dlg_onreply, \
dlg_onroute and&nbsp;dlg_ontimeout functions. This way, \
dlg_get_by_iuid(&amp;dctx-&gt;iuid) in the function&nbsp;ki_dlg_isflagset  is not \
NULL and dialog flags are detected.<o:p></o:p></p> </div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Is this change correct? Or can it \
generate any kind of issues?<o:p></o:p></p> </div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">diff --git \
a/src/modules/dialog/dlg_handlers.c b/src/modules/dialog/dlg_handlers.c<br> index \
                3f8adefb79..f1df4a76c5 100644<br>
--- a/src/modules/dialog/dlg_handlers.c<br>
+++ b/src/modules/dialog/dlg_handlers.c<br>
@@ -1255,6 +1255,9 @@ dlg_cell_t *dlg_lookup_msg_dialog(sip_msg_t *msg, unsigned int \
*dir)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg-&gt;callid-&gt;body.len, \
msg-&gt;callid-&gt;body.s);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; return NULL;<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;if(msg-&gt;first_line.u.request.method_value == \
METHOD_CANCEL) {<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;dlg_set_ctx_iuid(dlg);<br> + &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&nbsp; &nbsp; &nbsp; &nbsp; if(dir) *dir = vdir;<br>
&nbsp; &nbsp; &nbsp; &nbsp; return dlg;<br>
&nbsp;}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">thanks a lot and regards<br>
David<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p>&nbsp;</o:p></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt">-- <o:p></o:p></p>
<div>
<div>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" \
style="width:100.0%;margin-left:35.4pt"> <tbody>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:11.25pt 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:none;border-right:dotted #009BDF 2.25pt;padding:0cm 7.5pt 0cm 0cm">
<p class="MsoNormal"><a href="http://www.sonoc.io/" target="_blank"><span \
style="font-size:1.0pt;text-decoration:none"><img border="0" width="89" height="90" \
style="width:.927in;height:.9375in" id="_x0000_i1028" \
src="https://www.sonoc.io/wp-content/uploads/2020/07/Logo_SONOC_emails.png"></span></a><span \
style="font-size:1.0pt"><o:p></o:p></span></p> </td>
<td valign="top" style="padding:0cm 0cm 0cm 7.5pt">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" \
style="width:100.0%"> <tbody>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" \
style="width:100.0%"> <tbody>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 3.75pt">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" \
style="width:100.0%"> <tbody>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="200" \
style="width:150.0pt"> <tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span \
style="font-size:12.0pt;color:#102F4A">David&nbsp;Escartín<o:p></o:p></span></p> \
</td> </tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="200" \
style="width:150.0pt"> <tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span \
style="font-size:11.5pt;color:#102F4A">NOC&nbsp;engineer<o:p></o:p></span></p> </td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="200" \
style="width:150.0pt"> <tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:11.5pt;color:#009BDF"><a \
href="http://www.sonoc.io/" target="_blank"><strong><span \
style="font-family:&quot;Calibri&quot;,sans-serif;color:#009BDF;font-weight:normal;text-decoration:none">www.sonoc.io</span></strong></a><o:p></o:p></span></p>
 </td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:15.0pt 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="200" \
style="width:150.0pt"> <tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 2.25pt 2.25pt 0cm">
<p class="MsoNormal"><a href="https://www.linkedin.com/company/sonoc" \
target="_blank"><span style="font-size:1.0pt;text-decoration:none"><img border="0" \
width="20" height="20" style="width:.2083in;height:.2083in" id="_x0000_i1027" \
src="https://drive.google.com/uc?id=1E8BjnzEth1bTE8cAulKVNZf27jIeu9hw&amp;export=download" \
alt="LinkedIn"></span></a><span style="font-size:1.0pt"><o:p></o:p></span></p> </td>
</tr>
</tbody>
</table>
</td>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 2.25pt 2.25pt 0cm">
<p class="MsoNormal"><a href="https://twitter.com/sonoc_" target="_blank"><span \
style="font-size:1.0pt;text-decoration:none"><img border="0" width="20" height="20" \
style="width:.2083in;height:.2083in" id="_x0000_i1026" \
src="https://drive.google.com/uc?id=1CJysV-sccsLgUs1D7erDvDZE2687dzIx&amp;export=download" \
alt="Twitter"></span></a><span style="font-size:1.0pt"><o:p></o:p></span></p> </td>
</tr>
</tbody>
</table>
</td>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 2.25pt 2.25pt 0cm">
<p class="MsoNormal"><a href="https://www.facebook.com/SONOCio/" \
target="_blank"><span style="font-size:1.0pt;text-decoration:none"><img border="0" \
width="20" height="20" style="width:.2083in;height:.2083in" id="_x0000_i1025" \
src="https://drive.google.com/uc?id=1PtNWDc75pvIIi2qq7Tsm4rhm52D30hSb&amp;export=download" \
alt="Facebook"></span></a><span style="font-size:1.0pt"><o:p></o:p></span></p> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:7.5pt 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="550" \
style="width:412.5pt"> <tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="text-align:justify"><span \
style="font-size:8.5pt;color:#636363">This e-mail is for the exclusive use of its \
recipients and may contain business secrets or other confidential or privileged \
information. Any unauthorised use, copying,  publication or distribution of this \
e-mail is strictly prohibited. If you are not the intended recipient, please inform \
us immediately by replying to this e-mail and delete it, including any attachments or \
copies on your system.<br> <br>
In accordance with the GDPR (EU) 2016/679 and the LOPDGDD 3/2018, we inform you that \
this e-mail address and/or any other personal data you have provided us with will be \
treated by SONOC with absolute confidentiality and with the only purpose of providing \
you  with the requested services, due to your condition as a client, supplier or \
because you have requested information from us at any time. These data will only be \
kept for as long as required to comply with legal obligations. You can exercise your \
rights at any  time by sending an e-mail to:&nbsp;</span><span \
style="font-size:8.5pt;color:#009BDF"><a href="mailto:dataprotection@sonoc.io" \
target="_blank"><strong><span \
style="font-family:&quot;Calibri&quot;,sans-serif;color:#009BDF;font-weight:normal;text-decoration:none">dataprotection@sonoc.io</span></strong></a></span><span \
style="font-size:8.5pt;color:#636363"><a href="mailto:dataprotection@sonoc.io" \
target="_blank"><strong><span \
style="font-family:&quot;Calibri&quot;,sans-serif;color:#000001;font-weight:normal;text-decoration:none">.</span></strong></a><o:p></o:p></span></p>
 </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p>&nbsp;</o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>



_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

--===============1246529537==--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic