[OpenSIPS-Users] How to set default_timeout for dialogs, without resetting OpenSIPS ? (continuing...)
Max Mühlbronner
mm at 42com.com
Mon Sep 28 17:44:46 CEST 2015
Sorry, copy&paste mistake.
if(is_present_hf("X-Timeout")){
$DLG_timeout = $(hdr(P-Source-IP));
....
On 28.09.2015 17:40, Max Mühlbronner wrote:
> Hi,
>
>
> seems to be a simple solution, without overhead/database/...
>
>
> if(is_present_hf("P-Source-IP")){
>
> $DLG_timeout = $(hdr(P-Source-IP));
>
> }else{
>
> $DLG_timeout = 3600;
>
> }
>
>
>
> But you could also save the information into a e.g. mysql/... database
> and pull it from the db. (check out avpops module)
>
>
> Best Regards
>
> On 28.09.2015 16:51, Rodrigo Pimenta Carvalho wrote:
>> 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 <bogdan at opensips.org>
>> 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:
>> http://www.opensips.org/html/docs/modules/1.11.x/dialog.html#timeout-pvar-id
>>
>> If you want to tear down the call, use the dlg_end_dlg MI command :
>> http://www.opensips.org/html/docs/modules/1.11.x/dialog.html#id296795
>>
>> Best regards,
>>
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and Developer
>> http://www.opensips-solutions.com
>>
>> 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
>> Users at lists.opensips.org<mailto:Users at lists.opensips.org>
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150928/81a56450/attachment-0001.htm>
More information about the Users
mailing list