<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Great!</p>
<p><br>
</p>
<p>Thanks.<br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>De:</b> users-bounces@lists.opensips.org &lt;users-bounces@lists.opensips.org&gt; em nome de Max Mühlbronner &lt;mm@42com.com&gt;<br>
<b>Enviado:</b> segunda-feira, 28 de setembro de 2015 12:44<br>
<b>Para:</b> users@lists.opensips.org<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How to set default_timeout for dialogs, without resetting OpenSIPS ? (continuing...)</font>
<div>&nbsp;</div>
</div>
<div>
<div class="moz-cite-prefix">Sorry, copy&amp;paste mistake.<br>
<br>
<br>
if(is_present_hf(&quot;X-Timeout&quot;)){ <br>
<br>
&nbsp;&nbsp;&nbsp; $DLG_timeout =&nbsp; $(hdr(P-Source-IP)); <br>
<br>
....<br>
<br>
<br>
<br>
On 28.09.2015 17:40, Max Mühlbronner wrote:<br>
</div>
<blockquote type="cite">Hi, <br>
<br>
<br>
seems to be a simple solution, without overhead/database/... <br>
<br>
<br>
if(is_present_hf(&quot;P-Source-IP&quot;)){ <br>
<br>
&nbsp;&nbsp;&nbsp; $DLG_timeout =&nbsp; $(hdr(P-Source-IP)); <br>
<br>
}else{ <br>
<br>
&nbsp;&nbsp;&nbsp; $DLG_timeout = 3600; <br>
<br>
} <br>
<br>
<br>
<br>
But you could also save the information into a e.g. mysql/... database and pull it from the db. (check out avpops module)
<br>
<br>
<br>
Best Regards <br>
<br>
On 28.09.2015 16:51, Rodrigo Pimenta Carvalho wrote: <br>
<blockquote type="cite">Hi Bogdan. <br>
<br>
<br>
I have just finished studying about some parts of OpenSIPS documentation, mainly about the modules.
<br>
<br>
<br>
I saw that it is possible to take control of call duration using Call Control,which is too complex to my simple needings as my projetct doesn't need a charging system, or using DLG_timeout as you well pointed.
<br>
<br>
<br>
So, in my OpenSIPS script I should do something like this: <br>
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # account only INVITEs <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (is_method(&quot;INVITE&quot;)) { <br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # create dialog with timeout <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( !create_dialog(&quot;B&quot;) ) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; send_reply(&quot;500&quot;,&quot;Internal Server Error&quot;); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DLG_timeout = &lt;some variable with amount of seconds&gt;; <br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>
<br>
<br>
However the final user is the one who must define how long a call can exist. Such configuration will be done via a proprietary GUI in my project, any time.
<br>
<br>
So, I was looking for a way to set&nbsp; 'some variable with amount of seconds' and pass it to OpenSIPS, before starting calls. That is, how can OpenSIPS read a external variable or how to write DLG_timout via MI ? I didn't find a solution.
<br>
<br>
<br>
Then, my development team has decided to put a new field (X-Timeout) in the SIP INVITE header, configuring it with the desired amount of seconds.
<br>
<br>
So, in the OpenSIPS script we could read the value from X-Timeout and set it to the DLG_timeout.
<br>
<br>
<br>
What do you think about this approach? Is it simple to read a header field from SIP INVITE, isn't it? I will take a look in the documentation.
<br>
<br>
<br>
Any hint or suggestion will be&nbsp; very helpful!! <br>
<br>
<br>
Thanks a lot! <br>
<br>
<br>
RODRIGO PIMENTA CARVALHO <br>
Inatel Competence Center <br>
Software <br>
Ph: &#43;55 35 3471 9200 RAMAL 979 <br>
<br>
<br>
________________________________ <br>
De: Bogdan-Andrei Iancu <a class="moz-txt-link-rfc2396E" href="mailto:bogdan@opensips.org">
&lt;bogdan@opensips.org&gt;</a> <br>
Enviado: segunda-feira, 28 de setembro de 2015 07:03 <br>
Para: OpenSIPS users mailling list; Rodrigo Pimenta Carvalho <br>
Assunto: Re: [OpenSIPS-Users] How to set default_timeout for dialogs, without resetting OpenSIPS ?
<br>
<br>
Hi Rodrigo, <br>
<br>
The timeout for a call can be set (in a per-call manner) when the call starts (during re-INVITE) or during any sequential requests (ACK, re-INVITE), etc. See DLG_timeout variable:
<br>
&nbsp;&nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.11.x/dialog.html#timeout-pvar-id">
http://www.opensips.org/html/docs/modules/1.11.x/dialog.html#timeout-pvar-id</a><br>
<br>
If you want to tear down the call, use the dlg_end_dlg MI command : <br>
&nbsp;&nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.11.x/dialog.html#id296795">
http://www.opensips.org/html/docs/modules/1.11.x/dialog.html#id296795</a> <br>
<br>
Best regards, <br>
<br>
Bogdan-Andrei Iancu <br>
OpenSIPS Founder and Developer <br>
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
<br>
<br>
On 25.09.2015 23:56, Rodrigo Pimenta Carvalho wrote: <br>
<br>
<br>
Dear OpenSIPS-Users, <br>
<br>
<br>
A kind of management application in my project must provide an way of a&nbsp; system manager sets the default_timeout for dialogs in our already running OpenSIPS. How to do it?
<br>
<br>
<br>
I was looking for an way of sending a command to OpenSIPS 2.2 to configure it to tear down (hang up) every call after a determined timeout. So I have just read about MI, dialog exported MI functions and dialog exported pseud-variables. What I want is to configure
 the default_timeout without having to reset the OpenSIPS. <br>
<br>
<br>
However, I didn't find a way of doing that. I was thing about to use mi_fifo and a exported command, but no way.
<br>
<br>
<br>
Is there a way of controlling the default_timeout for dialogs, while OpenSIPS is running?
<br>
<br>
<br>
If not, I was thinking about changing the value of timeout column in the table dialog, for each dialog. But, it sounds a bit complicated.
<br>
<br>
<br>
Any idea? <br>
<br>
<br>
Any hint will be very helpful! <br>
<br>
<br>
Best regards. <br>
<br>
<br>
<br>
<br>
RODRIGO PIMENTA CARVALHO <br>
Inatel Competence Center <br>
Software <br>
Ph: &#43;55 35 3471 9200 RAMAL 979 <br>
<br>
<br>
<br>
_______________________________________________ <br>
Users mailing list <br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><a class="moz-txt-link-rfc2396E" href="mailto:Users@lists.opensips.org">&lt;mailto:Users@lists.opensips.org&gt;</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________ <br>
Users mailing list <br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
<br>
</blockquote>
<br>
<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div>
</div>
</div>
</body>
</html>