Re: [SR-Users] DBURL password in clear

2017-11-16 Thread Jurijs Ivolga
Hi Robert,

I'm not security expert and I'm quite new in docker, but I think password
in Docker container which will be in clear text saved somewhere should not
be a problem, as far as you do not save this password to image or git and
etc...

I think best way for you is to use docker secret and generate then config
file for Kamailio using this docker secrets and then start Kamailio and for
all of this you need to write some kind of Entrypoint script. Here is
example how something similar do Homer Sipcapture, they set environment
variables in docker-compose and then generate config file based on this,
but you can use probably docker secrets instead of environment variables:

https://github.com/sipcapture/homer-docker/tree/master/kamailio

I found one more interesting link regarding docker secrets:

https://blog.mikesir87.io/2017/05/using-docker-secrets-during-development/

With kind regards,

Jurijs

On Thu, Nov 16, 2017 at 11:58 PM, Robert  wrote:

> That’d presumably leave the clear text footprint I'm trying to avoid,
> albeit in a non-Kamailio file. I’ve made a start on an approach to read
> from a file, Docker secrets are basically just files, but the Docker
> platform handles them securely.
>
> Thanks - Robert...
>
> > On 16 Nov 2017, at 21:46, Bastian Triller 
> wrote:
> >
> > isn't using a group in the db URL an option? Generate some .cnf in
> > /etc/mysql/conf.d (or where MySQL searches its configuration in a
> > Docker container) from the secret and use the group in your db URL in
> > kamailio.cfg.
> >
> > http://www.kamailio.org/docs/modules/5.0.x/modules/db_mysql.html#idp419
> > 97212
>
>
> ___
> 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] DBURL password in clear

2017-11-16 Thread Robert
That’d presumably leave the clear text footprint I'm trying to avoid, albeit in 
a non-Kamailio file. I’ve made a start on an approach to read from a file, 
Docker secrets are basically just files, but the Docker platform handles them 
securely.

Thanks - Robert...

> On 16 Nov 2017, at 21:46, Bastian Triller  wrote:
> 
> isn't using a group in the db URL an option? Generate some .cnf in
> /etc/mysql/conf.d (or where MySQL searches its configuration in a
> Docker container) from the secret and use the group in your db URL in
> kamailio.cfg.
> 
> http://www.kamailio.org/docs/modules/5.0.x/modules/db_mysql.html#idp419
> 97212


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


Re: [SR-Users] DBURL password in clear

2017-11-16 Thread Bastian Triller
isn't using a group in the db URL an option? Generate some .cnf in
/etc/mysql/conf.d (or where MySQL searches its configuration in a
Docker container) from the secret and use the group in your db URL in
kamailio.cfg.

http://www.kamailio.org/docs/modules/5.0.x/modules/db_mysql.html#idp419
97212

On Thu, 2017-11-16 at 20:22 +, Robert wrote:
> Hello Daniel,
> 
> I did think of this, but yes, that’s exactly my problem. Penetration
> testing will highlight any and all tricks I might employ, definitely
> looking like we're going to need to do extend Kamailio somehow. If we
> can do it in a way that isn’t internally sensitive, I’ll propose we
> create a pull request, maybe help someone else in the future?
> 
> Cheers - Robert...
> 
> > On 16 Nov 2017, at 09:34, Daniel Tryba  wrote:
> > 
> > On Wed, Nov 15, 2017 at 08:46:58AM +0100, Daniel-Constantin Mierla
> > wrote:
> > > > I???m working for a UK high street bank and our Kamailio
> > > > implementation has been challenged because we???ve got database
> > > > passwords held in clear in the configuration file.
> > 
> > ...
> > > > My requirement is simple, I need to be able to supply a
> > > > password via means such as loading a variable from a run-once
> > > > script at start up, or a module. The ideal would be to be able
> > > > to read in a Docker secret :)
> > > > 
> > > 
> > > you can define a for a token to be used inside kamailio.cfg by
> > > using -A
> > > command line parameter. So when you start kamailio, fetch the
> > > password
> > > from your secure system by what so ever meaning, then build the
> > > database
> > > url based on it and run kamailio with:
> > > 
> > > kamailio - A DBURL='mysql://user:passwd@dbhost/kamailio' ...
> > 
> > My guess is the next problem will be the password being visible to
> > all
> > users querying the processlist :)
> > 
> > Is including a file (import_file) with passwords an option?
> > Generate the
> > file just before startup, remove it (ofcourse in a secure way
> > (shred the
> > file and overwrite all freespace with a multiple patters a few
> > dozen
> > times (ask the auditors for the exact specifications that make them
> > happy))) after kamailio is running. 
> > 
> > 
> > ___
> > 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] DBURL password in clear

2017-11-16 Thread Robert
Hello Jurijs,

Thank you for the link, Docker secrets is definitely something that would be an 
option, and yes, holding anything in a variable or somewhere it can be easily 
queried isn’t going to work.

We’ll see what happens.

Cheers - Robert...

> On 16 Nov 2017, at 10:41, Jurijs Ivolga  wrote:
> 
> Hi,
> 
> Not sure that this helps, but below is how I solved similar issue by 
> generating include file inside Docker file using env variables, but this is 
> not a good approach for sensitive data.
> echo "\
>  <>modparam(\"http_client\", \"httpcon\", \"apiserver=>https://$apiurl\;); \
>  <>" >> /kamailio.apiurl
> I believe you can use docker secrets, as described below, but I never used 
> them so I can't help much:
> 
> https://medium.com/@basi/docker-environment-variables-expanded-from-secrets-8fa70617b3bc
>  
> 
> 
> With kind regards,
> 
> Jurijs
> 
> On Thu, Nov 16, 2017 at 11:34 AM, Daniel Tryba  > wrote:
> On Wed, Nov 15, 2017 at 08:46:58AM +0100, Daniel-Constantin Mierla wrote:
> > > I???m working for a UK high street bank and our Kamailio implementation 
> > > has been challenged because we???ve got database passwords held in clear 
> > > in the configuration file.
> ...
> > > My requirement is simple, I need to be able to supply a password via 
> > > means such as loading a variable from a run-once script at start up, or a 
> > > module. The ideal would be to be able to read in a Docker secret :)
> > >
> > you can define a for a token to be used inside kamailio.cfg by using -A
> > command line parameter. So when you start kamailio, fetch the password
> > from your secure system by what so ever meaning, then build the database
> > url based on it and run kamailio with:
> >
> > kamailio - A DBURL='mysql://user:passwd@dbhost/kamailio' ...
> 
> My guess is the next problem will be the password being visible to all
> users querying the processlist :)
> 
> Is including a file (import_file) with passwords an option? Generate the
> file just before startup, remove it (ofcourse in a secure way (shred the
> file and overwrite all freespace with a multiple patters a few dozen
> times (ask the auditors for the exact specifications that make them
> happy))) after kamailio is running.
> 
> 
> ___
> 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] DBURL password in clear

