Re: [SR-Users] RPCFIFOPATH / DEFINE_FIFO_NAME settings problem

2017-03-27 Thread Ginhoux, Patrick
Hi,

I continue to investigate on this area.

I’m thinking that there are some security settings on the FS /var/, and I’m 
looking for if we have the rights to change it (I work for a project and don’t 
have all the ability to change some settings without agreement).

I’ll update you later tomorrow.

Cordialement
Patrick GINHOUX

De : Daniel-Constantin Mierla [mailto:mico...@gmail.com]
Envoyé : lundi 27 mars 2017 15:28
À : Ginhoux, Patrick ; Kamailio (SER) - Users 
Mailing List 
Objet : Re: [SR-Users] RPCFIFOPATH / DEFINE_FIFO_NAME settings problem


Hello,

as recently as last week, someone encountered an file access problem while 
installing Siremis, which is using also some temporary files in /var/, even it 
was granting provileges via chown and chmod. All went fine after disabling 
selinux. It was on a centos.

I am not saying it is the same, but it could, so try without centos to see if 
the issue persists.

Cheers,
Daniel


On 27/03/2017 15:10, Ginhoux, Patrick wrote:
Hi,

This is the RHEL 7.1 distro, and there is use of selinux, apparmor or other 
tools.

Are you meaning that the /var/run/ folder would be secured more than other 
folders?

Cordialement
Patrick GINHOUX

De : sr-users [mailto:sr-users-boun...@lists.sip-router.org] De la part de 
Daniel-Constantin Mierla
Envoyé : lundi 27 mars 2017 13:52
À : Kamailio (SER) - Users Mailing List 

Objet : Re: [SR-Users] RPCFIFOPATH / DEFINE_FIFO_NAME settings problem


Hello,

kamailio should attempt to create the /var/run/kamailio folder if the 
application is run with enough privileges. However, some operating systems add 
more constraints on top of the execution user.

What is your OS distro? Do you have selinux, apparmor or other similar tools 
enabled?

Cheers,
Daniel

On 24/03/2017 17:52, Ginhoux, Patrick wrote:
In my ‘kamctlrc’ file :

## path to FIFO file for engine RPCFIFO
RPCFIFOPATH="/var/run/kamailio/kamailio_rpc_fifo"
#RPCFIFOPATH="/tmp/kamailio_rpc_fifo"

In my ‘kamailio.cfg’ :

!!ifndef DEFINE_FIFO_NAME
!!define DEFINE_FIFO_NAME "/var/run/kamailio/kamailio_rpc_fifo"
!!endif


modparam("jsonrpcs", "pretty_format", 1)
modparam("jsonrpcs", "transport", 2)
modparam("jsonrpcs", "fifo_name", DEFINE_FIFO_NAME)
modparam("jsonrpcs", "fifo_mode", 0755)
modparam("jsonrpcs", "fifo_group", "kamailio")
modparam("jsonrpcs", "fifo_user", "kamailio")


kamailio doesn’t start. It reports ‘Permission denied’ :

Mar 24 17:31:21 localhost /usr/sbin/kamailio[1138]: ERROR: jsonrpcs 
[jsonrpcs_fifo.c:144]: jsonrpc_init_fifo_server(): Can't create FIFO: 
Permission denied (mode=493)
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1138]: CRITICAL: jsonrpcs 
[jsonrpcs_fifo.c:489]: jsonrpc_fifo_process(): failed to init jsonrpc fifo 
server
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: ALERT:  [main.c:741]: 
handle_sigs(): child process 1138 exited normally, status=255
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1130]: DEBUG:  
[core/sr_module.c:920]: init_mod_child(): rank 4: tm
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1137]: DEBUG:  
[core/sr_module.c:920]: init_mod_child(): rank -1: tm
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1127]: DEBUG: htable 
[htable.c:226]: child_init(): rank is (1)
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: INFO:  [main.c:759]: 
handle_sigs(): terminating due to SIGCHLD
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1139]: DEBUG:  
[core/sr_module.c:920]: init_mod_child(): rank -2: kex
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1130]: DEBUG: tm [callid.c:137]: 
child_init_callid(): callid: 
'15b1f0d63a718465-1130@129.227.83.108'
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1137]: DEBUG: tm [callid.c:137]: 
child_init_callid(): callid: 
'15b1f0d63a718465-1137@129.227.83.108'
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1127]: DEBUG:  
[core/action.c:1656]: run_child_one_init_route(): attempting to run 
event_route[core:worker-one-init]
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1136]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1135]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1134]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1133]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1132]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1131]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1129]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1128]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: 

Re: [SR-Users] Nightly build config error

2017-03-27 Thread David Villasmil
Sorry, this is on a:

cat /etc/debian_version
8.4
ᐧ

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337

On Mon, Mar 27, 2017 at 7:05 PM, David Villasmil <
david.villasmil.w...@gmail.com> wrote:

