<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Sorry, copy&paste mistake.<br>
<br>
<br>
if(is_present_hf("X-Timeout")){
<br>
<br>
$DLG_timeout = $(hdr(P-Source-IP));
<br>
<br>
....<br>
<br>
<br>
<br>
On 28.09.2015 17:40, Max Mühlbronner wrote:<br>
</div>
<blockquote cite="mid:56095F88.7070205@42com.com" type="cite">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>
<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>
# account only INVITEs
<br>
if (is_method("INVITE")) {
<br>
<br>
# create dialog with timeout
<br>
if ( !create_dialog("B") ) {
<br>
send_reply("500","Internal Server
Error");
<br>
exit;
<br>
}
<br>
<br>
$DLG_timeout = <some variable with amount of
seconds>;
<br>
<br>
}
<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 '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 very helpful!!
<br>
<br>
<br>
Thanks a lot!
<br>
<br>
<br>
RODRIGO PIMENTA CARVALHO
<br>
Inatel Competence Center
<br>
Software
<br>
Ph: +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"><bogdan@opensips.org></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>
<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>
<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 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: +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"><mailto: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>
<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 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>
</body>
</html>