2017-11-16 Thread Robert
Hello Daniel,

I did think of this, but yes, that’s exactly my problem. Penetration testing 
will highlight any and all tricks I might employ, definitely looking like we're 
going to need to do extend Kamailio somehow. If we can do it in a way that 
isn’t internally sensitive, I’ll propose we create a pull request, maybe help 
someone else in the future?

Cheers - Robert...

> On 16 Nov 2017, at 09:34, Daniel Tryba  wrote:
> 
> On Wed, Nov 15, 2017 at 08:46:58AM +0100, Daniel-Constantin Mierla wrote:
>>> I???m working for a UK high street bank and our Kamailio implementation has 
>>> been challenged because we???ve got database passwords held in clear in the 
>>> configuration file.
> ...
>>> My requirement is simple, I need to be able to supply a password via means 
>>> such as loading a variable from a run-once script at start up, or a module. 
>>> The ideal would be to be able to read in a Docker secret :)
>>> 
>> you can define a for a token to be used inside kamailio.cfg by using -A
>> command line parameter. So when you start kamailio, fetch the password
>> from your secure system by what so ever meaning, then build the database
>> url based on it and run kamailio with:
>> 
>> kamailio - A DBURL='mysql://user:passwd@dbhost/kamailio' ...
> 
> My guess is the next problem will be the password being visible to all
> users querying the processlist :)
> 
> Is including a file (import_file) with passwords an option? Generate the
> file just before startup, remove it (ofcourse in a secure way (shred the
> file and overwrite all freespace with a multiple patters a few dozen
> times (ask the auditors for the exact specifications that make them
> happy))) after kamailio is running. 
> 
> 
> ___
> 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] kamailio-wiki dead links to github.com/....master branch

2017-11-16 Thread Sergey Safarov
I update RPM spec file during next hour you can download lua module

About kemi. Please point me where in source tree located this module.


чт, 16 нояб. 2017 г. в 19:39, Karsten Horsmann :

> Hi Daniel,
>
> thanks for the link.
>
> I was just wondering why the Kamailio 5.0.4 RPMS for CentOS 7 missing
> app_lua and kemi (or maybe kemi but only js).
>
> Are there plans to integrate kemi with lua into the RPMS in the future?
>
> Kind regards
>
> Am 13.11.2017 6:10 nachm. schrieb "Daniel-Constantin Mierla" <
> mico...@gmail.com>:
>
>> Hello,
>>
>> relocated with the source code tree restructuring to misc/ folder:
>>
>>   - https://github.com/kamailio/kamailio/tree/master/misc/examples/kemi
>>
>> The wiki needs to fixed, indeed...
>>
>> Cheers,
>> Daenil
>>
>> On 13.11.17 16:55, Karsten Horsmann wrote:
>>
>> Hello,
>>
>> https://www.kamailio.org/wiki/devel/config-engines
>> has links to
>> https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi.cfg
>> for example configs. All the "kemi" stuff is gone. 404 Error.
>>
>> Where i found actuall (kemi / kamailio 5.0.x) samples?
>>
>> --
>> Kind Regards
>> *Karsten Horsmann*
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing 
>> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>> --
>> Daniel-Constantin Mierlawww.twitter.com/miconda -- 
>> www.linkedin.com/in/miconda
>> Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
>> Kamailio World Conference - www.kamailioworld.com
>>
>> ___
> 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] kamailio-wiki dead links to github.com/....master branch

2017-11-16 Thread Karsten Horsmann
Hi Daniel,

thanks for the link.

I was just wondering why the Kamailio 5.0.4 RPMS for CentOS 7 missing
app_lua and kemi (or maybe kemi but only js).

Are there plans to integrate kemi with lua into the RPMS in the future?

Kind regards

Am 13.11.2017 6:10 nachm. schrieb "Daniel-Constantin Mierla" <
mico...@gmail.com>:

> Hello,
>
> relocated with the source code tree restructuring to misc/ folder:
>
>   - https://github.com/kamailio/kamailio/tree/master/misc/examples/kemi
>
> The wiki needs to fixed, indeed...
>
> Cheers,
> Daenil
>
> On 13.11.17 16:55, Karsten Horsmann wrote:
>
> Hello,
>
> https://www.kamailio.org/wiki/devel/config-engines
> has links to https://github.com/kamailio/kamailio/blob/master/
> examples/kemi/kamailio-basic-kemi.cfg
> for example configs. All the "kemi" stuff is gone. 404 Error.
>
> Where i found actuall (kemi / kamailio 5.0.x) samples?
>
> --
> Kind Regards
> *Karsten Horsmann*
>
>
> ___
> Kamailio (SER) - Users Mailing 
> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierlawww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
> Kamailio World Conference - www.kamailioworld.com
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] max_contacts does not work as expected

2017-11-16 Thread Gholamreza Sabery
Dear Daniel,

I can not use db_mode=1 in my setup; but I will try to test it.

Regards


On Thu, Nov 16, 2017 at 9:23 PM, Daniel-Constantin Mierla  wrote:

