Re: [SR-Users] Call limit through shared database

2019-10-01 Thread Joel Serrano
This is great news!! I will repeat the tests that failed for me just to be
sure, but from reading your comments it seems promising!! Thanks for
pointing me to it.

Joel.

On Tue, Oct 1, 2019 at 08:15 Henning Westerholt  wrote:

> Hi Joel,
>
>
>
> Thank you, I was reading it yesterday. See this issue
> https://github.com/kamailio/kamailio/issues/2080#issue-499544483 – in my
> tests the proxies will expire the dialogs even after a restart. I just
> tested it again even restarting both proxies a few times.
>
>
>
> Cheers,
>
>
>
> Henning
>
>
>
> --
>
> Henning Westerholt - https://skalatan.de/blog/
>
> Kamailio services - https://skalatan.de/services
>
>
>
> *From:* sr-users  *On Behalf Of *Joel
> Serrano
> *Sent:* Tuesday, October 1, 2019 4:35 PM
> *To:* Kamailio (SER) - Users Mailing List ;
> mico...@gmail.com
> *Subject:* Re: [SR-Users] Call limit through shared database
>
>
>
> Found it:
>
>
>
> https://github.com/kamailio/kamailio/issues/1591#issuecomment-409205552
>
>
>
> On Tue, Oct 1, 2019 at 07:15 Joel Serrano  wrote:
>
> Just a note, I would suggest to use htable+dmq to  do such limits,
> dialog+dmq has some issues when handling dialog expiration when a node for
> whatever reason is restarted.. (search GH issues and you will find one with
> a long thread where Charles explains the reasons: TL;DR: You could  end up
> having inconsistent dialog information with dialog+dmq)
>
>
>
> Hope it helps!
>
> Joel.
>
>
>
> On Tue, Oct 1, 2019 at 01:02 Daniel-Constantin Mierla 
> wrote:
>
>
> On 30.09.19 14:55, Daniel Tryba wrote:
> > On Sun, Sep 29, 2019 at 11:03:47AM +0300, Olli Attila wrote:
> >> modparam("dialog", "profiles_with_value", "concurrent_calls")
> >> modparam("dialog", "dlg_flag", 4)
> >> modparam("dialog", "db_url", DBURL)
> >> modparam("dialog", "db_mode", 1)
> >
> > Have you tested with a lower value of
> >
> https://kamailio.org/docs/modules/5.1.x/modules/dialog.html#dialog.p.update_period
>
>
> The update_period should have no impact when db_mode=1 -- in this case
> the records are written to database immediately. I think update_period
> is intended only for db_mode=2.
>
> Cheers,
> Daniel
>
>
> > I have it set to 5, but for some reason I'm not using get_profile_size
> >
> > For inbound:
> > $var(maxchannels) = 0;
> > sql_xquery("ca", "select count(id) as c from dialog where xdata like
> '%maxchannels%$rU%' and timeout>unix_timestamp()", "ra");
> > $var(maxchannels)=$xavp(ra=>c);
> > sql_result_free("ra");
> >
> > For outbound:
> > sql_xquery("ca", "select count(id) as c from dialog where xdata like
> '%maxchannels%$au%' and timeout>unix_timestamp()", "ra");
> > $var(maxchannels)=$xavp(ra=>c);
> > sql_result_free("ra");
> >
> > Pasting the code here I see this isn't that secure since a user foo also
> > gets the number of calls for foobar counted against him! Off to put a "
> > before/after the username.
> >
> >
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla -- www.asipto.com
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany --
> https://asipto.com/u/kat
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Call limit through shared database

2019-10-01 Thread Henning Westerholt
Hi Joel,

Thank you, I was reading it yesterday. See this issue 
https://github.com/kamailio/kamailio/issues/2080#issue-499544483 – in my tests 
the proxies will expire the dialogs even after a restart. I just tested it 
again even restarting both proxies a few times.

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services

From: sr-users  On Behalf Of Joel Serrano
Sent: Tuesday, October 1, 2019 4:35 PM
To: Kamailio (SER) - Users Mailing List ; 
mico...@gmail.com
Subject: Re: [SR-Users] Call limit through shared database

Found it:

https://github.com/kamailio/kamailio/issues/1591#issuecomment-409205552

On Tue, Oct 1, 2019 at 07:15 Joel Serrano 
mailto:j...@textplus.com>> wrote:
Just a note, I would suggest to use htable+dmq to  do such limits, dialog+dmq 
has some issues when handling dialog expiration when a node for whatever reason 
is restarted.. (search GH issues and you will find one with a long thread where 
Charles explains the reasons: TL;DR: You could  end up having inconsistent 
dialog information with dialog+dmq)

Hope it helps!
Joel.

On Tue, Oct 1, 2019 at 01:02 Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:

On 30.09.19 14:55, Daniel Tryba wrote:
> On Sun, Sep 29, 2019 at 11:03:47AM +0300, Olli Attila wrote:
>> modparam("dialog", "profiles_with_value", "concurrent_calls")
>> modparam("dialog", "dlg_flag", 4)
>> modparam("dialog", "db_url", DBURL)
>> modparam("dialog", "db_mode", 1)
>
> Have you tested with a lower value of
> https://kamailio.org/docs/modules/5.1.x/modules/dialog.html#dialog.p.update_period


The update_period should have no impact when db_mode=1 -- in this case
the records are written to database immediately. I think update_period
is intended only for db_mode=2.

Cheers,
Daniel


> I have it set to 5, but for some reason I'm not using get_profile_size
>
> For inbound:
> $var(maxchannels) = 0;
> sql_xquery("ca", "select count(id) as c from dialog where xdata like 
> '%maxchannels%$rU%' and timeout>unix_timestamp()", "ra");
> $var(maxchannels)=$xavp(ra=>c);
> sql_result_free("ra");
>
> For outbound:
> sql_xquery("ca", "select count(id) as c from dialog where xdata like 
> '%maxchannels%$au%' and timeout>unix_timestamp()", "ra");
> $var(maxchannels)=$xavp(ra=>c);
> sql_result_free("ra");
>
> Pasting the code here I see this isn't that secure since a user foo also
> gets the number of calls for foobar counted against him! Off to put a "
> before/after the username.
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

--
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- 
www.linkedin.com/in/miconda
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- 
https://asipto.com/u/kat


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Call limit through shared database

2019-10-01 Thread Henning Westerholt
Hello Joel,

I did some research yesterday for a customer, and only found open tickets 
related to the dialog statistics issue (#1692). The module README also stats 
that the DMQ will synchronize profiles. If there are some issues related to 
dialog inconsistencies, then they should (preferable) be fixed or properly 
documented in the module.

To which ticket are you referring to on github?

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services

From: sr-users  On Behalf Of Joel Serrano
Sent: Tuesday, October 1, 2019 4:15 PM
To: Kamailio (SER) - Users Mailing List ; 
mico...@gmail.com
Subject: Re: [SR-Users] Call limit through shared database

Just a note, I would suggest to use htable+dmq to  do such limits, dialog+dmq 
has some issues when handling dialog expiration when a node for whatever reason 
is restarted.. (search GH issues and you will find one with a long thread where 
Charles explains the reasons: TL;DR: You could  end up having inconsistent 
dialog information with dialog+dmq)

Hope it helps!
Joel.

On Tue, Oct 1, 2019 at 01:02 Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:

On 30.09.19 14:55, Daniel Tryba wrote:
> On Sun, Sep 29, 2019 at 11:03:47AM +0300, Olli Attila wrote:
>> modparam("dialog", "profiles_with_value", "concurrent_calls")
>> modparam("dialog", "dlg_flag", 4)
>> modparam("dialog", "db_url", DBURL)
>> modparam("dialog", "db_mode", 1)
>
> Have you tested with a lower value of
> https://kamailio.org/docs/modules/5.1.x/modules/dialog.html#dialog.p.update_period


The update_period should have no impact when db_mode=1 -- in this case
the records are written to database immediately. I think update_period
is intended only for db_mode=2.

Cheers,
Daniel


> I have it set to 5, but for some reason I'm not using get_profile_size
>
> For inbound:
> $var(maxchannels) = 0;
> sql_xquery("ca", "select count(id) as c from dialog where xdata like 
> '%maxchannels%$rU%' and timeout>unix_timestamp()", "ra");
> $var(maxchannels)=$xavp(ra=>c);
> sql_result_free("ra");
>
> For outbound:
> sql_xquery("ca", "select count(id) as c from dialog where xdata like 
> '%maxchannels%$au%' and timeout>unix_timestamp()", "ra");
> $var(maxchannels)=$xavp(ra=>c);
> sql_result_free("ra");
>
> Pasting the code here I see this isn't that secure since a user foo also
> gets the number of calls for foobar counted against him! Off to put a "
> before/after the username.
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

--
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- 
www.linkedin.com/in/miconda
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- 
https://asipto.com/u/kat


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Call limit through shared database

2019-10-01 Thread Joel Serrano
Found it:

https://github.com/kamailio/kamailio/issues/1591#issuecomment-409205552

On Tue, Oct 1, 2019 at 07:15 Joel Serrano  wrote:

> Just a note, I would suggest to use htable+dmq to  do such limits,
> dialog+dmq has some issues when handling dialog expiration when a node for
> whatever reason is restarted.. (search GH issues and you will find one with
> a long thread where Charles explains the reasons: TL;DR: You could  end up
> having inconsistent dialog information with dialog+dmq)
>
> Hope it helps!
> Joel.
>
> On Tue, Oct 1, 2019 at 01:02 Daniel-Constantin Mierla 
> wrote:
>
>>
>> On 30.09.19 14:55, Daniel Tryba wrote:
>> > On Sun, Sep 29, 2019 at 11:03:47AM +0300, Olli Attila wrote:
>> >> modparam("dialog", "profiles_with_value", "concurrent_calls")
>> >> modparam("dialog", "dlg_flag", 4)
>> >> modparam("dialog", "db_url", DBURL)
>> >> modparam("dialog", "db_mode", 1)
>> >
>> > Have you tested with a lower value of
>> >
>> https://kamailio.org/docs/modules/5.1.x/modules/dialog.html#dialog.p.update_period
>>
>>
>> The update_period should have no impact when db_mode=1 -- in this case
>> the records are written to database immediately. I think update_period
>> is intended only for db_mode=2.
>>
>> Cheers,
>> Daniel
>>
>>
>> > I have it set to 5, but for some reason I'm not using get_profile_size
>> >
>> > For inbound:
>> > $var(maxchannels) = 0;
>> > sql_xquery("ca", "select count(id) as c from dialog where xdata like
>> '%maxchannels%$rU%' and timeout>unix_timestamp()", "ra");
>> > $var(maxchannels)=$xavp(ra=>c);
>> > sql_result_free("ra");
>> >
>> > For outbound:
>> > sql_xquery("ca", "select count(id) as c from dialog where xdata like
>> '%maxchannels%$au%' and timeout>unix_timestamp()", "ra");
>> > $var(maxchannels)=$xavp(ra=>c);
>> > sql_result_free("ra");
>> >
>> > Pasting the code here I see this isn't that secure since a user foo also
>> > gets the number of calls for foobar counted against him! Off to put a "
>> > before/after the username.
>> >
>> >
>> > ___
>> > Kamailio (SER) - Users Mailing List
>> > sr-users@lists.kamailio.org
>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>> --
>> Daniel-Constantin Mierla -- www.asipto.com
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany --
>> https://asipto.com/u/kat
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Call limit through shared database

2019-10-01 Thread Joel Serrano
Just a note, I would suggest to use htable+dmq to  do such limits,
dialog+dmq has some issues when handling dialog expiration when a node for
whatever reason is restarted.. (search GH issues and you will find one with
a long thread where Charles explains the reasons: TL;DR: You could  end up
having inconsistent dialog information with dialog+dmq)

Hope it helps!
Joel.

On Tue, Oct 1, 2019 at 01:02 Daniel-Constantin Mierla 
wrote:

>
> On 30.09.19 14:55, Daniel Tryba wrote:
> > On Sun, Sep 29, 2019 at 11:03:47AM +0300, Olli Attila wrote:
> >> modparam("dialog", "profiles_with_value", "concurrent_calls")
> >> modparam("dialog", "dlg_flag", 4)
> >> modparam("dialog", "db_url", DBURL)
> >> modparam("dialog", "db_mode", 1)
> >
> > Have you tested with a lower value of
> >
> https://kamailio.org/docs/modules/5.1.x/modules/dialog.html#dialog.p.update_period
>
>
> The update_period should have no impact when db_mode=1 -- in this case
> the records are written to database immediately. I think update_period
> is intended only for db_mode=2.
>
> Cheers,
> Daniel
>
>
> > I have it set to 5, but for some reason I'm not using get_profile_size
> >
> > For inbound:
> > $var(maxchannels) = 0;
> > sql_xquery("ca", "select count(id) as c from dialog where xdata like
> '%maxchannels%$rU%' and timeout>unix_timestamp()", "ra");
> > $var(maxchannels)=$xavp(ra=>c);
> > sql_result_free("ra");
> >
> > For outbound:
> > sql_xquery("ca", "select count(id) as c from dialog where xdata like
> '%maxchannels%$au%' and timeout>unix_timestamp()", "ra");
> > $var(maxchannels)=$xavp(ra=>c);
> > sql_result_free("ra");
> >
> > Pasting the code here I see this isn't that secure since a user foo also
> > gets the number of calls for foobar counted against him! Off to put a "
> > before/after the username.
> >
> >
> > ___
> > Kamailio (SER) - Users Mailing List
> > sr-users@lists.kamailio.org
> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla -- www.asipto.com
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany --
> https://asipto.com/u/kat
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] BLF 'NOTIFY' not working

2019-10-01 Thread Petarr Jones
Daniel

Adding in the set_contact_alias() for SUBSCRIBE meant that the NOTIFY now gets 
a "200 OK", but the light on the phone does not light up even though the 
extension being monitored is registered.

I notice that after the SUBSCRIBE request, the return message is a "202 OK" 
instead of a "202 ACCEPTED". Is that correct?

I am also now getting this message in the log

nathelper [nathelper.c:700]: set_contact_alias(): you can't update contact 
twice, check your config!

From: sr-users  on behalf of Petarr Jones 

Sent: 01 October 2019 02:57
To: Kamailio (SER) - Users Mailing List ; 
mico...@gmail.com 
Subject: Re: [SR-Users] BLF 'NOTIFY' not working

Thanks for your response Daniel.

Kamailio is installed on a cloud server (not AWS) and therefore has an internet 
facing IP address. The phone is in my office so there is NAT happening at that 
end. I would have thought the NAT traversal would only apply if the 
server/Kamailio was behind a firewall/router doing some kind of NAT?

Regards
Petarr

From: Daniel-Constantin Mierla 
Sent: 01 October 2019 00:16
To: Kamailio (SER) - Users Mailing List ; Petarr 
Jones 
Subject: Re: [SR-Users] BLF 'NOTIFY' not working


Hello,


there can be NOTIFY requests with no body, as the one below has Content-Length 
0 -- a matter of what is the call state, it can be a valid one.


Regarding the fact that the NOTIFY is not delivered, have you done nat 
traversal for SUBSCRIBE? I see private address in the R-URI, so the problem can 
be in that part. You should do set_contact_alias() for SUBSCRIBE.


Cheers,
Daniel


On 30.09.19 15:16, Petarr Jones wrote:
Hi

I am using Kamailio 5.2 with the following PRESENCE modules and parameters:

loadmodule "presence.so"
loadmodule "presence_xml.so"
loadmodule "presence_dialoginfo.so"
loadmodule "presence_reginfo.so"

modparam("presence", "db_url", DBURL)
modparam("presence_xml", "db_url", DBURL)
modparam("presence_xml", "force_active", 1)
modparam("presence_xml", "disable_bla", 0)
modparam("presence_xml", "integrated_xcap_server", 1)

I have a Yealink T28P phone which has two lines/extensions successfully 
registered with Kamailio 5.2. When I setup the BLF light to monitor one of the 
extensions, I get the correct SUBSCRIBE record but the NOTIFY record is sent 
over and over again until it fails.

---
NOTIFY sip:101@192.168.1.123:5062 SIP/2.0
Via: SIP/2.0/UDP 
45.45.45.45;branch=z9hG4bKd16c.03b5bc97.0
To: ;tag=1366853594
From: 
;tag=a6a1c5f60faecf035a1ae5b6e96e979a-e6c3
CSeq: 2 NOTIFY
Call-ID: 594386350@192.168.1.123
Content-Length: 0
User-Agent: kamailio (5.2.4 (x86_64/linux))
Max-Forwards: 70
Event: dialog
Contact: 

---

When I register the phone with Freeswitch instead and run the same test, the 
NOTIFY works and I get a much longer NOTIFY message

---
NOTIFY sip:100@192.168.1.123:5064 SIP/2.0
Via: SIP/2.0/UDP 66.66.66.66;rport;branch=z9hG4bK1mXej9r2605UB
Route: ;transport=udp
Max-Forwards: 70
From: ;tag=xUoVghM5syHc
To: "100" ;tag=1720892352
Call-ID: 2583553127@192.168.1.123
CSeq: 1178415701 NOTIFY
Contact: 
User-Agent: FreeSWITCH-mod_sofia/1.10.1-release-12-f9990221e6~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, 
REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, path, replaces
Event: dialog
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, 
line-seize, call-info, sla, include-session-description, presence.winfo, 
message-summary, refer
Subscription-State: active;expires=1800
Content-Type: application/dialog-info+xml
Content-Length: 149

xml version="1.0"?>
dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="0" state="full" 
entity="sip:102@66.66.66.66">
dialog-info>
---

Should the message coming from Kamailio contain more data or is that not the 
issue. Should I be including other modules also?

All guidance would be appreciated.




___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- 
www.linkedin.com/in/miconda
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- 
https://asipto.com/u/kat
___
Kamailio (SER) - Users Mailing 

Re: [SR-Users] BLF 'NOTIFY' not working

2019-10-01 Thread Petarr Jones
Thanks for your response Daniel.

Kamailio is installed on a cloud server (not AWS) and therefore has an internet 
facing IP address. The phone is in my office so there is NAT happening at that 
end. I would have thought the NAT traversal would only apply if the 
server/Kamailio was behind a firewall/router doing some kind of NAT?

Regards
Petarr

From: Daniel-Constantin Mierla 
Sent: 01 October 2019 00:16
To: Kamailio (SER) - Users Mailing List ; Petarr 
Jones 
Subject: Re: [SR-Users] BLF 'NOTIFY' not working


Hello,


there can be NOTIFY requests with no body, as the one below has Content-Length 
0 -- a matter of what is the call state, it can be a valid one.


Regarding the fact that the NOTIFY is not delivered, have you done nat 
traversal for SUBSCRIBE? I see private address in the R-URI, so the problem can 
be in that part. You should do set_contact_alias() for SUBSCRIBE.


Cheers,
Daniel


On 30.09.19 15:16, Petarr Jones wrote:
Hi

I am using Kamailio 5.2 with the following PRESENCE modules and parameters:

loadmodule "presence.so"
loadmodule "presence_xml.so"
loadmodule "presence_dialoginfo.so"
loadmodule "presence_reginfo.so"

modparam("presence", "db_url", DBURL)
modparam("presence_xml", "db_url", DBURL)
modparam("presence_xml", "force_active", 1)
modparam("presence_xml", "disable_bla", 0)
modparam("presence_xml", "integrated_xcap_server", 1)

I have a Yealink T28P phone which has two lines/extensions successfully 
registered with Kamailio 5.2. When I setup the BLF light to monitor one of the 
extensions, I get the correct SUBSCRIBE record but the NOTIFY record is sent 
over and over again until it fails.

---
NOTIFY sip:101@192.168.1.123:5062 SIP/2.0
Via: SIP/2.0/UDP 
45.45.45.45;branch=z9hG4bKd16c.03b5bc97.0
To: ;tag=1366853594
From: 
;tag=a6a1c5f60faecf035a1ae5b6e96e979a-e6c3
CSeq: 2 NOTIFY
Call-ID: 594386350@192.168.1.123
Content-Length: 0
User-Agent: kamailio (5.2.4 (x86_64/linux))
Max-Forwards: 70
Event: dialog
Contact: 

---

When I register the phone with Freeswitch instead and run the same test, the 
NOTIFY works and I get a much longer NOTIFY message

---
NOTIFY sip:100@192.168.1.123:5064 SIP/2.0
Via: SIP/2.0/UDP 66.66.66.66;rport;branch=z9hG4bK1mXej9r2605UB
Route: ;transport=udp
Max-Forwards: 70
From: ;tag=xUoVghM5syHc
To: "100" ;tag=1720892352
Call-ID: 2583553127@192.168.1.123
CSeq: 1178415701 NOTIFY
Contact: 
User-Agent: FreeSWITCH-mod_sofia/1.10.1-release-12-f9990221e6~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, 
REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, path, replaces
Event: dialog
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, 
line-seize, call-info, sla, include-session-description, presence.winfo, 
message-summary, refer
Subscription-State: active;expires=1800
Content-Type: application/dialog-info+xml
Content-Length: 149

xml version="1.0"?>
dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="0" state="full" 
entity="sip:102@66.66.66.66">
dialog-info>
---

Should the message coming from Kamailio contain more data or is that not the 
issue. Should I be including other modules also?

All guidance would be appreciated.




___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- 
www.linkedin.com/in/miconda
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- 
https://asipto.com/u/kat
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio Charging

2019-10-01 Thread Jack R
Thanks  Daniel,

Please, could you help with this information, in Kamailio which DB tables
hold the information for CDR so that we can use for monitoring and charging
purpose?

Thanks and regards,
Jack.

On Thu, Sep 26, 2019 at 11:54 AM Daniel-Constantin Mierla 
wrote:

> Hello,
>
> are you looking for postpaid or prepaid charging?
>
> Kamailio is more like a framework that can generate CDRs for postpaid (see
> acc* modules), or a call control to cut the calls (see dialog, cnxcc
> modules).
>
> As of charging/billing engines, you can also build one easily, a starting
> point could be the basic solution offered by siremis which uses stored
> procedures.
>
> Then in open source space there are some other billing engines besides
> cgrates, such as a2billing or pyfreebilling. Probably you can find a few
> more if you search on the web...
>
> Cheers,
> Daniel
> On 25.09.19 19:50, Jack R wrote:
>
> Hi,
>
> Does Kamailio provide some charging functionality?
>
> If yes, then how do we go about setting it up? like what
> module/configuration? and Database tables to see/touch?
>
> I see these links:
> https://www.kamailio.org/docs/modules/4.2.x/modules/ims_charging.html
> https://www.kamailio.org/w/2013/07/documentation-on-charging-in-ims/
>
> Or
>
> Do we need separate software like example cgrates for charging? (also a
> side question do we have any other open-source like cgrates)
>
> Any information would be helpful.
>
> Thanks and Regards,
> Jack.
>
>
>
>
> ___
> Kamailio (SER) - Users Mailing 
> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- 
> www.linkedin.com/in/miconda
> Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- 
> https://asipto.com/u/kat
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Call limit through shared database

2019-10-01 Thread Daniel-Constantin Mierla

On 30.09.19 14:55, Daniel Tryba wrote:
> On Sun, Sep 29, 2019 at 11:03:47AM +0300, Olli Attila wrote:
>> modparam("dialog", "profiles_with_value", "concurrent_calls")
>> modparam("dialog", "dlg_flag", 4)
>> modparam("dialog", "db_url", DBURL)
>> modparam("dialog", "db_mode", 1)
>  
> Have you tested with a lower value of
> https://kamailio.org/docs/modules/5.1.x/modules/dialog.html#dialog.p.update_period


The update_period should have no impact when db_mode=1 -- in this case
the records are written to database immediately. I think update_period
is intended only for db_mode=2.

Cheers,
Daniel


> I have it set to 5, but for some reason I'm not using get_profile_size
>
> For inbound:
> $var(maxchannels) = 0;
> sql_xquery("ca", "select count(id) as c from dialog where xdata like 
> '%maxchannels%$rU%' and timeout>unix_timestamp()", "ra");
> $var(maxchannels)=$xavp(ra=>c);
> sql_result_free("ra");
>
> For outbound:
> sql_xquery("ca", "select count(id) as c from dialog where xdata like 
> '%maxchannels%$au%' and timeout>unix_timestamp()", "ra");
> $var(maxchannels)=$xavp(ra=>c);
> sql_result_free("ra");
>
> Pasting the code here I see this isn't that secure since a user foo also
> gets the number of calls for foobar counted against him! Off to put a "
> before/after the username.
>  
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- 
https://asipto.com/u/kat


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] BLF 'NOTIFY' not working

2019-10-01 Thread Daniel-Constantin Mierla
Hello,


there can be NOTIFY requests with no body, as the one below has
Content-Length 0 -- a matter of what is the call state, it can be a
valid one.


Regarding the fact that the NOTIFY is not delivered, have you done nat
traversal for SUBSCRIBE? I see private address in the R-URI, so the
problem can be in that part. You should do set_contact_alias() for
SUBSCRIBE.


Cheers,
Daniel


On 30.09.19 15:16, Petarr Jones wrote:
> Hi
>
> I am using Kamailio 5.2 with the following PRESENCE modules and
> parameters:
>
> loadmodule "presence.so"
> loadmodule "presence_xml.so"
> loadmodule "presence_dialoginfo.so"
> loadmodule "presence_reginfo.so"
>
> modparam("presence", "db_url", DBURL)
> modparam("presence_xml", "db_url", DBURL)
> modparam("presence_xml", "force_active", 1)
> modparam("presence_xml", "disable_bla", 0)
> modparam("presence_xml", "integrated_xcap_server", 1)
>  
> I have a Yealink T28P phone which has two lines/extensions
> successfully registered with Kamailio 5.2. When I setup the BLF light
> to monitor one of the extensions, I get the correct SUBSCRIBE record
> but the NOTIFY record is sent over and over again until it fails. 
>
> ---
> NOTIFY sip:101@192.168.1.123:5062 SIP/2.0
> Via: SIP/2.0/UDP
> 45.45.45.45;branch=z9hG4bKd16c.03b5bc97.0
> To: ;tag=1366853594
> From: ;tag=a6a1c5f60faecf035a1ae5b6e96e979a-e6c3
> CSeq: 2 NOTIFY
> Call-ID: 594386350@192.168.1.123
> Content-Length: 0
> User-Agent: kamailio (5.2.4 (x86_64/linux))
> Max-Forwards: 70
> Event: dialog
> Contact:   
> ---
>
> When I register the phone with Freeswitch instead and run the same
> test, the NOTIFY works and I get a much longer NOTIFY message
>
> ---
> NOTIFY sip:100@192.168.1.123:5064 SIP/2.0
> Via: SIP/2.0/UDP 66.66.66.66;rport;branch=z9hG4bK1mXej9r2605UB
> Route: ;transport=udp
> Max-Forwards: 70
> From: ;tag=xUoVghM5syHc
> To: "100" ;tag=1720892352
> Call-ID: 2583553127@192.168.1.123
> CSeq: 1178415701 NOTIFY
> Contact: 
> User-Agent: FreeSWITCH-mod_sofia/1.10.1-release-12-f9990221e6~64bit
> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE,
> REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
> Supported: timer, path, replaces
> Event: dialog
> Allow-Events: talk, hold, conference, presence, as-feature-event,
> dialog, line-seize, call-info, sla, include-session-description,
> presence.winfo, message-summary, refer
> Subscription-State: active;expires=1800
> Content-Type: application/dialog-info+xml
> Content-Length: 149
>
> xml version="1.0"?>
> dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="0"
> state="full" entity="sip:102@66.66.66.66">
> dialog-info>
> ---
>
> Should the message coming from Kamailio contain more data or is that
> not the issue. Should I be including other modules also?
>
> All guidance would be appreciated.
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- 
https://asipto.com/u/kat

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users