> Hello guys,
>
> I have in my apt the nightly build repo, which i use fairly regularly for
> testing.
> Today i tried installing kamailio 5 and got the following:
>
>
> # apt-get install -y kamailio
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following packages were automatically installed and are no longer
> required:
>   libdbd-mysql-perl libdbi-perl libev4 libevent-2.0-5 libjansson4
> libmysqlclient18 libsctp1 libterm-readkey-perl libunistring0 mysql-client
> mysql-client-5.5
>   mysql-common
> Use 'apt-get autoremove' to remove them.
> Suggested packages:
>   kamailio-berkeley-modules kamailio-carrierroute-modules
> kamailio-cpl-modules kamailio-dbg kamailio-ldap-modules
> kamailio-lua-modules kamailio-mysql-modules
>   kamailio-perl-modules kamailio-postgres-modules
> kamailio-presence-modules kamailio-python-modules kamailio-radius-modules
> kamailio-snmpstats-modules
>   kamailio-tls-modules kamailio-unixodbc-modules kamailio-xml-modules
> kamailio-xmpp-modules
> The following NEW packages will be installed:
>   kamailio
> 0 upgraded, 1 newly installed, 0 to remove and 42 not upgraded.
> Need to get 0 B/5304 kB of archives.
> After this operation, 24.5 MB of additional disk space will be used.
> Selecting previously unselected package kamailio.
> (Reading database ... 37888 files and directories currently installed.)
> Preparing to unpack .../kamailio_5.0.0+0~20170322012605.24+jessie_amd64.deb
> ...
> Unpacking kamailio (5.0.0+0~20170322012605.24+jessie) ...
> Processing triggers for systemd (215-17+deb8u4) ...
> Processing triggers for man-db (2.7.0.2-5) ...
> Setting up kamailio (5.0.0+0~20170322012605.24+jessie) ...
> Job for kamailio.service failed. See 'systemctl status kamailio.service'
> and 'journalctl -xn' for details.
> invoke-rc.d: initscript kamailio, action "start" failed.
> dpkg: error processing package kamailio (--configure):
>  subprocess installed post-installation script returned error exit status 1
> Processing triggers for systemd (215-17+deb8u4) ...
> Errors were encountered while processing:
>  kamailio
> [master 5dad0af] committing changes in /etc after apt run
>  16 files changed, 2992 insertions(+)
>  create mode 100644 default/kamailio
>  create mode 100755 init.d/kamailio
>  create mode 100644 kamailio/dictionary.kamailio
>  create mode 100644 kamailio/kamailio-advanced.cfg
>  create mode 100644 kamailio/kamailio-basic.cfg
>  create mode 100644 kamailio/kamailio.cfg
>  create mode 100644 kamailio/kamctlrc
>  create mode 12 rc0.d/K02kamailio
>  create mode 12 rc1.d/K02kamailio
>  create mode 12 rc2.d/S03kamailio
>  create mode 12 rc3.d/S03kamailio
>  create mode 12 rc4.d/S03kamailio
>  create mode 12 rc5.d/S03kamailio
>  create mode 12 rc6.d/K02kamailio
>  create mode 12 systemd/system/multi-user.
> target.wants/kamailio.service
> Counting objects: 1321, done.
> Compressing objects: 100% (749/749), done.
> Writing objects: 100% (1321/1321), done.
> Total 1321 (delta 127), reused 1320 (delta 126)
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
>
> Checking up:
>
> root@homer-dev ~/homer-docker# systemctl status kamailio.service
> * kamailio.service - Kamailio (OpenSER) - the Open Source SIP Server
>Loaded: loaded (/lib/systemd/system/kamailio.service; enabled)
>Active: failed (Result: exit-code) since Mon 2017-03-27 16:58:09 UTC;
> 7s ago
>
> Mar 27 16:58:09 homer-dev kamailio[9438]: ERROR:  [core/cfg.y:3264]:
> yyparse(): cfg. parser: failed to find command t_precheck_trans (params 0)
> Mar 27 16:58:09 homer-dev kamailio[9438]: CRITICAL: 
> [core/cfg.y:3404]: yyerror_at(): parse error in config file
> /etc/kamailio/kamailio.cfg, line 479,...oadmodule?
> Mar 27 16:58:09 homer-dev kamailio[9438]: ERROR:  [core/cfg.y:3264]:
> yyparse(): cfg. parser: failed to find command t_check_trans (params 0)
> Mar 27 16:58:09 homer-dev kamailio[9438]: CRITICAL: 
> [core/cfg.y:3404]: yyerror_at(): parse error in config file
> /etc/kamailio/kamailio.cfg, line 480,...oadmodule?
> Mar 27 16:58:09 homer-dev kamailio[9438]: ERROR:  [core/cfg.y:3264]:
> yyparse(): cfg. parser: failed to find command t_check_trans (params 0)
> Mar 27 16:58:09 homer-dev kamailio[9438]: CRITICAL: 
> [core/cfg.y:3404]: yyerror_at(): parse error in config file
> /etc/kamailio/kamailio.cfg, line 483,...oadmodule?
> Mar 27 16:58:09 homer-dev systemd[1]: kamailio.service: control process
> exited, code=exited status=255
> Mar 27 16:58:09 homer-dev systemd[1]: Failed to start Kamailio (OpenSER) -
> the Open Source SIP Server.
> Mar 27 16:58:09 homer-dev systemd[1]: Unit kamailio.service entered failed
> state.
> Mar 27 16:58:09 homer-dev kamailio[9438]: ERROR: bad config file (46
> 

[SR-Users] Nightly build config error

2017-03-27 Thread David Villasmil
Hello guys,

I have in my apt the nightly build repo, which i use fairly regularly for
testing.
Today i tried installing kamailio 5 and got the following:


# apt-get install -y kamailio
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer
required:
  libdbd-mysql-perl libdbi-perl libev4 libevent-2.0-5 libjansson4
libmysqlclient18 libsctp1 libterm-readkey-perl libunistring0 mysql-client
mysql-client-5.5
  mysql-common
Use 'apt-get autoremove' to remove them.
Suggested packages:
  kamailio-berkeley-modules kamailio-carrierroute-modules
kamailio-cpl-modules kamailio-dbg kamailio-ldap-modules
kamailio-lua-modules kamailio-mysql-modules
  kamailio-perl-modules kamailio-postgres-modules kamailio-presence-modules
kamailio-python-modules kamailio-radius-modules kamailio-snmpstats-modules
  kamailio-tls-modules kamailio-unixodbc-modules kamailio-xml-modules
kamailio-xmpp-modules
The following NEW packages will be installed:
  kamailio
0 upgraded, 1 newly installed, 0 to remove and 42 not upgraded.
Need to get 0 B/5304 kB of archives.
After this operation, 24.5 MB of additional disk space will be used.
Selecting previously unselected package kamailio.
(Reading database ... 37888 files and directories currently installed.)
Preparing to unpack .../kamailio_5.0.0+0~20170322012605.24+jessie_amd64.deb
...
Unpacking kamailio (5.0.0+0~20170322012605.24+jessie) ...
Processing triggers for systemd (215-17+deb8u4) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up kamailio (5.0.0+0~20170322012605.24+jessie) ...
Job for kamailio.service failed. See 'systemctl status kamailio.service'
and 'journalctl -xn' for details.
invoke-rc.d: initscript kamailio, action "start" failed.
dpkg: error processing package kamailio (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (215-17+deb8u4) ...
Errors were encountered while processing:
 kamailio
[master 5dad0af] committing changes in /etc after apt run
 16 files changed, 2992 insertions(+)
 create mode 100644 default/kamailio
 create mode 100755 init.d/kamailio
 create mode 100644 kamailio/dictionary.kamailio
 create mode 100644 kamailio/kamailio-advanced.cfg
 create mode 100644 kamailio/kamailio-basic.cfg
 create mode 100644 kamailio/kamailio.cfg
 create mode 100644 kamailio/kamctlrc
 create mode 12 rc0.d/K02kamailio
 create mode 12 rc1.d/K02kamailio
 create mode 12 rc2.d/S03kamailio
 create mode 12 rc3.d/S03kamailio
 create mode 12 rc4.d/S03kamailio
 create mode 12 rc5.d/S03kamailio
 create mode 12 rc6.d/K02kamailio
 create mode 12 systemd/system/multi-user.target.wants/kamailio.service
Counting objects: 1321, done.
Compressing objects: 100% (749/749), done.
Writing objects: 100% (1321/1321), done.
Total 1321 (delta 127), reused 1320 (delta 126)
E: Sub-process /usr/bin/dpkg returned an error code (1)


Checking up:

root@homer-dev ~/homer-docker# systemctl status kamailio.service
* kamailio.service - Kamailio (OpenSER) - the Open Source SIP Server
   Loaded: loaded (/lib/systemd/system/kamailio.service; enabled)
   Active: failed (Result: exit-code) since Mon 2017-03-27 16:58:09 UTC; 7s
ago

Mar 27 16:58:09 homer-dev kamailio[9438]: ERROR:  [core/cfg.y:3264]:
yyparse(): cfg. parser: failed to find command t_precheck_trans (params 0)
Mar 27 16:58:09 homer-dev kamailio[9438]: CRITICAL: 
[core/cfg.y:3404]: yyerror_at(): parse error in config file
/etc/kamailio/kamailio.cfg, line 479,...oadmodule?
Mar 27 16:58:09 homer-dev kamailio[9438]: ERROR:  [core/cfg.y:3264]:
yyparse(): cfg. parser: failed to find command t_check_trans (params 0)
Mar 27 16:58:09 homer-dev kamailio[9438]: CRITICAL: 
[core/cfg.y:3404]: yyerror_at(): parse error in config file
/etc/kamailio/kamailio.cfg, line 480,...oadmodule?
Mar 27 16:58:09 homer-dev kamailio[9438]: ERROR:  [core/cfg.y:3264]:
yyparse(): cfg. parser: failed to find command t_check_trans (params 0)
Mar 27 16:58:09 homer-dev kamailio[9438]: CRITICAL: 
[core/cfg.y:3404]: yyerror_at(): parse error in config file
/etc/kamailio/kamailio.cfg, line 483,...oadmodule?
Mar 27 16:58:09 homer-dev systemd[1]: kamailio.service: control process
exited, code=exited status=255
Mar 27 16:58:09 homer-dev systemd[1]: Failed to start Kamailio (OpenSER) -
the Open Source SIP Server.
Mar 27 16:58:09 homer-dev systemd[1]: Unit kamailio.service entered failed
state.
Mar 27 16:58:09 homer-dev kamailio[9438]: ERROR: bad config file (46 errors)
Hint: Some lines were ellipsized, use -l to show in full.


All modules are there, the problem is the startup script can't find where
the modules are installed? If i just un-comment the "mpath" in the config
file, kamailio starts normally.

/* set paths to location of modules */
# mpath="/usr/lib/x86_64-linux-gnu/kamailio/modules/"

I'm not 100%  sure "mpath" was set before, but i don't remember having to
set that up in the 

Re: [SR-Users] Kamailio Registration load Issue

2017-03-27 Thread Jade SZ
Thanks Alex, that's a great hint. I'll check.


PS: Also thanks a lot for the great blog post on SIP server tuning.

On Tue, Mar 28, 2017 at 12:15 AM, Alex Balashov 
wrote:

> You might be running into semi-invisible/not widely publicised (but
> definitely very real) PPS limits on given instance sizes.
>
> On March 27, 2017 3:09:56 PM EDT, Jade SZ  wrote:
> >Hi Guys,
> >
> >I am running a simple REGISTER load test on:
> >
> >1) Kamailio sever with 2 cores - mem 5G
> >2) Kamailio server with 4 cores - mem 16G
> >
> >Both are EC2 instances.
> >
> >At -r = 500 i.e. 500 reg/sec sipP test works fine with very few
> >re-trans.
> >But when i increase it to 800 reg/sec it starts retransmissions in
> >bulk.
> >
> >I don't see server's CPU, load-avg or memory shooting. Running
> >everything
> >by default, even using kamctl to start the instance. So I have not
> >tuned
> >any params yet.
> >
> >My main concern is how can I make server choke and get its actual
> >capacity,
> >and avoid these retransmissions as apparently kamailio is not even
> >utilizing 2 cores and CPU usage is under 10 always.
> >
> >Results of both server is same i.e. 500 reg/sec max so I am sure there
> >is
> >some problem that needs a fix, but need some hints here.
> >
> >Also used multiple SIPp's to rule out if it is SIPp issue, but after
> >500 I
> >see same problem.
> >
> >
> >Regards,
> >JSZ
>
>
> -- Alex
>
> --
> Principal, Evariste Systems LLC (www.evaristesys.com)
>
> Sent from my Google Nexus.
>
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] new keepalive module ?

2017-03-27 Thread Guillaume Bour
Hello,

I submitted the 1st version of my prototype: 
https://github.com/kamailio/kamailio/pull/1045

I attach here 2 sample configurations to use with

Regards,
Guillaume Bour

On Thu, Mar 16, 2017 at 01:18:47PM +0100, Daniel-Constantin Mierla wrote:
> Hello,
> 
> 
> On 13/03/2017 22:45, Guillaume Bour wrote:
> > Hi Daniel,
> >
> > Thanks for you answer
> >
> > On Tue, Mar 07, 2017 at 11:35:17PM +0100, Daniel-Constantin Mierla wrote:
> >> Hello,
> >>
> >>
> >> On 07/03/2017 21:22, Guillaume Bour wrote:
> >>> Hi all,
> >>>
> >>> I would like to implement destinations keepalive in drouting module (as 
> >>> it is done in dispatcher).
> >>> But instead of duplicating what's implemented in dispatcher, I think it 
> >>> would be more clever to create a new module
> >>> dedicated to pinging destinations, and to plug drouting, dispatcher and 
> >>> other modules to this new one
> >>>
> >>> What's you opinion about that ?
> >>>
> >> could be an interesting module, not able to say at this moment if I
> >> would plug it into dispatcher, as I cannot assert the impact, but at
> >> least for adding to drouting or other modules which don't have this
> >> feature, should worth the try.
> >>
> >> How do you plan to have the relation between the modules? Each of them
> >> will have a copy of the addresses, or the addresses of the destinations
> >> will be in. a single module, and the other will refer to them via some
> >> unique id? Will drouting just build the list of destination based on
> >> priority, then check with the new module to see which are active and
> >> remove the inactive ones?
> > My idea is to expose a set of API functions, allowing other modules
> > to register/unregister addresses to monitor.
> > So yes, destinations adresses would be duplicated in keepalive module 
> > memory.
> > Then keepalive module would notify the "source" module when destination
> > status change (available -> unavailable, and vice-versa)
> >
> >> Again, when I would see some sort of prototype/initial version, probably
> >> I can comment more. The questions above just pop up in my mind, but
> >> probably you can just go ahead to write some code as you consider, then
> >> we can start a discussion from there and see what can be improved/better
> >> integrated with existing modules.
> >>
> > I have started working on a POC.
> > It is available at https://github.com/gbour/kamailio/tree/module-keepalive
> OK, thanks for pointing to it.
> 
> Once you get something working, you can make a pull request so we can
> review it using github portal.
> 
> It may be useful to have it working with its own group of destination
> and export to kamailio.cfg some functions to check if a destination is
> active or not, change it state, etc ... It can be used when routing to a
> single pstn gateway or other media servers to reply directly from
> kamailio, not to forward and wait for timeout.
> 
> Cheers,
> Daniel
> >
> >
> >> Cheers,
> >> Daniel
> >>
> >> -- 
> >> Daniel-Constantin Mierla
> >> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> >> Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - 
> >> www.asipto.com
> >> Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
> >>
> >>
> >> ___
> >> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> >> sr-users@lists.sip-router.org
> >> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
> > ___
> > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> > sr-users@lists.sip-router.org
> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
> 
> -- 
> Daniel-Constantin Mierla
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - 
> www.asipto.com
> Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
> 
> 
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