> Very busy with the work this week ...
>
> To see if this a limitation of db only mode or not, can you test with
> db_mode=1?
>
> Cheers,
> Daniel
>
> On 16.11.17 16:51, Gholamreza Sabery wrote:
>
> No ideas?
>
> On Wed, Nov 15, 2017 at 3:27 PM, Gholamreza Sabery 
> wrote:
>
>> Hello Daniel,
>>
>> I use a value of 3 for db_mode.
>>
>> On Wed, Nov 15, 2017 at 11:11 AM, Daniel-Constantin Mierla <
>> mico...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> what is the value of db_mode parameter for usrloc module?
>>>
>>> Cheers,
>>> Daniel
>>>
>>> On 15.11.17 06:36, Gholamreza Sabery wrote:
>>>
>>> I have a Kamailio server that has:
>>>
>>> modparam("registrar", "max_contacts", 2)
>>>
>>> But recently I noticed some users have more than two records in the
>>> location table. For example one of the users has three different records
>>> with nearly the same information. The records are as follows. Is this
>>> behavior normal? (I am using Kamailio 4XX).
>>>
>>> *** 1. row ***
>>>id: 171296745
>>>  ruid: uloc-2c69-59db6c73-7ca-132d92
>>>  username: 
>>>domain: NULL
>>>   contact: sip:@5.106.35.18:10362
>>>  received: sip:5.106.35.18:10361
>>>  path: NULL
>>>   expires: 2017-11-14 08:45:50
>>> q: -1.00
>>>callid: XpCnmaAhRF
>>>  cseq: 43
>>> last_modified: 2017-11-14 08:44:50
>>> flags: 0
>>>cflags: 64
>>>user_agent: android_1.1.0_samsung_SM-E500H
>>> _7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0 (belle-sip/1.4.2)
>>>socket: udp:192.168.103.21:5060
>>>   methods: NULL
>>>  instance: 
>>>reg_id: 0
>>> server_id: 11369
>>> connection_id: -1
>>> keepalive: 1
>>> partition: 14
>>> *** 2. row ***
>>>id: 171296746
>>>  ruid: uloc-2c69-59db6c73-7f2-eb5d92
>>>  username: 
>>>domain: NULL
>>>   contact: sip:@5.106.35.18:10362
>>>  received: sip:5.106.35.18:10361
>>>  path: NULL
>>>   expires: 2017-11-14 08:45:50
>>> q: -1.00
>>>callid: BzMKuyJN8C
>>>  cseq: 50
>>> last_modified: 2017-11-14 08:44:50
>>> flags: 0
>>>cflags: 64
>>>user_agent: android_1.1.0_samsung_SM-E500H
>>> _7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0 (belle-sip/1.4.2)
>>>socket: udp:192.168.103.21:5060
>>>   methods: NULL
>>>  instance: 
>>>reg_id: 0
>>> server_id: 11369
>>> connection_id: -1
>>> keepalive: 1
>>> partition: 23
>>> *** 3. row ***
>>>id: 171296747
>>>  ruid: uloc-2c69-59db6c73-80f-541d92
>>>  username: 
>>>domain: NULL
>>>   contact: sip:@5.106.35.18:10362
>>>  received: sip:5.106.35.18:10361
>>>  path: NULL
>>>   expires: 2017-11-14 08:45:50
>>> q: -1.00
>>>callid: 3p9P4PgZSv
>>>  cseq: 51
>>> last_modified: 2017-11-14 08:44:50
>>> flags: 0
>>>cflags: 64
>>>user_agent: android_1.1.0_samsung_SM-E500H
>>> _7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0 (belle-sip/1.4.2)
>>>socket: udp:192.168.103.21:5060
>>>   methods: NULL
>>>  instance: 
>>>reg_id: 0
>>> server_id: 11369
>>> connection_id: -1
>>> keepalive: 1
>>> partition: 15
>>>
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing 
>>> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>> --
>>> Daniel-Constantin Mierlawww.twitter.com/miconda -- 
>>> www.linkedin.com/in/miconda
>>> Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
>>> Kamailio World Conference - www.kamailioworld.com
>>>
>>>
>>
>
> --
> Daniel-Constantin Mierlawww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
> Kamailio World Conference - www.kamailioworld.com
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] max_contacts does not work as expected

2017-11-16 Thread Daniel-Constantin Mierla
Very busy with the work this week ...

To see if this a limitation of db only mode or not, can you test with
db_mode=1?

Cheers,
Daniel


On 16.11.17 16:51, Gholamreza Sabery wrote:
> No ideas?
>
> On Wed, Nov 15, 2017 at 3:27 PM, Gholamreza Sabery
> > wrote:
>
> Hello Daniel,
>
> I use a value of 3 for db_mode.
>
> On Wed, Nov 15, 2017 at 11:11 AM, Daniel-Constantin Mierla
> > wrote:
>
> Hello,
>
> what is the value of db_mode parameter for usrloc module?
>
> Cheers,
> Daniel
>
>
> On 15.11.17 06:36, Gholamreza Sabery wrote:
>> I have a Kamailio server that has:
>>
>> modparam("registrar", "max_contacts", 2)
>>
>> But recently I noticed some users have more than two records
>> in the location table. For example one of the users has three
>> different records with nearly the same information. The
>> records are as follows. Is this behavior normal? (I am using
>> Kamailio 4XX).
>>
>> *** 1. row ***
>>    id: 171296745
>>  ruid: uloc-2c69-59db6c73-7ca-132d92
>>  username: 
>>    domain: NULL
>>   contact: sip:@5.106.35.18:10362
>> 
>>  received: sip:5.106.35.18:10361 
>>  path: NULL
>>   expires: 2017-11-14 08:45:50
>>     q: -1.00
>>    callid: XpCnmaAhRF
>>  cseq: 43
>> last_modified: 2017-11-14 08:44:50
>>     flags: 0
>>    cflags: 64
>>    user_agent:
>> 
>> android_1.1.0_samsung_SM-E500H_7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0
>> (belle-sip/1.4.2)
>>    socket: udp:192.168.103.21:5060
>> 
>>   methods: NULL
>>  instance: 
>>    reg_id: 0
>>     server_id: 11369
>> connection_id: -1
>>     keepalive: 1
>>     partition: 14
>> *** 2. row ***
>>    id: 171296746
>>  ruid: uloc-2c69-59db6c73-7f2-eb5d92
>>  username: 
>>    domain: NULL
>>   contact: sip:@5.106.35.18:10362
>> 
>>  received: sip:5.106.35.18:10361 
>>  path: NULL
>>   expires: 2017-11-14 08:45:50
>>     q: -1.00
>>    callid: BzMKuyJN8C
>>  cseq: 50
>> last_modified: 2017-11-14 08:44:50
>>     flags: 0
>>    cflags: 64
>>    user_agent:
>> 
>> android_1.1.0_samsung_SM-E500H_7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0
>> (belle-sip/1.4.2)
>>    socket: udp:192.168.103.21:5060
>> 
>>   methods: NULL
>>  instance: 
>>    reg_id: 0
>>     server_id: 11369
>> connection_id: -1
>>     keepalive: 1
>>     partition: 23
>> *** 3. row ***
>>    id: 171296747
>>  ruid: uloc-2c69-59db6c73-80f-541d92
>>  username: 
>>    domain: NULL
>>   contact: sip:@5.106.35.18:10362
>> 
>>  received: sip:5.106.35.18:10361 
>>  path: NULL
>>   expires: 2017-11-14 08:45:50
>>     q: -1.00
>>    callid: 3p9P4PgZSv
>>  cseq: 51
>> last_modified: 2017-11-14 08:44:50
>>     flags: 0
>>    cflags: 64
>>    user_agent:
>> 
>> android_1.1.0_samsung_SM-E500H_7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0
>> (belle-sip/1.4.2)
>>    socket: udp:192.168.103.21:5060
>> 
>>   methods: NULL
>>  instance: 
>>    reg_id: 0
>>     server_id: 11369
>> connection_id: -1
>>     keepalive: 1
>>     partition: 15
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org 
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> 
>
> -- 
> Daniel-Constantin Mierla
> www.twitter.com/miconda  -- 
> 

