<div dir="ltr">Update:<div><br></div><div>I have been testing and I think the way to go is taking advantage of the events generated by the dialog module (start/end/failed)...</div><div><br></div><div>I don't know if this is a bug, but shouldn't the $dlg(to_tag) be available in the event_route[dialog:start] ??</div><div><br></div><div>I can access $dlg(callid), $dlg(from_tag) but not the $dlg(to_tag) and all 3 are needed to search and terminate an existing dialog. For now i'm using $tt, but I'm wondering if this is correct or not? Let me know if I should move this topic to github...</div><div><br></div><div>Thanks!</div><div>Joel.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 25, 2018 at 4:57 PM, Joel Serrano <span dir="ltr"><<a href="mailto:joel@gogii.net" target="_blank">joel@gogii.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="auto">Hi guys,</div><div dir="auto"><br></div><div dir="auto"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">I'm trying to set kamailio to not allow simultaneous calls from the same user, but if a second call comes in, the behavior desired is to process that second call and terminate the previous (already active) one.</span><br></div><div dir="auto"><br></div><div dir="auto">Say you have call A that creates dialog A. </div><div dir="auto"><br></div><div dir="auto">Then you have call B come in, creates dialog B. </div><div dir="auto"><br></div><div dir="auto">Can I save some info from dialog (call) A in a htable for example, then check that htable for the needed info from dialog (call) B and terminate dialog (call) A if it exists?</div><div dir="auto"><br></div><div dir="auto">I think using dlg_get() and dlg_bye() would do the trick but not 100% sure how they work..</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">The example in the docs seems exactly the case:</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">dlg_get --> </span>"<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Search and set current dialog based on Call-ID, From-Tag and To-Tag parameters"</span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><div>if(dlg_get("abcdef", "123", "456"))</div><div>{</div><div><span style="white-space:pre-wrap">       </span>dlg_bye("all");</div><div>}</div></div></div><div><br></div><div>After the <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">dlg_get() and dlg_bye() what happens to call B? Does the route continue running or does it end? Will it automatically switch back to the current dialog or do you have to manually switch back running dlg_get() again? (Sorry if I'm not explaining myself correctly, let me know if it sounds confusing)</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div>Does anyone have experience with these two functions?</div><div><br></div><div><br></div><div>Thanks, </div><span class="HOEnZb"><font color="#888888"><div>Joel.</div><div dir="auto"><br></div></font></span></div>
</blockquote></div><br></div>