### Global Parameters #

### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR
debug=2
log_stderror=yes

memdbg=5
memlog=5

log_facility=LOG_LOCAL0

children=1

tcp_connection_lifetime=3605
listen=udp:127.0.0.1:5060

mpath="/opt/kamailio-trunk-ka/lib64/kamailio/modules/"
rundir="/tmp"

loadmodule "tm.so"
loadmodule "sl.so"
loadmodule "xlog.so"

# remote commands (kamctl)
loadmodule "xhttp.so"
loadmodule "jsonrpcs.so"
# - 
loadmodule "ctl.so"
loadmodule "keepalive.so"
loadmodule "pv.so"

loadmodule "db_mysql.so"
loadmodule "drouting.so"

loadmodule "avp.so"

# - jsonrpcs -
modparam("jsonrpcs", "fifo_name", 
"/opt/kamailio-trunk-ka/var/run/kamailio_jsonrpc.fifo")
# - ctl -


# - keepalive -
modparam("keepalive", "ping_interval", 10)

# - drouting -
modparam("drouting", 

[SR-Users] Fw: kamcli doesn't function

2017-03-27 Thread Marko Tirs
Hi Daniel,no, I haven't changed anything in kamcli.ini, it seems to be the same 
like this one behind your link.I'm running both kamailio and kamcli as root.Any 
other ideas for running of kamcli?
RegardsMarko
Last part of my kamcli.ini:
### jsonrpc settings
[jsonrpc]
; transport - can be: fifo, socket
transport=socket
; path - where kamailio is listening for JSONRPC FIFO commands
path=/var/run/kamailio/kamailio_rpc.fifo
rplnamebase=kamailio_rpc_reply.fifo
rpldir=/tmp
; srvaddr - where kamailio is listening for JSONRPC socket commands
;   - it has to be a path to unix socket file or udp:ipaddr:port
srvaddr=/var/run/kamailio/kamailio_rpc.sock
; rcvaddr - where kamclie is listening for the JSONRPC responses
;   - it has to be a path to unix socket file or udp:ipaddr:port
;   - pid of kamcli is added at the end to allow multiple use at same time
rcvaddr=/var/run/kamailio/kamailio_rpc.sock
; outformat - how RPC result is printed, can be: json or yaml
; - yaml is more compact output
outformat=yaml



 
- Forwarded Message -
 From: Daniel-Constantin Mierla 
 To: Marko Tirs ; Kamailio (SER) - Users Mailing List 
 
 Sent: Monday, March 27, 2017 2:18 PM
 Subject: Re: [SR-Users] kamcli doesn't function
   
 Hello, have you changed the rpldir in any way for kamcli? 
https://github.com/kamailio/kamcli/blob/master/kamcli/kamcli.ini#L43 Cheers,
 Daniel
  
 On 24/03/2017 00:10, Marko Tirs wrote:
  
  Hi Daniel, 
  Kamailio is running as root. How to solve the socket problem? 
  Regards Marko 
 
From: Daniel-Constantin Mierla 
 To: Marko Tirs ; Kamailio (SER) - Users Mailing List 
 
 Sent: Thursday, March 23, 2017 1:46 PM
 Subject: Re: [SR-Users] kamcli doesn't function
  
 Hello,
 
 kamcli is creating its own (temporary) socket file in order to retrieve the 
response from kamailio. I guess there is a problem with access rights to it. Is 
kamailio running as root or other user?
 
 Cheers,
 Daniel
 
 March 22, 2017 3:53 PM, "Marko Tirs"  wrote:
 
 > Hello all,
 > 
 > I can't find any answer why my kamcli doesn't function.
 > 
 > I'm using Kamailio 5.0.0 at the Debian Jessy 8.7 and it functions well.
 > 
 > # kamctl ul show
 > 
 > functions well but when I use kamcli I get error:
 > 
 > # kamcli ul show
 > 13(7452) ERROR: jsonrpcs [jsonrpcs_sock.c:542]: jsonrpc_dgram_send_data(): 
 > failed to send the
 > response - ret: -1, len: 2443 (131072), err: 1 - Operation not permitted)
 > (log): Timeout receiving response on unix sock
 > 
 > The relevant parts of kamailio.cfg:
 > 
 >#
 > 
 > #!define WITH_DEBUG
 > #!define WITH_NAT
 > #!define WITH_MYSQL
 > #!define WITH_AUTH
 > #!define WITH_USRLOCDB
 > 
 > loadmodule "jsonrpcs.so"
 > 
 > # - jsonrpcs params -
 > modparam("jsonrpcs", "pretty_format", 1)
 > /* set the path to RPC fifo control file */
 > modparam("jsonrpcs", "fifo_name", "/var/run/kamailio/kamailio_rpc.fifo")
 > /* set the path to RPC unix socket control file */
 > modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio/kamailio_rpc.sock")
 > 
 > # - ctl params -
 > modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
 >#--
 > 
 > # ll /var/run/kamailio/
 > total 0
 > srw--- 1 root root 0 Mar 22 11:36 kamailio_ctl
 > prw-rw 1 root root 0 Mar 22 12:30 kamailio_rpc.fifo
 > srw-rw 1 root root 0 Mar 22 11:36 kamailio_rpc.sock
 > 
 > Can somebody tell me what is the problem?
 > 
 > Thank you!
 > Regards
 > Marko 
 > 
 > ___
 > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
 > sr-users@lists.sip-router.org
 > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
 
 --
 Daniel-Constantin Mierla
 www.kamailio.org -- www.asipto.com 
 
  
  
 ___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
 
 
 -- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - 
www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com 

   ___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio 4.4.1 crash on bad sip response

2017-03-27 Thread Daniel-Constantin Mierla
Hello,

did it happen only once, or it can be reproduced?

Can you also get from gdb:

frame 6

p *name

p *port

Cheers,
Daniel


On 27/03/2017 16:43, David Escartín Almudévar wrote:
> hello Daniel
>
> here you have
>
> (gdb) frame 1
> #1  0x0045b472 in _dns_hash_find (name=0x7f6906943188, type=1,
> h=0x7fff120793cc, err=0x7fff120793ac) at dns_cache.c:535
> 535 *h=dns_hash_no(name->s, name->len, type);
> (gdb) info locals
> e = 0x7f69069015b8
> tmp = 0x7f69069247e0
> ret = 0x0
> now = 689922868
> cname_chain = 0
> cname = {s = 0xab0e93 "Via: SIP/2.0/UDP \020?\337\v\234\262\264\016
> :5080;received=;rport=5080;branch=\020?\337\v\234\262\264\016
> \r\nContent-Length: 0\r\n\r\n", len = 11210375}
> __FUNCTION__ = "_dns_hash_find"
> (gdb) list
> 530 cname_chain=0;
> 531 ret=0;
> 532 now=get_ticks_raw();
> 533 *err=0;
> 534 again:
> 535 *h=dns_hash_no(name->s, name->len, type);
> 536 #ifdef DNS_CACHE_DEBUG
> 537 LM_DBG("(%.*s(%d), %d), h=%d\n", name->len, name->s, name->len,
> type, *h);
> 538 #endif
> 539 clist_foreach_safe(_hash[*h], e, tmp, next){
>
>
>
> thanks a lot and regards
> david
>
>
>
>
> El lun, 27-03-2017 a las 13:54 +0200, Daniel-Constantin Mierla escribió:
>> Hello,
>>
>> the backtrace is no longer matching the 4.4 branch code, as you run
>> an older release in that series.
>>
>> Can you get with gdb from the core the output of the following commands:
>>
>> frame 1
>>
>> info locals
>>
>> list
>>
>>
>> and send them here on the mailing list.
>>
>> Cheers,
>> Daniel
>>
>> On 24/03/2017 14:50, David Escartín Almudévar wrote:
>>
>>> hello all, Daniel
>>>
>>> checking the core with the gdb, we have checked the variables at the
>>> frames of the backtrace, to try to get the full sip message seems it
>>> seemed truncated.
>>> checking the buf variable of the frame 11 which theorically contains
>>> the sip msg to parse we have the string
>>>
>>>
>>> SIP/2.0 487 Request Terminated\r\nFrom:
>>> \"881237046977\";tag=B7jgc8jQ4m5pB\r\nTo:
>>> ;tag=e0d50be-13c4-58d47cba-a2ed9808-36fa\r\nl\337K\016\213\347:
>>> \344\003\r\nCSeq: 104824272 INVITE\r\nVia: SIP/2.0/UDP
>>> L\263\264\016\020?\337\v\234\262\264\016 ;branch=\327\f\340\r\nVia:
>>> SIP/2.0/UDP \020?\337\v\234\262\264\016
>>> :5080;received=;rport=5080;branch=\020?\337\v\234\262\264\016
>>> \r\nContent-Length: 0\r\n\r\n
>>>
>>> this is i guess how gdb parses the message, so i guess i cannot
>>> introduce this like that in a xml sipp formal, since CRLF is
>>> represented as \r\n, so others parts like l\337K\016\213\347:
>>> \344\003 i have no idea what they are, because they also seem to be
>>> out of the ASCII table ¿?
>>> anycase, seems the message is very bad formed, and the kamailio
>>> tries to resolve the host of the Via and it gets nothing, so the
>>> function get_hash1_case_raw is fed by a nul value and seems that the
>>> reason it crashes
>>>
>>> hope you can retrieve information from that message to find out what
>>> kind of message it exactly is and see if it's possible to avoid
>>> kamailio's crash in this scenario
>>>
>>>
>>> best regards
>>> david
>>>
>>>
>>>
>>> El vie, 24-03-2017 a las 12:10 +0100, David Escartín Almudévar escribió:
 hello all

 we have experienced a crash and tracing the logs and the core,
 seems it was because a sip response from an endpoint.
 a UDP receiver (26248) crashed and the last message we see on it is
 a 487 quite bad formed

 Mar 24 01:58:02 mia-proxy-inout-1-stby
 /usr/local/kamailio/sbin/kamailio[26248]: ERROR: tm
 [t_lookup.c:1055]: t_check_msg(): ERROR: reply doesn't have a via,
 cseq or call-id header
 Mar 24 01:58:17 mia-proxy-inout-1-stby
 /usr/local/kamailio/sbin/kamailio[26230]: ALERT: 
 [main.c:739]: handle_sigs(): child process 26248 exited by a signal 11


 the backtrace of the core
 (gdb) backtrace
 #0  0x00457ab9 in get_hash1_case_raw (s=0x0, len=0) at
 hashes.h:210
 #1  0x0045b472 in _dns_hash_find (name=0x7f6906943188,
 type=1, h=0x7fff120793cc, err=0x7fff120793ac) at dns_cache.c:535
 #2  0x00461285 in dns_hash_get (name=0x7f6906943188,
 type=1, h=0x7fff120793cc, err=0x7fff120793ac) at dns_cache.c:762
 #3  0x00467194 in dns_get_entry (name=0x7f6906943188,
 type=1) at dns_cache.c:2102
 #4  0x00468a05 in dns_a_get_he (name=0x7f6906943188) at
 dns_cache.c:2432
 #5  0x00468bb9 in dns_get_he (name=0x7f6906943188, flags=1)
 at dns_cache.c:2505
 #6  0x004696c4 in dns_srv_sip_resolvehost
 (name=0x7f6906943188, port=0x7fff120795e2, proto=0x7fff120795e1
 "\001\330\023") at dns_cache.c:2679
 #7  0x0046aa37 in dns_sip_resolvehost (name=0x7f6906943188,
 port=0x7fff120795e2, proto=0x7fff120795e1 "\001\330\023") at
 dns_cache.c:2849
 #8  0x0049519e in update_sock_struct_from_via
 (to=0x7fff12079708, 

[SR-Users] Kamailio Registration load Issue

2017-03-27 Thread Jade SZ
Hi Guys,

I am running a simple REGISTER load test on:

1) Kamailio sever with 2 cores - mem 5G
2) Kamailio server with 4 cores - mem 16G