Re: [SR-Users] dr_load_routing_info(): failed to add rule id 4 -> skipping

2017-11-16 Thread Daniel-Constantin Mierla
Hello,


On 16.11.17 17:35, Karsten Horsmann wrote:
> Hello Daniel,
>
> indeed dialplan could solve this. But i dont follow that because i
> dont want to manipulate the $rU part.

if you do not set subst_exp and repl_exp, then no change is done.

To make that feature more visible, the upcoming 5.1 has a dedicated
function just to do the match:

  -
https://www.kamailio.org/docs/modules/devel/modules/dialplan.html#dialplan.p.dp_match

Cheers,
Daniel

> So for my usecase as siprouter to route "comes from X goes to Y, comes
> from Z goes to A" i use permissions module (comes from) and dispatcher
> (goes to) .
>
> Thanks for the drouting statement. Its okay. I was trapped by the
> db-field. I try it and saw later that it was not the module i need.
>
> Kind Regards
>
> 2017-11-16 15:57 GMT+01:00 Daniel-Constantin Mierla  >:
>
> Hello,
>
>
> On 16.11.17 10:40, Karsten Horsmann wrote:
>> Hi List,
>>
>> i answer myself if someone search for the same problem and ends
>> with no solution.
>> Short answer to "drouting" based on "alphanumeric" prefix
>> question is - NO.
>> Only numbers are allowed, maybe a + sign, i dont check that.
> answered by Dmitri in another response, the chars allowed in
> prefix are the digits, +, * and #.
>
> Anyhow, even making it configurable, if you want to allow all the
> alphanumeric chars in the prefix, the indexing of the prefixes
> becomes inefficient, at least from memory point of view. The
> module uses tree indexing for prefixes and each node is composed
> by so many items as possible chars in the prefix, so the node size
> is going to be big if you have lot of possible chars in it.
>
> The usual solution in this case is to have two layers of indexing.
> Use htable or dialplan modules to map between an alphanumeric
> value to a numerical id and then use that id for matching in
> drouting (or other tree indexing modules such as mtree).
>
> Cheers,
> Daniel
>
>>
>> 2017-11-13 14:38 GMT+01:00 Karsten Horsmann > >:
>>
>> Hello List,
>>
>> i use kamailio-5.0.4 and i experiment with the drouting
>> module with mysql-db.
>>
>> I try to route with "alphanumeric" stuff - like 'tetris' in
>> sip://tetris@mytest.example 
>>
>> 
>> https://www.kamailio.org/docs/db-tables/kamailio-db-devel.html#idp31352844
>> 
>> 
>> The DB-Field is an 64 string like route-id. In
>> dr_rules.route-id i can use "named-routes"
>> if i leave the prefix empty or i fill in only numbers.
>>
>> With strings i got this error:
>>
>> ERROR: drouting [dr_load.c:555]: dr_load_routing_info():
>> failed to add rule id 4 -> skipping
>>
>> SQL Result for rule-id 4:
>> # dr_rules
>> # ruleid, groupid, prefix, timerec, priority, routeid,
>> gwlist, description
>> '4', '9000', 'tetris', '', '0', 'tetris', '4', 'testroute'
>>
>> Is drouting only for "number-routing"?
>>
>> -- 
>> Kind Regards
>> *Karsten Horsmann*
>>
>>
>>
>>
>> -- 
>> Mit freundlichen Grüßen
>> *Karsten Horsmann*
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org 
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> 
>
> -- 
> Daniel-Constantin Mierla
> www.twitter.com/miconda  -- 
> www.linkedin.com/in/miconda 
> Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com 
> 
> Kamailio World Conference - www.kamailioworld.com 
> 
>
>
>
>
> -- 
> Mit freundlichen Grüßen
> *Karsten Horsmann*

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

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


Re: [SR-Users] parse_from_header(): bad From header

2017-11-16 Thread Donat Zenichev
Hi Daniel.
We are using now kamailio 4.4.6

"the latest release series should have a safety check.." does it mean
stable 5.0.4 ?
Well it is a reasonable advice I think, we haven't tried this way, yet.

I thought about using uac + dialog module together, but this entails a
lot of changes in common logic.

For that moment looks like disabling the restore_mode and restore_dlg
parameters solved the problem.
So that, it is enough for me to keep calm. But further, I want to make
an effort to turn on dialog/uac modules together.

Thanks for your answers.
I will continue this topic as soon as I will start to work with it.


>Hello,
>
>it would be useful to know also the version of kamailio that is run
>there. The latest release series should have a safety check in order to
>prevent setting an invalid restored From/To URI.
>
>On the other hand, if the UA doesn't preserve the From/To, then it
>doesn't require to be unchanged, so the update (without auto restore) of
>the From/To can be done only for initial INVITE, when UA takes the
>caller/callee ids. For requests within the dialog, these headers can be
>left unchanged or changed to something like anonymous at anonymous.invalid
>
>The last option here, which is the safest, is to use dialog module
>together with uac, so uac module stores the From/To values inside the
>dialog and restores them from there, instead of relying on
>record-routing and the masking algorithm for values.
>
>Cheers,
>Daniel
>
>>>On 14.11.17 08:04, Julia Boudniatsky wrote:
>> Hello,
>>
>> It looks like headers "From" in initial INVITE and received message
>> are different.
>>
>> For example:
>>  in INVITE : >
>>  in received message : >
>>
>> When you use header "From" transformation (I see Route with vsf),
>> restore may be correct only for exactly the same header "From".
>> Check may be port number is missing/added in  received message header
>> "From".
>>
>> Best regards,
>> Julia
>>
>> On Mon, Nov 13, 2017 at 5:05 PM, Donat Zenichev
>> mailto:donat.zenichev at gmail.com wrote:
>>
>> Hi community.
>> We experience the problem with malformed messages.
>>
>> First of all, I want to say, that most of time kamailio works well
>> and nothing happens that can drop sessions.
>> But from time-to-time something changes (may be in the network)
>> and kamailio receives requests with malformed headers (To or From
>> hfs).
>>
>> The schema:
>> uplinks ->> kamailio <->> routing server (asterisk)
>>
>> Malformed messages were received only from asterisk server.
>> Sip debug on asterisk showed that messages were transmitted
>> correctly and headers were nice.
>> But kamailio obtains changed (broken) packets or perhaps can't
>> read them properly.
>>
>> How does it look like:
>> Nov 10 12:37:06 kamailio-name kamailio[965]: INFO: 

