<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
<br>
seems to be a simple solution, without overhead/database/...<br>
<br>
<br>
if(is_present_hf("P-Source-IP")){<br>
<br>
$DLG_timeout = $(hdr(P-Source-IP));<br>
<br>
}else{<br>
<br>
$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>
</div>
<blockquote
cite="mid:BLUPR02MB1683C9B08C868EA87AB6451CB54F0@BLUPR02MB1683.namprd02.prod.outlook.com"
type="cite">
<pre wrap="">
Hi Bogdan.
I have just finished studying about some parts of OpenSIPS documentation, mainly about the modules.
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.
So, in my OpenSIPS script I should do something like this:
# account only INVITEs
if (is_method("INVITE")) {
# create dialog with timeout
if ( !create_dialog("B") ) {
send_reply("500","Internal Server Error");
exit;
}
$DLG_timeout = <some variable with amount of seconds>;
}
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.
So, I was looking for a way to set '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.
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.
So, in the OpenSIPS script we could read the value from X-Timeout and set it to the DLG_timeout.
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.
Any hint or suggestion will be very helpful!!
Thanks a lot!
RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979
________________________________
De: Bogdan-Andrei Iancu <a class="moz-txt-link-rfc2396E" href="mailto:bogdan@opensips.org"><bogdan@opensips.org></a>
Enviado: segunda-feira, 28 de setembro de 2015 07:03
Para: OpenSIPS users mailling list; Rodrigo Pimenta Carvalho
Assunto: Re: [OpenSIPS-Users] How to set default_timeout for dialogs, without resetting OpenSIPS ?
Hi Rodrigo,
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:
<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>
If you want to tear down the call, use the dlg_end_dlg MI command :
<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>
Best regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
On 25.09.2015 23:56, Rodrigo Pimenta Carvalho wrote:
Dear OpenSIPS-Users,
A kind of management application in my project must provide an way of a system manager sets the default_timeout for dialogs in our already running OpenSIPS. How to do it?
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.
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.
Is there a way of controlling the default_timeout for dialogs, while OpenSIPS is running?
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.
Any idea?
Any hint will be very helpful!
Best regards.
RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979
_______________________________________________
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-rfc2396E" href="mailto:Users@lists.opensips.org"><mailto: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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
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>
<br>
</body>
</html>