Both are EC2 instances.

At -r = 500 i.e. 500 reg/sec sipP test works fine with very few re-trans.
But when i increase it to 800 reg/sec it starts retransmissions in bulk.

I don't see server's CPU, load-avg or memory shooting. Running everything
by default, even using kamctl to start the instance. So I have not tuned
any params yet.

My main concern is how can I make server choke and get its actual capacity,
and avoid these retransmissions as apparently kamailio is not even
utilizing 2 cores and CPU usage is under 10 always.

Results of both server is same i.e. 500 reg/sec max so I am sure there is
some problem that needs a fix, but need some hints here.

Also used multiple SIPp's to rule out if it is SIPp issue, but after 500 I
see same problem.


Regards,
JSZ
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio Registration load Issue

2017-03-27 Thread Alex Balashov
You might be running into semi-invisible/not widely publicised (but definitely 
very real) PPS limits on given instance sizes. 

On March 27, 2017 3:09:56 PM EDT, Jade SZ  wrote:
>Hi Guys,
>
>I am running a simple REGISTER load test on:
>
>1) Kamailio sever with 2 cores - mem 5G
>2) Kamailio server with 4 cores - mem 16G
>
>Both are EC2 instances.
>
>At -r = 500 i.e. 500 reg/sec sipP test works fine with very few
>re-trans.
>But when i increase it to 800 reg/sec it starts retransmissions in
>bulk.
>
>I don't see server's CPU, load-avg or memory shooting. Running
>everything
>by default, even using kamctl to start the instance. So I have not
>tuned
>any params yet.
>
>My main concern is how can I make server choke and get its actual
>capacity,
>and avoid these retransmissions as apparently kamailio is not even
>utilizing 2 cores and CPU usage is under 10 always.
>
>Results of both server is same i.e. 500 reg/sec max so I am sure there
>is
>some problem that needs a fix, but need some hints here.
>
>Also used multiple SIPp's to rule out if it is SIPp issue, but after
>500 I
>see same problem.
>
>
>Regards,
>JSZ


-- Alex

--
Principal, Evariste Systems LLC (www.evaristesys.com)

Sent from my Google Nexus.

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] wiresharking TLS problem

2017-03-27 Thread Daniel-Constantin Mierla
Hello,

do you want to see the traffic from devices or want to use for
troubleshooting some app? If the second, then it might be easier to just
set the NULL encryption algorithm. Some tips and tricks to debug TLS
connections are collected at:

  - https://www.kamailio.org/wiki/tutorials/tls/testing-and-debugging

Cheers,
Daniel


On 27/03/2017 05:08, Rex Lin (林昱頡) wrote:
>
> Hi Max,
>
>  
>
> No Diffie Hellman confirmed, we use RSA cipher instead.
>
> I found that the problem was the TLS version;
>
> I could see nothing while the TLS.cfg method was configured as version
> 1.2, but it's okay now after switched to version 1.0, but version 1.0
> is an obsolete choice so I would rather the v1.2 if possible.
>
> Much appreciate if anyone could help with this question.
>
>  
>
> Best Regards,
>
> Rex Lin
>
>  
>
> *From:*sr-users [mailto:sr-users-boun...@lists.sip-router.org] *On
> Behalf Of *Max Muhlbronner
> *Sent:* Monday, March 20, 2017 4:34 PM
> *To:* sr-users@lists.sip-router.org
> *Subject:* Re: [SR-Users] wiresharking TLS problem
>
>  
>
> Hi,
>
>
> http://wiki.snom.com/FAQ/How_to_decode_TLS_calls_using_wireshark
>
>
> Additionally you need make sure to not use a DH enumeral cipher
> (client/server) if you want to decrypt the SIP TLS traffic.
>
>
>
> BR
>
> Max M.
>
> On 20.03.2017 09:04, Rex Lin (林昱頡) wrote:
>
> hi all
>
>  
>
> wondering if any of you has the experience of TLS decrypting,
>
> SIP client has problem while calling each other, but we are using
> TLS for communication protocol.facing problem debugging it.
>
>  
>
> Best Regards,
>
> Rex Lin
>
>  
>
>  
>
>
>
>
> ___
>
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
> list
>
> sr-users@lists.sip-router.org 
>
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - 
www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] RPCFIFOPATH / DEFINE_FIFO_NAME settings problem

2017-03-27 Thread Daniel-Constantin Mierla
Hello,

kamailio should attempt to create the /var/run/kamailio folder if the
application is run with enough privileges. However, some operating
systems add more constraints on top of the execution user.

What is your OS distro? Do you have selinux, apparmor or other similar
tools enabled?

Cheers,
Daniel


On 24/03/2017 17:52, Ginhoux, Patrick wrote:
>
> In my ‘kamctlrc’ file :
>
>  
>
> ## path to FIFO file for engine RPCFIFO
>
> RPCFIFOPATH="/var/run/kamailio/kamailio_rpc_fifo"
>
> #RPCFIFOPATH="/tmp/kamailio_rpc_fifo"
>
>  
>
> In my ‘kamailio.cfg’ :
>
>  
>
> !!ifndef DEFINE_FIFO_NAME
>
> !!define DEFINE_FIFO_NAME "/var/run/kamailio/kamailio_rpc_fifo"
>
> !!endif  
>
>  
>
>  
>
> modparam("jsonrpcs", "pretty_format", 1)
>
> modparam("jsonrpcs", "transport", 2)
>
> modparam("jsonrpcs", "fifo_name", DEFINE_FIFO_NAME)
>
> modparam("jsonrpcs", "fifo_mode", 0755)
>
> modparam("jsonrpcs", "fifo_group", "kamailio")
>
> modparam("jsonrpcs", "fifo_user", "kamailio")
>
>  
>
>  
>
> kamailio doesn’t start. It reports ‘Permission denied’ :
>
>  
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1138]: ERROR: jsonrpcs
> [jsonrpcs_fifo.c:144]: jsonrpc_init_fifo_server(): Can't create FIFO:
> Permission denied (mode=493)
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1138]: CRITICAL: jsonrpcs
> [jsonrpcs_fifo.c:489]: jsonrpc_fifo_process(): failed to init jsonrpc
> fifo server
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: ALERT: 
> [main.c:741]: handle_sigs(): child process 1138 exited normally,
> status=255
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1130]: DEBUG: 
> [core/sr_module.c:920]: init_mod_child(): rank 4: tm
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1137]: DEBUG: 
> [core/sr_module.c:920]: init_mod_child(): rank -1: tm
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1127]: DEBUG: htable
> [htable.c:226]: child_init(): rank is (1)
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: INFO: 
> [main.c:759]: handle_sigs(): terminating due to SIGCHLD
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1139]: DEBUG: 
> [core/sr_module.c:920]: init_mod_child(): rank -2: kex
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1130]: DEBUG: tm
> [callid.c:137]: child_init_callid(): callid:
> '15b1f0d63a718465-1130@129.227.83.108'
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1137]: DEBUG: tm
> [callid.c:137]: child_init_callid(): callid:
> '15b1f0d63a718465-1137@129.227.83.108'
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1127]: DEBUG: 
> [core/action.c:1656]: run_child_one_init_route(): attempting to run
> event_route[core:worker-one-init]
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1136]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1135]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1134]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1133]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1132]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1131]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1129]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1128]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: ERROR: ctl
> [ctl.c:387]: mod_destroy(): ERROR: ctl: could not delete unix socket
> /var/run/kamailio//kamailio_ctl: Permission denied (13)
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: ERROR: jsonrpcs
> [jsonrpcs_fifo.c:595]: jsonrpc_fifo_destroy(): FIFO stat failed:
> Permission denied
>
>  
>
> If I replace the values in the 2 files as appropriate :
>
>  
>
> In the ‘kamctlrc” toRPCFIFOPATH="/tmp/kamailio_rpc_fifo"
>
>  
>
> In the ‘kamailio.cfg” to!!define DEFINE_FIFO_NAME "/tmp/kamailio_rpc_fifo"
>
>  
>
> Then kamailo starts :
>
>  
>
> [root@vm-vse02-siprouter1 ~]# ps -ef |grep kam
>
> kamailio  1235 1  0 17:37 ?00:00:00 /usr/sbin/kamailio -P
> /var/run/kamailio.pid -m 1024 -M 8 -u kamailio -g kamailio
>
> kamailio  1236  1235  0 17:37 ?00:00:00 /usr/sbin/kamailio -P
> /var/run/kamailio.pid -m 1024 -M 8 -u kamailio -g kamailio
>
> kamailio  1237  1235  0 17:37 ?00:00:00 /usr/sbin/kamailio -P
> /var/run/kamailio.pid -m 1024 -M 8 -u kamailio -g kamailio
>
> kamailio  1238  1235  0 17:37 ?00:00:00 /usr/sbin/kamailio -P
> /var/run/kamailio.pid -m 1024 -M 8 -u kamailio -g kamailio
>
> kamailio  1239  1235  0 17:37 ?00:00:00 /usr/sbin/kamailio -P
> /var/run/kamailio.pid -m 1024 -M 8 -u kamailio -g kamailio
>
> kamailio  1240  1235  0 17:37 ?00:00:00 /usr/sbin/kamailio -P
> /var/run/kamailio.pid -m 1024 -M 8 -u kamailio -g kamailio
>
> kamailio  1241  1235  0 17:37 ?