Re: [SR-Users] best practice to dynamic route block based on $rd - Domain in R-URI

2017-11-16 Thread Karsten Horsmann
Hello List,


i solved this with an "simple" if statement.
For me surprising i tried this without success:

#!define NEWDOMAIN "some.domain.example"
$avp(newdomain) = NEWDOMAIN;

if ($avp(newdomain) == $rd) ...

and this dont match. Also i tried "" around all vars.
And copied into $avp and {s.tolower} all of them.
Nothing works.
avp_print() shows both avps as the same.

Anyway ---

My now working example is that one with avp_check.
Was hard to find the meaning of g/G and i/I in the module.
In the wiki i found an example description of tha avp_check flags.

if (allow_source_address(FLT_IVR)) {
# OLD vs NEW - domain routing...
$avp(newdomain) = NEWDOMAIN;
$avp(pathinfo) = "outbound";
# avp_check flags / avpops
# g/G - use all values of the checked AVP (first parameter)
# i/I - if strings are checked, do it case insensitive
if ( avp_check("$rd", "eq/$avp(newdomain)/gi") ) {
xlog("L_INFO", "go to new-gw\n");
$avp(routing_target) = FLT_FSNODE;
}
else {
xlog("L_INFO", "go to old-gw\n");
$avp(routing_target) = FLT_OLDSBC;
}
xlog("L_INFO", "[$avp(pathinfo)] comes from IVR <$si> to <$ruri>
\n");
route(DISPATCH);
exit;
  }


Kind Regards
...



2017-11-08 13:28 GMT+01:00 Karsten Horsmann :

> Hello List,
>
>
> i use kamailio-5.0.4 and i am now at the point that one kamailio is not
> enough :).
>
> So i decide to set another kamailio internal as sip-router based on
> drouting.
> My config is straight forward the example config with additional drouting
> stuff.
>
> Whats the best practice to route based on $rd with kamailio?
>
> I dont want to end with an bunch of if then else. Should be come from
> database.
>
> Pseudo Code:
>
> if ($rd == old.sbc.domain) {
>route[oldstuff];
> }
> else {
>route[newstuff];
> }
>
> Is there an module that i can use?
>
>
> --
> Kind Regards
> *Karsten Horsmann*
>



-- 
Mit freundlichen Grüßen
*Karsten Horsmann*
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dr_load_routing_info(): failed to add rule id 4 -> skipping

2017-11-16 Thread Karsten Horsmann
Hello Daniel,

indeed dialplan could solve this. But i dont follow that because i dont
want to manipulate the $rU part.
So for my usecase as siprouter to route "comes from X goes to Y, comes from
Z goes to A" i use permissions module (comes from) and dispatcher (goes to)
.

Thanks for the drouting statement. Its okay. I was trapped by the db-field.
I try it and saw later that it was not the module i need.

Kind Regards

2017-11-16 15:57 GMT+01:00 Daniel-Constantin Mierla :

> Hello,
>
> On 16.11.17 10:40, Karsten Horsmann wrote:
>
> Hi List,
>
> i answer myself if someone search for the same problem and ends with no
> solution.
> Short answer to "drouting" based on "alphanumeric" prefix question is - NO.
> Only numbers are allowed, maybe a + sign, i dont check that.
>
> answered by Dmitri in another response, the chars allowed in prefix are
> the digits, +, * and #.
>
> Anyhow, even making it configurable, if you want to allow all the
> alphanumeric chars in the prefix, the indexing of the prefixes becomes
> inefficient, at least from memory point of view. The module uses tree
> indexing for prefixes and each node is composed by so many items as
> possible chars in the prefix, so the node size is going to be big if you
> have lot of possible chars in it.
>
> The usual solution in this case is to have two layers of indexing. Use
> htable or dialplan modules to map between an alphanumeric value to a
> numerical id and then use that id for matching in drouting (or other tree
> indexing modules such as mtree).
>
> Cheers,
> Daniel
>
>
> 2017-11-13 14:38 GMT+01:00 Karsten Horsmann :
>
>> Hello List,
>>
>> i use kamailio-5.0.4 and i experiment with the drouting module with
>> mysql-db.
>>
>> I try to route with "alphanumeric" stuff - like 'tetris' in
>> sip://tetris@mytest.example
>>
>> https://www.kamailio.org/docs/db-tables/kamailio-db-devel.ht
>> ml#idp31352844
>> The DB-Field is an 64 string like route-id. In dr_rules.route-id i can
>> use "named-routes"
>> if i leave the prefix empty or i fill in only numbers.
>>
>> With strings i got this error:
>>
>> ERROR: drouting [dr_load.c:555]: dr_load_routing_info(): failed to add
>> rule id 4 -> skipping
>>
>> SQL Result for rule-id 4:
>> # dr_rules
>> # ruleid, groupid, prefix, timerec, priority, routeid, gwlist, description
>> '4', '9000', 'tetris', '', '0', 'tetris', '4', 'testroute'
>>
>> Is drouting only for "number-routing"?
>>
>> --
>> Kind Regards
>> *Karsten Horsmann*
>>
>
>
>
> --
> Mit freundlichen Grüßen
> *Karsten Horsmann*
>
>
> ___
> Kamailio (SER) - Users Mailing 
> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierlawww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
> Kamailio World Conference - www.kamailioworld.com
>
>


-- 
Mit freundlichen Grüßen
*Karsten Horsmann*
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] max_contacts does not work as expected

2017-11-16 Thread Mojtaba
Hello.
In Kamailio when the uac is registerd in new AOR, the other AOR is take
afew minute until expired time is occure.
As you mentioned you set db_mode=3, becuase the database is should be
updated,It may take more time to update.
Be notice that if the two different AOR is exist in kamailio,No more
Rrgister requests is accepted with Kamailio.
With Regards.
Mojtaba Esfandiari.S
On 16 Nov 2017 19:22, "Gholamreza Sabery"  wrote:

> No ideas?
>
> On Wed, Nov 15, 2017 at 3:27 PM, Gholamreza Sabery 
> wrote:
>
>> Hello Daniel,
>>
>> I use a value of 3 for db_mode.
>>
>> On Wed, Nov 15, 2017 at 11:11 AM, Daniel-Constantin Mierla <
>> mico...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> what is the value of db_mode parameter for usrloc module?
>>>
>>> Cheers,
>>> Daniel
>>>
>>> On 15.11.17 06:36, Gholamreza Sabery wrote:
>>>
>>> I have a Kamailio server that has:
>>>
>>> modparam("registrar", "max_contacts", 2)
>>>
>>> But recently I noticed some users have more than two records in the
>>> location table. For example one of the users has three different records
>>> with nearly the same information. The records are as follows. Is this
>>> behavior normal? (I am using Kamailio 4XX).
>>>
>>> *** 1. row ***
>>>id: 171296745
>>>  ruid: uloc-2c69-59db6c73-7ca-132d92
>>>  username: 
>>>domain: NULL
>>>   contact: sip:@5.106.35.18:10362
>>>  received: sip:5.106.35.18:10361
>>>  path: NULL
>>>   expires: 2017-11-14 08:45:50
>>> q: -1.00
>>>callid: XpCnmaAhRF
>>>  cseq: 43
>>> last_modified: 2017-11-14 08:44:50
>>> flags: 0
>>>cflags: 64
>>>user_agent: android_1.1.0_samsung_SM-E500H
>>> _7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0 (belle-sip/1.4.2)
>>>socket: udp:192.168.103.21:5060
>>>   methods: NULL
>>>  instance: 
>>>reg_id: 0
>>> server_id: 11369
>>> connection_id: -1
>>> keepalive: 1
>>> partition: 14
>>> *** 2. row ***
>>>id: 171296746
>>>  ruid: uloc-2c69-59db6c73-7f2-eb5d92
>>>  username: 
>>>domain: NULL
>>>   contact: sip:@5.106.35.18:10362
>>>  received: sip:5.106.35.18:10361
>>>  path: NULL
>>>   expires: 2017-11-14 08:45:50
>>> q: -1.00
>>>callid: BzMKuyJN8C
>>>  cseq: 50
>>> last_modified: 2017-11-14 08:44:50
>>> flags: 0
>>>cflags: 64
>>>user_agent: android_1.1.0_samsung_SM-E500H
>>> _7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0 (belle-sip/1.4.2)
>>>socket: udp:192.168.103.21:5060
>>>   methods: NULL
>>>  instance: 
>>>reg_id: 0
>>> server_id: 11369
>>> connection_id: -1
>>> keepalive: 1
>>> partition: 23
>>> *** 3. row ***
>>>id: 171296747
>>>  ruid: uloc-2c69-59db6c73-80f-541d92
>>>  username: 
>>>domain: NULL
>>>   contact: sip:@5.106.35.18:10362
>>>  received: sip:5.106.35.18:10361
>>>  path: NULL
>>>   expires: 2017-11-14 08:45:50
>>> q: -1.00
>>>callid: 3p9P4PgZSv
>>>  cseq: 51
>>> last_modified: 2017-11-14 08:44:50
>>> flags: 0
>>>cflags: 64
>>>user_agent: android_1.1.0_samsung_SM-E500H
>>> _7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0 (belle-sip/1.4.2)
>>>socket: udp:192.168.103.21:5060
>>>   methods: NULL
>>>  instance: 
>>>reg_id: 0
>>> server_id: 11369
>>> connection_id: -1
>>> keepalive: 1
>>> partition: 15
>>>
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing 
>>> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>> --
>>> Daniel-Constantin Mierlawww.twitter.com/miconda -- 
>>> www.linkedin.com/in/miconda
>>> Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
>>> Kamailio World Conference - www.kamailioworld.com
>>>
>>>
>>
>
> ___
> 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] max_contacts does not work as expected

2017-11-16 Thread Gholamreza Sabery
No ideas?

On Wed, Nov 15, 2017 at 3:27 PM, Gholamreza Sabery 
wrote:

> Hello Daniel,
>
> I use a value of 3 for db_mode.
>
> On Wed, Nov 15, 2017 at 11:11 AM, Daniel-Constantin Mierla <
> mico...@gmail.com> wrote:
>
>> Hello,
>>
>> what is the value of db_mode parameter for usrloc module?
>>
>> Cheers,
>> Daniel
>>
>> On 15.11.17 06:36, Gholamreza Sabery wrote:
>>
>> I have a Kamailio server that has:
>>
>> modparam("registrar", "max_contacts", 2)
>>
>> But recently I noticed some users have more than two records in the
>> location table. For example one of the users has three different records
>> with nearly the same information. The records are as follows. Is this
>> behavior normal? (I am using Kamailio 4XX).
>>
>> *** 1. row ***
>>id: 171296745
>>  ruid: uloc-2c69-59db6c73-7ca-132d92
>>  username: 
>>domain: NULL
>>   contact: sip:@5.106.35.18:10362
>>  received: sip:5.106.35.18:10361
>>  path: NULL
>>   expires: 2017-11-14 08:45:50
>> q: -1.00
>>callid: XpCnmaAhRF
>>  cseq: 43
>> last_modified: 2017-11-14 08:44:50
>> flags: 0
>>cflags: 64
>>user_agent: android_1.1.0_samsung_SM-E500H
>> _7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0 (belle-sip/1.4.2)
>>socket: udp:192.168.103.21:5060
>>   methods: NULL
>>  instance: 
>>reg_id: 0
>> server_id: 11369
>> connection_id: -1
>> keepalive: 1
>> partition: 14
>> *** 2. row ***
>>id: 171296746
>>  ruid: uloc-2c69-59db6c73-7f2-eb5d92
>>  username: 
>>domain: NULL
>>   contact: sip:@5.106.35.18:10362
>>  received: sip:5.106.35.18:10361
>>  path: NULL
>>   expires: 2017-11-14 08:45:50
>> q: -1.00
>>callid: BzMKuyJN8C
>>  cseq: 50
>> last_modified: 2017-11-14 08:44:50
>> flags: 0
>>cflags: 64
>>user_agent: android_1.1.0_samsung_SM-E500H
>> _7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0 (belle-sip/1.4.2)
>>socket: udp:192.168.103.21:5060
>>   methods: NULL
>>  instance: 
>>reg_id: 0
>> server_id: 11369
>> connection_id: -1
>> keepalive: 1
>> partition: 23
>> *** 3. row ***
>>id: 171296747
>>  ruid: uloc-2c69-59db6c73-80f-541d92
>>  username: 
>>domain: NULL
>>   contact: sip:@5.106.35.18:10362
>>  received: sip:5.106.35.18:10361
>>  path: NULL
>>   expires: 2017-11-14 08:45:50
>> q: -1.00
>>callid: 3p9P4PgZSv
>>  cseq: 51
>> last_modified: 2017-11-14 08:44:50
>> flags: 0
>>cflags: 64
>>user_agent: android_1.1.0_samsung_SM-E500H
>> _7b271714c08b942aa821fc756cdd2e890a37069e/1.1.0 (belle-sip/1.4.2)
>>socket: udp:192.168.103.21:5060
>>   methods: NULL
>>  instance: 
>>reg_id: 0
>> server_id: 11369
>> connection_id: -1
>> keepalive: 1
>> partition: 15
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing 
>> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>> --
>> Daniel-Constantin Mierlawww.twitter.com/miconda -- 
>> www.linkedin.com/in/miconda
>> Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
>> Kamailio World Conference - www.kamailioworld.com
>>
>>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dr_load_routing_info(): failed to add rule id 4 -> skipping