Re: [SR-Users] Module cnxcc

2017-03-27 Thread Daniel-Constantin Mierla
Hello,


On 25/03/2017 21:32, m9rt8ii wrote:
> Please can anybody give me basic steps how to set up cnxcc module on kamailio
> 4.4 ?
> I will be very very grateful.
> http://kamailio.org/docs/modules/4.4.x/modules/cnxcc.html

maybe the presentation from the author of the module at Kamailio World
Conference 2014 is going to help you a bit:

  -
https://www.kamailio.org/events/2014-KamailioWorld/day0/w3-Carlos.Ruiz.Diaz-Prepaid-cnxcc.pdf

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - 
www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Cannot yum download from download.opensuse.org, no mirrors

2017-03-27 Thread Daniel-Constantin Mierla
Hello,


On 23/03/2017 18:22, Shadowy Man wrote:
> This is only happening for one particular block of IP's.  I can download 
> from other blocks.
>
> I suspect it is being done on the download.opensuse.org end for some 
> reason.  It appears to be the entire xx.xx block of which I only use a 
> few addresses from.
>
> I will probably have to try contact them about it.  What I would like to 
> ask is why Kamailio does not have any mirrors?  If there were then this 
> would not be a problem.  It would just failover.
>
we do not control in any way what download.opensuse.org is blocking or
not, it could have been some attack from your region and a large range
of networks from area was blocked. You should contact them directly to
sort out this.

Regarding the mirror, I tried to do it for a while, but lack of time
didn't allow me to continue.

If someone ships me a script that downloads from opensuse build service
the new packages on all distros and builds a local rpm/yum repo, then we
can run it on rpm.kamailio.org . In the past I used to just download
everything, but that takes a lot of time and bandwidth, because fetches
also the old releases.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio 4.4.1 crash on bad sip response

2017-03-27 Thread Daniel-Constantin Mierla
Hello,

the backtrace is no longer matching the 4.4 branch code, as you run an
older release in that series.

Can you get with gdb from the core the output of the following commands:

frame 1

info locals

list

and send them here on the mailing list.

Cheers,
Daniel

On 24/03/2017 14:50, David Escartín Almudévar wrote:
> hello all, Daniel
>
> checking the core with the gdb, we have checked the variables at the
> frames of the backtrace, to try to get the full sip message seems it
> seemed truncated.
> checking the buf variable of the frame 11 which theorically contains
> the sip msg to parse we have the string
>
>
> SIP/2.0 487 Request Terminated\r\nFrom:
> \"881237046977\";tag=B7jgc8jQ4m5pB\r\nTo:
> ;tag=e0d50be-13c4-58d47cba-a2ed9808-36fa\r\nl\337K\016\213\347:
> \344\003\r\nCSeq: 104824272 INVITE\r\nVia: SIP/2.0/UDP
> L\263\264\016\020?\337\v\234\262\264\016 ;branch=\327\f\340\r\nVia:
> SIP/2.0/UDP \020?\337\v\234\262\264\016
> :5080;received=;rport=5080;branch=\020?\337\v\234\262\264\016
> \r\nContent-Length: 0\r\n\r\n
>
> this is i guess how gdb parses the message, so i guess i cannot
> introduce this like that in a xml sipp formal, since CRLF is
> represented as \r\n, so others parts like l\337K\016\213\347: \344\003
> i have no idea what they are, because they also seem to be out of the
> ASCII table ¿?
> anycase, seems the message is very bad formed, and the kamailio tries
> to resolve the host of the Via and it gets nothing, so the function
> get_hash1_case_raw is fed by a nul value and seems that the reason it
> crashes
>
> hope you can retrieve information from that message to find out what
> kind of message it exactly is and see if it's possible to avoid
> kamailio's crash in this scenario
>
>
> best regards
> david
>
>
>
> El vie, 24-03-2017 a las 12:10 +0100, David Escartín Almudévar escribió:
>> hello all
>>
>> we have experienced a crash and tracing the logs and the core, seems
>> it was because a sip response from an endpoint.
>> a UDP receiver (26248) crashed and the last message we see on it is a
>> 487 quite bad formed
>>
>> Mar 24 01:58:02 mia-proxy-inout-1-stby
>> /usr/local/kamailio/sbin/kamailio[26248]: ERROR: tm
>> [t_lookup.c:1055]: t_check_msg(): ERROR: reply doesn't have a via,
>> cseq or call-id header
>> Mar 24 01:58:17 mia-proxy-inout-1-stby
>> /usr/local/kamailio/sbin/kamailio[26230]: ALERT:  [main.c:739]:
>> handle_sigs(): child process 26248 exited by a signal 11
>>
>>
>> the backtrace of the core
>> (gdb) backtrace
>> #0  0x00457ab9 in get_hash1_case_raw (s=0x0, len=0) at
>> hashes.h:210
>> #1  0x0045b472 in _dns_hash_find (name=0x7f6906943188,
>> type=1, h=0x7fff120793cc, err=0x7fff120793ac) at dns_cache.c:535
>> #2  0x00461285 in dns_hash_get (name=0x7f6906943188, type=1,
>> h=0x7fff120793cc, err=0x7fff120793ac) at dns_cache.c:762
>> #3  0x00467194 in dns_get_entry (name=0x7f6906943188, type=1)
>> at dns_cache.c:2102
>> #4  0x00468a05 in dns_a_get_he (name=0x7f6906943188) at
>> dns_cache.c:2432
>> #5  0x00468bb9 in dns_get_he (name=0x7f6906943188, flags=1)
>> at dns_cache.c:2505
>> #6  0x004696c4 in dns_srv_sip_resolvehost
>> (name=0x7f6906943188, port=0x7fff120795e2, proto=0x7fff120795e1
>> "\001\330\023") at dns_cache.c:2679
>> #7  0x0046aa37 in dns_sip_resolvehost (name=0x7f6906943188,
>> port=0x7fff120795e2, proto=0x7fff120795e1 "\001\330\023") at
>> dns_cache.c:2849
>> #8  0x0049519e in update_sock_struct_from_via
>> (to=0x7fff12079708, msg=0x7f69069a1dd8, via=0x7f69068f82a8) at
>> forward.c:704
>> #9  0x00495ee5 in do_forward_reply (msg=0x7f69069a1dd8,
>> mode=0) at forward.c:766
>> #10 0x004970af in forward_reply (msg=0x7f69069a1dd8) at
>> forward.c:849
>> #11 0x005197ef in receive_msg (
>> buf=0xab0d80 "SIP/2.0 487 Request Terminated\r\nFrom:
>> \"88\";tag=B7jgc8jQ4m5pB\r\nTo:
>> ;tag=e0d50be-13c4-58d47cba-a2ed9808-36fa\r\nl\337K\016"...,
>> len=367, rcv_info=0x7fff12079a10) at receive.c:299
>> #12 0x00627b43 in udp_rcv_loop () at udp_server.c:495
>> #13 0x004b107a in main_loop () at main.c:1600
>> #14 0x004b842f in main (argc=13, argv=0x7fff12079fb8) at
>> main.c:2616
>>
>>
>> i have tried to duplicate the issue, but i dont know how to translate
>> l\337K\016 to a xml notation
>> i guess this is some weird that cannot be processed for kamailio
>>
>> could you please take a look and let me know if you know how to
>> duplicate and fix this crash?
>>
>> thanks a lot and regards
>> david
>
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda

Re: [SR-Users] Presence + RLS + XCAP

2017-03-27 Thread Daniel-Constantin Mierla
Hello,

I haven't used snom with rls and xcap, however, my working configs with
xcap and based on the config snippet presented at:

  - http://lists.sip-router.org/pipermail/sr-users/2013-October/079988.html

If you are not familiar with, be aware that XCAP should be over http(s).

Should you be still stuck on something related to this topic, let us
know if you already used a config like the one linked above, to follow
up more on this.

Cheers,
Daniel