2017-11-16 Thread Daniel-Constantin Mierla
Hello,


On 16.11.17 10:40, Karsten Horsmann wrote:
> Hi List,
>
> i answer myself if someone search for the same problem and ends with
> no solution.
> Short answer to "drouting" based on "alphanumeric" prefix question is
> - NO.
> Only numbers are allowed, maybe a + sign, i dont check that.
answered by Dmitri in another response, the chars allowed in prefix are
the digits, +, * and #.

Anyhow, even making it configurable, if you want to allow all the
alphanumeric chars in the prefix, the indexing of the prefixes becomes
inefficient, at least from memory point of view. The module uses tree
indexing for prefixes and each node is composed by so many items as
possible chars in the prefix, so the node size is going to be big if you
have lot of possible chars in it.

The usual solution in this case is to have two layers of indexing. Use
htable or dialplan modules to map between an alphanumeric value to a
numerical id and then use that id for matching in drouting (or other
tree indexing modules such as mtree).

Cheers,
Daniel

>
> 2017-11-13 14:38 GMT+01:00 Karsten Horsmann  >:
>
> Hello List,
>
> i use kamailio-5.0.4 and i experiment with the drouting module
> with mysql-db.
>
> I try to route with "alphanumeric" stuff - like 'tetris' in
> sip://tetris@mytest.example 
>
> https://www.kamailio.org/docs/db-tables/kamailio-db-devel.html#idp31352844
> 
> 
> The DB-Field is an 64 string like route-id. In dr_rules.route-id i
> can use "named-routes"
> if i leave the prefix empty or i fill in only numbers.
>
> With strings i got this error:
>
> ERROR: drouting [dr_load.c:555]: dr_load_routing_info(): failed to
> add rule id 4 -> skipping
>
> SQL Result for rule-id 4:
> # dr_rules
> # ruleid, groupid, prefix, timerec, priority, routeid, gwlist,
> description
> '4', '9000', 'tetris', '', '0', 'tetris', '4', 'testroute'
>
> Is drouting only for "number-routing"?
>
> -- 
> Kind Regards
> *Karsten Horsmann*
>
>
>
>
> -- 
> Mit freundlichen Grüßen
> *Karsten Horsmann*
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

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


Re: [SR-Users] dr_load_routing_info(): failed to add rule id 4 -> skipping

2017-11-16 Thread Daniel-Constantin Mierla
Hello,


On 16.11.17 14:26, Dmitri Savolainen wrote:
> Hi
> Right now it is decimal digits, '*', '#',  '+'

indeed, these seems to be the supported chars in the prefix value. I
just added the note about them in the docs/.
>
>  Was the discussion to make the list configurable someday
I don't recall the discussion, maybe I haven't paid much attention
because I don't use this module that much and for what I do, it was
enough with these chars, but of course, making the supported chars list
a modparam will add more flexibility, so if anyone does a patch for it,
it will be merged...

Cheers,
Daniel
>
> 2017-11-16 12:40 GMT+03:00 Karsten Horsmann  >:
>
> Hi List,
>
> i answer myself if someone search for the same problem and ends
> with no solution.
> Short answer to "drouting" based on "alphanumeric" prefix question
> is - NO.
> Only numbers are allowed, maybe a + sign, i dont check that.
>
> 2017-11-13 14:38 GMT+01:00 Karsten Horsmann  >:
>
> Hello List,
>
> i use kamailio-5.0.4 and i experiment with the drouting module
> with mysql-db.
>
> I try to route with "alphanumeric" stuff - like 'tetris' in
> sip://tetris@mytest.example 
>
> 
> https://www.kamailio.org/docs/db-tables/kamailio-db-devel.html#idp31352844
> 
> 
> The DB-Field is an 64 string like route-id. In
> dr_rules.route-id i can use "named-routes"
> if i leave the prefix empty or i fill in only numbers.
>
> With strings i got this error:
>
> ERROR: drouting [dr_load.c:555]: dr_load_routing_info():
> failed to add rule id 4 -> skipping
>
> SQL Result for rule-id 4:
> # dr_rules
> # ruleid, groupid, prefix, timerec, priority, routeid, gwlist,
> description
> '4', '9000', 'tetris', '', '0', 'tetris', '4', 'testroute'
>
> Is drouting only for "number-routing"?
>
> -- 
> Kind Regards
> *Karsten Horsmann*
>
>
>
>
> -- 
> Mit freundlichen Grüßen
> *Karsten Horsmann*
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org 
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 
>
>
>
>
> -- 
> Savolainen Dmitri
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
Kamailio World Conference - www.kamailioworld.com

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


Re: [SR-Users] How to use $var as arguments to module functions

2017-11-16 Thread Dmitri Savolainen
Hi.
According to docs no variables are possible here.
As workaround
if ($var(nat_fix) == 11){
  fix_nated_sdp("11");
}
else if 

2017-11-14 19:04 GMT+03:00 Duarte Rocha :

> Greetings,
>
> Is there a way to use the NATHELPER functions with a variable insted of a
> string with the value ?
>
> For example, I can do "fix_nated_sdp("11");" but Kamailio throws an error
> if i use
> "fix_nated_sdp("$(var(nat_fix)");" or any other variations.
>
> How should i proceed to be able to do this ?
>
> Thanks
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>


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


Re: [SR-Users] DBURL password in clear

2017-11-16 Thread Jurijs Ivolga
Hi,

Not sure that this helps, but below is how I solved similar issue by
generating include file inside Docker file using env variables, but this is
not a good approach for sensitive data.

echo "\modparam(\"http_client\", \"httpcon\",
\"apiserver=>https://$apiurl\;); \" >> /kamailio.apiurl

I believe you can use docker secrets, as described below, but I never used
them so I can't help much:

https://medium.com/@basi/docker-environment-variables-expanded-from-secrets-8fa70617b3bc

With kind regards,

Jurijs

On Thu, Nov 16, 2017 at 11:34 AM, Daniel Tryba  wrote:

> On Wed, Nov 15, 2017 at 08:46:58AM +0100, Daniel-Constantin Mierla wrote:
> > > I???m working for a UK high street bank and our Kamailio
> implementation has been challenged because we???ve got database passwords
> held in clear in the configuration file.
> ...
> > > My requirement is simple, I need to be able to supply a password via
> means such as loading a variable from a run-once script at start up, or a
> module. The ideal would be to be able to read in a Docker secret :)
> > >
> > you can define a for a token to be used inside kamailio.cfg by using -A
> > command line parameter. So when you start kamailio, fetch the password
> > from your secure system by what so ever meaning, then build the database
> > url based on it and run kamailio with:
> >
> > kamailio - A DBURL='mysql://user:passwd@dbhost/kamailio' ...
>
> My guess is the next problem will be the password being visible to all
> users querying the processlist :)
>
> Is including a file (import_file) with passwords an option? Generate the
> file just before startup, remove it (ofcourse in a secure way (shred the
> file and overwrite all freespace with a multiple patters a few dozen
> times (ask the auditors for the exact specifications that make them
> happy))) after kamailio is running.
>
>
> ___
> 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] dr_load_routing_info(): failed to add rule id 4 -> skipping

2017-11-16 Thread Karsten Horsmann
Hi List,

i answer myself if someone search for the same problem and ends with no
solution.
Short answer to "drouting" based on "alphanumeric" prefix question is - NO.
Only numbers are allowed, maybe a + sign, i dont check that.

2017-11-13 14:38 GMT+01:00 Karsten Horsmann :

> Hello List,
>
> i use kamailio-5.0.4 and i experiment with the drouting module with
> mysql-db.
>
> I try to route with "alphanumeric" stuff - like 'tetris' in
> sip://tetris@mytest.example
>
> https://www.kamailio.org/docs/db-tables/kamailio-db-devel.html#idp31352844
> The DB-Field is an 64 string like route-id. In dr_rules.route-id i can use
> "named-routes"
> if i leave the prefix empty or i fill in only numbers.
>
> With strings i got this error:
>
> ERROR: drouting [dr_load.c:555]: dr_load_routing_info(): failed to add
> rule id 4 -> skipping
>
> SQL Result for rule-id 4:
> # dr_rules
> # ruleid, groupid, prefix, timerec, priority, routeid, gwlist, description
> '4', '9000', 'tetris', '', '0', 'tetris', '4', 'testroute'
>
> Is drouting only for "number-routing"?
>
> --
> Kind Regards
> *Karsten Horsmann*
>



-- 
Mit freundlichen Grüßen
*Karsten Horsmann*
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] DBURL password in clear

2017-11-16 Thread Daniel Tryba
On Wed, Nov 15, 2017 at 08:46:58AM +0100, Daniel-Constantin Mierla wrote:
> > I???m working for a UK high street bank and our Kamailio implementation has 
> > been challenged because we???ve got database passwords held in clear in the 
> > configuration file.
...
> > My requirement is simple, I need to be able to supply a password via means 
> > such as loading a variable from a run-once script at start up, or a module. 
> > The ideal would be to be able to read in a Docker secret :)
> >
> you can define a for a token to be used inside kamailio.cfg by using -A
> command line parameter. So when you start kamailio, fetch the password
> from your secure system by what so ever meaning, then build the database
> url based on it and run kamailio with:
> 
> kamailio - A DBURL='mysql://user:passwd@dbhost/kamailio' ...

My guess is the next problem will be the password being visible to all
users querying the processlist :)

Is including a file (import_file) with passwords an option? Generate the
file just before startup, remove it (ofcourse in a secure way (shred the
file and overwrite all freespace with a multiple patters a few dozen
times (ask the auditors for the exact specifications that make them
happy))) after kamailio is running. 


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


Re: [SR-Users] play music while processing a http request

2017-11-16 Thread 赵国杰
Hello
Yes I did. It generates two files: ivr-unavailable-8000.wav.0 and 
ivr-unavailable-8000.wav.8

在 2017-11-16 15:50:05,"Rick Barenthin"  写道:

Hello,


Did you have used the makeann from rtpproxy?


Quoting from manual:
"Instruct the RTPproxy to stream prompt/announcement pre-encoded with the 
makeann command from the RTPproxy distribution."



Am 15.11.2017 07:59 schrieb "赵国杰" :

Hello guys,
I googled the problem and came up with the following solution
request_route {
...
if (rtpproxy_offer())
 t_on_reply("FORCE_RTPPROXY");
rtpproxy_stream2uac("/etc/kamailio/moh/ivr-unavailable-8000.wav", "-1");
t_newtran();
http_async_query("url here", "HTTP_REPLY");
}


route[HTTP_REPLY] {
...
# forward the invite to ua2
}


  on rtpproxy server,I got the following log:
INFO:siy6BoTWsN-w8cTbn9lRfnQV08Atsp6i:rtpp_stream_handle_play: -1 times 
playing prompt /etc/kamailio/moh/ivr-unavailable-8000.wav codec 8: 
SSRC=0x74A2C220, seq=10235


 However the caller has no audio, can anyone help?


Thanks





At 2017-11-14 18:04:13, "赵国杰"  wrote:

Hello guys,
I have the following senario:
   ua1 calls ua2. when the INVITE reaches the kamailio, before foward to 
ua2, kamailio has to do a http request using  “http_async_query”. However, the 
http request can take a really long time. I want the kamailio start playing 
music when the http request is sent and stop the music when the http response 
is received.
My config file is like this:


request_route {
...
t_newtran();
http_async_query("url here", "HTTP_REPLY");
}


route[HTTP_REPLY] {
...
# forward the invite to ua2
}
   how do i complete the config?


Thanks




 





 


___
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