On 23/03/2017 14:04, Paul Smith wrote:
> Hi
>  I am struggling to figure out how to build and test an integrated
> presence server with Resource-List (rls.so) and XCAP (xcap_server.so).
>
> I am confused about what is meant to happen and how to debug it.  Not
> sure if I am suffering from incompatibilities, configuration errors,
> or bugs…
>
> I have not found an up to date guide on configuring an integrated
> presence, rls, xcap server so I have used old tutorials, module
> documentation and some course code review … but I’m pretty confused now!
>
> I am using Snom phones and Jitsi (on Mac) to test.
>
> I have a kamailio Registrar which proxies all presence messages to the
> separate kamailio 4.2 Presence server.
>
> REQUIREMENT : Contact Presence
> =
> I would like to get a SUBSCRIBE from the Snom phone to subscribe to a
> contact-list resource list, and to receive a NOTIFY with all of the
> presence states for those contacts.  
>
> Relevant snom settings?
> Contact List URI:  this generates a SUBSCRIBE with event:presence 
>
>
> I believe that:
> ==
> presence module should be managing the individual user presence and
> dialog states
> xcap module should allow me to use HTTP / curl to edit the resource lists
> rls module should be managing the mapping from a resource list
> subscription to the individual presence states and generating the
> aggregated NOTIFY messages.
> each device should then be able to SUBSCRIBE to a resource list uri
> and then receive an aggregated NOTIFY for all of the watched entities.
>
>
> Current status:
> ===
>
> SUBSCRIBE sip:org1a-contacts@*.co.uk SIP/2.0
> v: SIP/2.0/UDP 192.168.1.15:59594;branch=z9hG4bK-qllzlgs3xf43;rport
> f: ;tag=wwasqc6lmb
> t: 
> i: 313439303236383530323234313530-x3hlb3j6b5ef
> CSeq: 1 SUBSCRIBE
> Max-Forwards: 70
> User-Agent: snomD375/8.9.3.46
> m: ;reg-id=1
> Event: presence
> Accept: application/pidf+xml, application/rlmi+xml, multipart/related
> Supported: eventlist
> Expires: 3600
> l: 0
>
>
>
> … auth handshake
>
> SIP/2.0 202 OK
> Record-Route: 
> Record-Route: 
> v: SIP/2.0/UDP
> 
> 192.168.1.15:59594;received=**recvip**;branch=z9hG4bK-8wufiv1ua3ne;rport=60554
> f: ;tag=wwasqc6lmb
> t:
> ;tag=a6a1c5f60faecf035a1ae5b6e96e979a-d30e
> i: 313439303236383530323234313530-x3hlb3j6b5ef
> CSeq: 2 SUBSCRIBE
> Expires: 3600
> Contact: 
> Server: kamailio (4.2.0 (x86_64/linux))
> Content-Length: 0
>
>
>
> … and then the snom receives an empty NOTIFY.
>
> NOTIFY sip:org1a@192.168.1.15:58325 SIP/2.0
> Via: SIP/2.0/UDP
> 109.104.108.18;branch=z9hG4bKc54a.20db45097fb44595ccd5a30827ca2a62.0
> Via: SIP/2.0/UDP
> 
> 10.210.160.16;rport=5060;branch=z9hG4bKc54a.40150886.0
> To: ;tag=sx4ne9jpcl
> From:
> ;tag=a6a1c5f60faecf035a1ae5b6e96e979a-ed89
> CSeq: 2 NOTIFY
> Call-ID: 313439303237323938323235353133-2du221e6okvf
> Content-Length: 0
> User-Agent: kamailio (4.2.0 (x86_64/linux))
> Max-Forwards: 69
> Event: presence
> Contact:
>  >
> Subscription-State: active;expires=3600
>
>
>
> The Subscription is showing up in the watchers table, not the
> rls_watchers table, so I believe it is being rejected by the
> rls_handle_subscribe() and then parsed by the presence module.  *Is
> that correct?*
>
> There is noting in rls_watchers or rls_presentity tables.  *Should
> there be?*
>
> I have a rows in the XCAP table for the Resource-List
>
> curl -d @/tmp/contacts-resource-list.xml -vvv -X PUT
> 
> http://109.104.108.23:5060/xcap-root/resource-lists/users/sip:org1a-conta...@hpbx449vb531.sip.byphone.co.uk/index
>
> relevant row in xcap table:
>
> |  3 | org1a-contacts | *.co.uk  |  version="1.0" encoding="UTF-8" standalone="no"?> xmlns="urn:ietf:params:xml:ns:resource-lists"> name="team">http://co.uk>"/>http://co.uk>">bob uri="sip:1003@.co.uk
> 

Re: [SR-Users] kamcli doesn't function

2017-03-27 Thread Daniel-Constantin Mierla
Hello,

have you changed the rpldir in any way for kamcli?

https://github.com/kamailio/kamcli/blob/master/kamcli/kamcli.ini#L43

Cheers,
Daniel


On 24/03/2017 00:10, Marko Tirs wrote:
> Hi Daniel,
>
> Kamailio is running as root.
> How to solve the socket problem?
>
> Regards
> Marko
>
>
> 
> *From:* Daniel-Constantin Mierla 
> *To:* Marko Tirs ; Kamailio (SER) - Users
> Mailing List 
> *Sent:* Thursday, March 23, 2017 1:46 PM
> *Subject:* Re: [SR-Users] kamcli doesn't function
>
> Hello,
>
> kamcli is creating its own (temporary) socket file in order to
> retrieve the response from kamailio. I guess there is a problem with
> access rights to it. Is kamailio running as root or other user?
>
> Cheers,
> Daniel
>
> March 22, 2017 3:53 PM, "Marko Tirs"  > wrote:
>
> > Hello all,
> >
> > I can't find any answer why my kamcli doesn't function.
> >
> > I'm using Kamailio 5.0.0 at the Debian Jessy 8.7 and it functions well.
> >
> > # kamctl ul show
> >
> > functions well but when I use kamcli I get error:
> >
> > # kamcli ul show
> > 13(7452) ERROR: jsonrpcs [jsonrpcs_sock.c:542]:
> jsonrpc_dgram_send_data(): failed to send the
> > response - ret: -1, len: 2443 (131072), err: 1 - Operation not
> permitted)
> > (log): Timeout receiving response on unix sock
> >
> > The relevant parts of kamailio.cfg:
> >
> >
> #
> >
> > #!define WITH_DEBUG
> > #!define WITH_NAT
> > #!define WITH_MYSQL
> > #!define WITH_AUTH
> > #!define WITH_USRLOCDB
> >
> > loadmodule "jsonrpcs.so"
> >
> > # - jsonrpcs params -
> > modparam("jsonrpcs", "pretty_format", 1)
> > /* set the path to RPC fifo control file */
> > modparam("jsonrpcs", "fifo_name", "/var/run/kamailio/kamailio_rpc.fifo")
> > /* set the path to RPC unix socket control file */
> > modparam("jsonrpcs", "dgram_socket",
> "/var/run/kamailio/kamailio_rpc.sock")
> >
> > # - ctl params -
> > modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
> >
> #--
> >
> > # ll /var/run/kamailio/
> > total 0
> > srw--- 1 root root 0 Mar 22 11:36 kamailio_ctl
> > prw-rw 1 root root 0 Mar 22 12:30 kamailio_rpc.fifo
> > srw-rw 1 root root 0 Mar 22 11:36 kamailio_rpc.sock
> >
> > Can somebody tell me what is the problem?
> >
> > Thank you!
> > Regards
> > Marko
>
> >
> > ___
> > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> > sr-users@lists.sip-router.org 
> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla
> www.kamailio.org -- www.asipto.com
>
>
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - 
www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio Registration load Issue

2017-03-27 Thread Alex Balashov
On Tue, Mar 28, 2017 at 12:52:32AM +0500, Jade SZ wrote:

> PS: Also thanks a lot for the great blog post on SIP server tuning.

You're very welcome. Glad it proved useful to someone!

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Presence + RLS + XCAP

2017-03-27 Thread Paul Smith
Hi Daniel,
Thanks for the response and link.  My config is broadly similar.

Presence is working over SIP (e.g. I can SUBSCRIBE and revive NOTIFY messages 
from the Kamailio Presence server)
and XCAP is working over HTTP (e.g I can GET, edit and PUT rls-service and 
resource-list documents into the XCAP table using curl over HTTP)

I don’t understand what the rls.so module is doing or how to debug.  I expect 
to PUT an resource-list document over the XCAP HTTP interface and then 
SUBSCRIBE to an eventlist over SIP…. at present I cannot SUBSCRIBE to the 
resource-list.  Any calls to rls_handle_subscribe() are getting the failure 
value back.

Any pointers on how to debug, or have I fundamentally misunderstood something?

Thanks

  

> On 27 Mar 2017, at 13:02, Daniel-Constantin Mierla  wrote:
> 
> Hello,
> 
> I haven't used snom with rls and xcap, however, my working configs with xcap 
> and based on the config snippet presented at:
> 
>   - http://lists.sip-router.org/pipermail/sr-users/2013-October/079988.html 
> 
> If you are not familiar with, be aware that XCAP should be over http(s).
> 
> Should you be still stuck on something related to this topic, let us know if 
> you already used a config like the one linked above, to follow up more on 
> this.
> 
> Cheers,
> Daniel
> 
> On 23/03/2017 14:04, Paul Smith wrote:
>> Hi
>>  I am struggling to figure out how to build and test an integrated presence 
>> server with Resource-List (rls.so) and XCAP (xcap_server.so).
>> 
>> I am confused about what is meant to happen and how to debug it.  Not sure 
>> if I am suffering from incompatibilities, configuration errors, or bugs…
>> 
>> I have not found an up to date guide on configuring an integrated presence, 
>> rls, xcap server so I have used old tutorials, module documentation and some 
>> course code review … but I’m pretty confused now!
>> 
>> I am using Snom phones and Jitsi (on Mac) to test.
>> 
>> I have a kamailio Registrar which proxies all presence messages to the 
>> separate kamailio 4.2 Presence server.
>> 
>> REQUIREMENT : Contact Presence
>> =
>> I would like to get a SUBSCRIBE from the Snom phone to subscribe to a 
>> contact-list resource list, and to receive a NOTIFY with all of the presence 
>> states for those contacts.  
>> 
>> Relevant snom settings?
>>  Contact List URI:  this generates a SUBSCRIBE with event:presence 
>> 
>> 
>> I believe that:
>> ==
>> presence module should be managing the individual user presence and dialog 
>> states
>> xcap module should allow me to use HTTP / curl to edit the resource lists
>> rls module should be managing the mapping from a resource list subscription 
>> to the individual presence states and generating the aggregated NOTIFY 
>> messages.
>> each device should then be able to SUBSCRIBE to a resource list uri and then 
>> receive an aggregated NOTIFY for all of the watched entities.
>> 
>> 
>> Current status:
>> ===
>> 
>> SUBSCRIBE sip:org1a-contacts@*.co.uk  
>> SIP/2.0
>> v: SIP/2.0/UDP 192.168.1.15:59594;branch=z9hG4bK-qllzlgs3xf43;rport
>> f: >;tag=wwasqc6lmb
>> t: >
>> i: 313439303236383530323234313530-x3hlb3j6b5ef
>> CSeq: 1 SUBSCRIBE
>> Max-Forwards: 70
>> User-Agent: snomD375/8.9.3.46
>> m: >;reg-id=1
>> Event: presence
>> Accept: application/pidf+xml, application/rlmi+xml, multipart/related
>> Supported: eventlist
>> Expires: 3600
>> l: 0
>> 
>> 
>>  … auth handshake
>> 
>>  
>> SIP/2.0 202 OK
>> Record-Route: > >
>> Record-Route: > >
>> v: SIP/2.0/UDP 
>> 192.168.1.15:59594;received=**recvip**;branch=z9hG4bK-8wufiv1ua3ne;rport=60554
>> f: >;tag=wwasqc6lmb
>> t: > >;tag=a6a1c5f60faecf035a1ae5b6e96e979a-d30e
>> i: 313439303236383530323234313530-x3hlb3j6b5ef
>> CSeq: 2 SUBSCRIBE
>> Expires: 3600
>> Contact: > >
>> Server: kamailio (4.2.0 (x86_64/linux))
>> Content-Length: 0
>> 
>> 
>>  … and then the snom receives an empty NOTIFY.
>> 
>> NOTIFY sip:org1a@192.168.1.15:58325  SIP/2.0
>> Via: SIP/2.0/UDP 
>> 109.104.108.18;branch=z9hG4bKc54a.20db45097fb44595ccd5a30827ca2a62.0
>> Via: SIP/2.0/UDP 
>> 10.210.160.16;rport=5060;branch=z9hG4bKc54a.40150886.0
>> To: >;tag=sx4ne9jpcl
>> From: 

[SR-Users] Important problem with this test : if ($var(i:maxRangeInx)==$null)

2017-03-27 Thread Ginhoux, Patrick
Hi,

I'm continue my job to 'migrate' my 3.3.1 kamailio.cfg script on a RHEL 6.2 
server to the 5.0.x kamailio version on a RHEL 7.1 server, and I encounter a 
major problem with the '== $null' test in the script.

My original script (3.3.1) contains this sequence :

$var(i:rangeInx)=0;
$var(i:maxRangeInx) = $sht(mbxrangeHash=>"maxrange");
xlog(" imbxRangeInx value before test : '$var(i:maxRangeInx)' ");
if ($var(i:maxRangeInx)==$null) {
$var(i:maxRangeInx)=99;
}
xlog(" imbxRangeInx after test : '$var(i:maxRangeInx)' ");

==> The results are :
imbxRangeInx value before test : '0'
imbxRangeInx value after test : '99'

I run the same script on my new server and I get '0' before and after the test.

I attempted another kind of test to try to figure out where the problem is. So 
I write the simple test (with kamailio 5.0.x) :

$var(i:rangeInx)=0;
$var(i:maxRangeInx) = $sht(mbxrangeHash=>"maxrange");
$var(toto) = $null;
if ($var(toto) == $null)
xlog ("toto true");
else
xlog ("toto false");

The result I got is always 'toto false'.

So it appears to me that the test '== $null' doens' that gives a good result 
with kamailio 3.3.1, doesn't return the same with kamailio 5.0.x.

That is a major issue for me and it let me confused about the possibility to 
move to kamailio 5.0.x.

Have people an idea / explanation, why this issue ?

Cordialement
Patrick GINHOUX

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Important problem with this test : if ($var(i:maxRangeInx)==$null)

2017-03-27 Thread Daniel-Constantin Mierla
Hello,

$var(...) don't hold null values, they start initialed to 0 and they are
reset to 0 (when assigning $null to them) -- this is the design from the
beginning which brings benefits in many situation when one doesn't get a
chance to init.

If you want a similar variable that works with null, then use $vn(...):

  -
https://www.kamailio.org/wiki/cookbooks/5.0.x/pseudovariables#vn_name_-_private_memory_variables_null

Cheers,
Daniel


On 27/03/2017 15:22, Ginhoux, Patrick wrote:
>
> Hi,
>
>  
>
> I’m continue my job to ‘migrate’ my 3.3.1 kamailio.cfg script on a
> RHEL 6.2 server to the 5.0.x kamailio version on a RHEL 7.1 server,
> and I encounter a major problem with the ‘== $null’ test in the script.
>
>  
>
> My original script (3.3.1) contains this sequence :
>
>  
>
> $var(i:rangeInx)=0;
>
> $var(i:maxRangeInx) = $sht(mbxrangeHash=>"maxrange");
>
> xlog(" imbxRangeInx value before test : '$var(i:maxRangeInx)' ");
>
> if ($var(i:maxRangeInx)==$null) {
>
> $var(i:maxRangeInx)=99;
>
> }
>
> xlog(" imbxRangeInx after test : '$var(i:maxRangeInx)' ");
>
>  
>
> èThe results are :
>
> imbxRangeInx value before test : ‘0’
>
> imbxRangeInx value after test : ‘99’
>
>  
>
> I run the same script on my new server and I get ‘0’ before and after
> the test.
>
>  
>
> I attempted another kind of test to try to figure out where the
> problem is. So I write the simple test (with kamailio 5.0.x) :
>
>  
>
> $var(i:rangeInx)=0;
>
> $var(i:maxRangeInx) = $sht(mbxrangeHash=>"maxrange");
>
> $var(toto) = $null;
>
> if ($var(toto) == $null)
>
> xlog ("toto true");
>
> else
>
> xlog ("toto false");
>
>  
>
> The result I got is always ‘toto false’.
>
>  
>
> So it appears to me that the test ‘== $null’ doens’ that gives a good
> result with kamailio 3.3.1, doesn’t return the same with kamailio 5.0.x.
>
>  
>
> That is a major issue for me and it let me confused about the
> possibility to move to kamailio 5.0.x.
>
>  
>
> Have people an idea / explanation, why this issue ?
>
>  
>
> Cordialement
>
> Patrick GINHOUX
>
>  
>
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - 
www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] RPCFIFOPATH / DEFINE_FIFO_NAME settings problem

2017-03-27 Thread Daniel-Constantin Mierla
Hello,

as recently as last week, someone encountered an file access problem
while installing Siremis, which is using also some temporary files in
/var/, even it was granting provileges via chown and chmod. All went
fine after disabling selinux. It was on a centos.

I am not saying it is the same, but it could, so try without centos to
see if the issue persists.

Cheers,
Daniel


On 27/03/2017 15:10, Ginhoux, Patrick wrote:
>
> Hi,
>
>  
>
> This is the RHEL 7.1 distro, and there is use of selinux, apparmor or
> other tools. 
>
>  
>
> Are you meaning that the /var/run/ folder would be secured more than
> other folders?
>
>  
>
> Cordialement
>
> Patrick GINHOUX
>
>  
>
> *De :*sr-users [mailto:sr-users-boun...@lists.sip-router.org] *De la
> part de* Daniel-Constantin Mierla
> *Envoyé :* lundi 27 mars 2017 13:52
> *À :* Kamailio (SER) - Users Mailing List 
> *Objet :* Re: [SR-Users] RPCFIFOPATH / DEFINE_FIFO_NAME settings problem
>
>  
>
> Hello,
>
> kamailio should attempt to create the /var/run/kamailio folder if the
> application is run with enough privileges. However, some operating
> systems add more constraints on top of the execution user.
>
> What is your OS distro? Do you have selinux, apparmor or other similar
> tools enabled?
>
> Cheers,
> Daniel
>
>  
>
> On 24/03/2017 17:52, Ginhoux, Patrick wrote:
>
> In my ‘kamctlrc’ file :
>
>  
>
> ## path to FIFO file for engine RPCFIFO
>
> RPCFIFOPATH="/var/run/kamailio/kamailio_rpc_fifo"
>
> #RPCFIFOPATH="/tmp/kamailio_rpc_fifo"
>
>  
>
> In my ‘kamailio.cfg’ :
>
>  
>
> !!ifndef DEFINE_FIFO_NAME
>
> !!define DEFINE_FIFO_NAME "/var/run/kamailio/kamailio_rpc_fifo"
>
> !!endif  
>
>  
>
>  
>
> modparam("jsonrpcs", "pretty_format", 1)
>
> modparam("jsonrpcs", "transport", 2)
>
> modparam("jsonrpcs", "fifo_name", DEFINE_FIFO_NAME)
>
> modparam("jsonrpcs", "fifo_mode", 0755)
>
> modparam("jsonrpcs", "fifo_group", "kamailio")
>
> modparam("jsonrpcs", "fifo_user", "kamailio")
>
>  
>
>  
>
> kamailio doesn’t start. It reports ‘Permission denied’ :
>
>  
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1138]: ERROR:
> jsonrpcs [jsonrpcs_fifo.c:144]: jsonrpc_init_fifo_server(): Can't
> create FIFO: Permission denied (mode=493)
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1138]: CRITICAL:
> jsonrpcs [jsonrpcs_fifo.c:489]: jsonrpc_fifo_process(): failed to
> init jsonrpc fifo server
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: ALERT: 
> [main.c:741]: handle_sigs(): child process 1138 exited normally,
> status=255
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1130]: DEBUG: 
> [core/sr_module.c:920]: init_mod_child(): rank 4: tm
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1137]: DEBUG: 
> [core/sr_module.c:920]: init_mod_child(): rank -1: tm
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1127]: DEBUG: htable
> [htable.c:226]: child_init(): rank is (1)
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: INFO: 
> [main.c:759]: handle_sigs(): terminating due to SIGCHLD
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1139]: DEBUG: 
> [core/sr_module.c:920]: init_mod_child(): rank -2: kex
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1130]: DEBUG: tm
> [callid.c:137]: child_init_callid(): callid:
> '15b1f0d63a718465-1130@129.227.83.108
> '
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1137]: DEBUG: tm
> [callid.c:137]: child_init_callid(): callid:
> '15b1f0d63a718465-1137@129.227.83.108
> '
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1127]: DEBUG: 
> [core/action.c:1656]: run_child_one_init_route(): attempting to
> run event_route[core:worker-one-init]
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1136]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1135]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1134]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1133]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1132]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1131]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1129]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1128]: INFO: 
> [main.c:814]: sig_usr(): signal 15 received
>
> Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: ERROR: ctl
> [ctl.c:387]: mod_destroy(): ERROR: ctl: could 

Re: [SR-Users] RPCFIFOPATH / DEFINE_FIFO_NAME settings problem

2017-03-27 Thread Ginhoux, Patrick
Hi,

This is the RHEL 7.1 distro, and there is use of selinux, apparmor or other 
tools.

Are you meaning that the /var/run/ folder would be secured more than other 
folders?

Cordialement
Patrick GINHOUX

De : sr-users [mailto:sr-users-boun...@lists.sip-router.org] De la part de 
Daniel-Constantin Mierla
Envoyé : lundi 27 mars 2017 13:52
À : Kamailio (SER) - Users Mailing List 
Objet : Re: [SR-Users] RPCFIFOPATH / DEFINE_FIFO_NAME settings problem


Hello,

kamailio should attempt to create the /var/run/kamailio folder if the 
application is run with enough privileges. However, some operating systems add 
more constraints on top of the execution user.

What is your OS distro? Do you have selinux, apparmor or other similar tools 
enabled?

Cheers,
Daniel

On 24/03/2017 17:52, Ginhoux, Patrick wrote:
In my ‘kamctlrc’ file :

## path to FIFO file for engine RPCFIFO
RPCFIFOPATH="/var/run/kamailio/kamailio_rpc_fifo"
#RPCFIFOPATH="/tmp/kamailio_rpc_fifo"

In my ‘kamailio.cfg’ :

!!ifndef DEFINE_FIFO_NAME
!!define DEFINE_FIFO_NAME "/var/run/kamailio/kamailio_rpc_fifo"
!!endif


modparam("jsonrpcs", "pretty_format", 1)
modparam("jsonrpcs", "transport", 2)
modparam("jsonrpcs", "fifo_name", DEFINE_FIFO_NAME)
modparam("jsonrpcs", "fifo_mode", 0755)
modparam("jsonrpcs", "fifo_group", "kamailio")
modparam("jsonrpcs", "fifo_user", "kamailio")


kamailio doesn’t start. It reports ‘Permission denied’ :

Mar 24 17:31:21 localhost /usr/sbin/kamailio[1138]: ERROR: jsonrpcs 
[jsonrpcs_fifo.c:144]: jsonrpc_init_fifo_server(): Can't create FIFO: 
Permission denied (mode=493)
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1138]: CRITICAL: jsonrpcs 
[jsonrpcs_fifo.c:489]: jsonrpc_fifo_process(): failed to init jsonrpc fifo 
server
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: ALERT:  [main.c:741]: 
handle_sigs(): child process 1138 exited normally, status=255
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1130]: DEBUG:  
[core/sr_module.c:920]: init_mod_child(): rank 4: tm
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1137]: DEBUG:  
[core/sr_module.c:920]: init_mod_child(): rank -1: tm
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1127]: DEBUG: htable 
[htable.c:226]: child_init(): rank is (1)
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: INFO:  [main.c:759]: 
handle_sigs(): terminating due to SIGCHLD
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1139]: DEBUG:  
[core/sr_module.c:920]: init_mod_child(): rank -2: kex
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1130]: DEBUG: tm [callid.c:137]: 
child_init_callid(): callid: 
'15b1f0d63a718465-1130@129.227.83.108'
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1137]: DEBUG: tm [callid.c:137]: 
child_init_callid(): callid: 
'15b1f0d63a718465-1137@129.227.83.108'
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1127]: DEBUG:  
[core/action.c:1656]: run_child_one_init_route(): attempting to run 
event_route[core:worker-one-init]
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1136]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1135]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1134]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1133]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1132]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1131]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1129]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1128]: INFO:  [main.c:814]: 
sig_usr(): signal 15 received
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: ERROR: ctl [ctl.c:387]: 
mod_destroy(): ERROR: ctl: could not delete unix socket 
/var/run/kamailio//kamailio_ctl: Permission denied (13)
Mar 24 17:31:21 localhost /usr/sbin/kamailio[1120]: ERROR: jsonrpcs 
[jsonrpcs_fifo.c:595]: jsonrpc_fifo_destroy(): FIFO stat failed: Permission 
denied

If I replace the values in the 2 files as appropriate :

In the ‘kamctlrc” to RPCFIFOPATH="/tmp/kamailio_rpc_fifo"

In the ‘kamailio.cfg” to !!define DEFINE_FIFO_NAME "/tmp/kamailio_rpc_fifo"

Then kamailo starts :

[root@vm-vse02-siprouter1 ~]# ps -ef |grep kam
kamailio  1235 1  0 17:37 ?00:00:00 /usr/sbin/kamailio -P 
/var/run/kamailio.pid -m 1024 -M 8 -u kamailio -g kamailio
kamailio  1236  1235  0 17:37 ?00:00:00 /usr/sbin/kamailio -P 
/var/run/kamailio.pid -m 1024 -M 8 -u kamailio -g kamailio
kamailio  1237  1235  0 17:37 ?00:00:00 /usr/sbin/kamailio -P 
/var/run/kamailio.pid -m 1024 -M 8 -u kamailio -g kamailio
kamailio  1238  1235  0 17:37 ?00:00:00 /usr/sbin/kamailio -P 
/var/run/kamailio.pid -m 1024 -M 8 -u kamailio -g kamailio
kamailio  1239  

Re: [SR-Users] Important problem with this test : if ($var(i:maxRangeInx)==$null)

2017-03-27 Thread Ginhoux, Patrick
Hi,

Great thanks to answer so quickly.

I tested the $vn ….in the 5.0.x script instead of $var…., and the results look 
good.

So I have to review the entire script to change all the ‘$var…. == $null’ 
entries to ‘$vn…. == $null’. I assume I have to do the same for the ‘!= $null” 
case. Am I correct ?

Now regarding my old kamailio 3.3.1 script, I notice that the ‘$var…. == $null’ 
works fine but no more with kamailio 5.0.x . So It’s something that has changed 
more recently. The 3.3.1 cookbooks doesn’t reference a ‘$vn’ variable.
But may be I misread it.

So if you have comments on this for my understanding, that would be fine.

Cordialement
Patrick GINHOUX

De : sr-users [mailto:sr-users-boun...@lists.sip-router.org] De la part de 
Daniel-Constantin Mierla
Envoyé : lundi 27 mars 2017 15:31
À : Kamailio (SER) - Users Mailing List 
Objet : Re: [SR-Users] Important problem with this test : if 
($var(i:maxRangeInx)==$null)


Hello,

$var(...) don't hold null values, they start initialed to 0 and they are reset 
to 0 (when assigning $null to them) -- this is the design from the beginning 
which brings benefits in many situation when one doesn't get a chance to init.

If you want a similar variable that works with null, then use $vn(...):

  - 
https://www.kamailio.org/wiki/cookbooks/5.0.x/pseudovariables#vn_name_-_private_memory_variables_null

Cheers,
Daniel

On 27/03/2017 15:22, Ginhoux, Patrick wrote:
Hi,

I’m continue my job to ‘migrate’ my 3.3.1 kamailio.cfg script on a RHEL 6.2 
server to the 5.0.x kamailio version on a RHEL 7.1 server, and I encounter a 
major problem with the ‘== $null’ test in the script.

My original script (3.3.1) contains this sequence :

$var(i:rangeInx)=0;
$var(i:maxRangeInx) = $sht(mbxrangeHash=>"maxrange");
xlog(" imbxRangeInx value before test : '$var(i:maxRangeInx)' ");
if ($var(i:maxRangeInx)==$null) {
$var(i:maxRangeInx)=99;
}
xlog(" imbxRangeInx after test : '$var(i:maxRangeInx)' ");

==> The results are :
imbxRangeInx value before test : ‘0’
imbxRangeInx value after test : ‘99’

I run the same script on my new server and I get ‘0’ before and after the test.

I attempted another kind of test to try to figure out where the problem is. So 
I write the simple test (with kamailio 5.0.x) :

$var(i:rangeInx)=0;
$var(i:maxRangeInx) = $sht(mbxrangeHash=>"maxrange");
$var(toto) = $null;
if ($var(toto) == $null)
xlog ("toto true");
else
xlog ("toto false");

The result I got is always ‘toto false’.

So it appears to me that the test ‘== $null’ doens’ that gives a good result 
with kamailio 3.3.1, doesn’t return the same with kamailio 5.0.x.

That is a major issue for me and it let me confused about the possibility to 
move to kamailio 5.0.x.

Have people an idea / explanation, why this issue ?

Cordialement
Patrick GINHOUX





___

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users@lists.sip-router.org

http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



--

Daniel-Constantin Mierla

www.twitter.com/miconda -- 
www.linkedin.com/in/miconda

Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - 
www.asipto.com

Kamailio World Conference - May 8-10, 2017 - 
www.kamailioworld.com
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users