herlesupreeth / Kamailio_IMS_Config

Fixed version of Kamailio IMS configuration files for basic calling
45 stars 36 forks source link

Failed to disable IPSEC #31

Closed johnpooh121 closed 1 year ago

johnpooh121 commented 1 year ago

Hi @herlesupreeth ,

When I commented ##!define WITH_IPSEC in /kamailio_pcscf/pcscf.cfg and tried to run following command kamailio -f /etc/kamailio_pcscf/kamailio_pcscf.cfg -P /kamailio_pcscf.pid -DD -E -e , it failed with following error message.

root@bsj-HP-Elite-Tower-800-G9-Desktop-PC:/# kamailio -f /etc/kamailio_pcscf/kamailio_pcscf.cfg -P /kamailio_pcscf.pid -DD -E -e
loading modules under config path: /usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/:/usr/local/lib64/kamailio/modules
 0(267117) INFO: pv [pv_shv.c:60]: shvar_init_locks(): locks array size 16
 0(267117) ERROR: <core> [core/cfg.y:3399]: yyparse(): cfg. parser: failed to find command ipsec_forward (params 1)
 0(267117) CRITICAL: <core> [core/cfg.y:3539]: yyerror_at(): parse error in config file /etc/kamailio_pcscf/route/mo.cfg, line 173, column 28: unknown command, missing loadmodule?

 0(267117) ERROR: <core> [core/cfg.y:3399]: yyparse(): cfg. parser: failed to find command ipsec_forward (params 1)
 0(267117) CRITICAL: <core> [core/cfg.y:3539]: yyerror_at(): parse error in config file /etc/kamailio_pcscf/route/mt.cfg, line 98, column 37: unknown command, missing loadmodule?

ERROR: bad config file (2 errors)
 0(267117) WARNING: <core> [core/mem/q_malloc.c:487]: qm_free(): WARNING: free(0) called from cdp_avp: cdp_avp_mod.c: cdp_avp_destroy(226)
 0(267117) INFO: cdp [cdp_mod.c:255]: cdp_exit(): CDiameterPeer child stopping ...
 0(267117) INFO: cdp [cdp_mod.c:257]: cdp_exit(): ... CDiameterPeer child stopped

But when I tried again with commenting ipsec_forward("location"); in line 173 of kamailio_pcscf/route/mo.cfg and line 98 of kamailio_pcscf/route/mt.cfg, following error showed up :

root@bsj-HP-Elite-Tower-800-G9-Desktop-PC:/# kamailio -f /etc/kamailio_pcscf/kamailio_pcscf.cfg -P /kamailio_pcscf.pid -DD -E -e
loading modules under config path: /usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/:/usr/local/lib64/kamailio/modules
 0(267157) INFO: pv [pv_shv.c:60]: shvar_init_locks(): locks array size 16
Listening on 
             udp: 10.45.1.1 [10.45.1.1]:5060
             tcp: 10.45.1.1 [10.45.1.1]:5060
Aliases: 
             *: pcscf.ims.mnc001.mcc001.3gppnetwork.org:*

 0(267157) INFO: <core> [core/tcp_main.c:5042]: init_tcp(): using epoll_lt as the io watch method (auto detected)
 0(267157) INFO: rr [../outbound/api.h:52]: ob_load_api(): unable to import bind_ob - maybe module is not loaded
 0(267157) INFO: rr [rr_mod.c:177]: mod_init(): outbound module not available
 0(267157) INFO: auth [auth_mod.c:345]: mod_init(): qop set, but nonce-count (nc_enabled) support disabled
 0(267157) INFO: path [../outbound/api.h:52]: ob_load_api(): unable to import bind_ob - maybe module is not loaded
 0(267157) INFO: path [path_mod.c:151]: mod_init(): outbound module not available
 0(267157) INFO: ims_usrloc_pcscf [hslot.c:62]: ul_init_locks(): locks array size 512
 0(267157) ERROR: ims_registrar_pcscf [ims_registrar_pcscf_mod.c:268]: mod_init(): can't bind ims_ipsec_pcscf
 0(267157) ERROR: <core> [core/sr_module.c:849]: init_mod(): Error while initializing module ims_registrar_pcscf (/usr/local/lib64/kamailio/modules/ims_registrar_pcscf.so)
ERROR: error while initializing modules
 0(267157) WARNING: <core> [core/mem/q_malloc.c:487]: qm_free(): WARNING: free(0) called from cdp_avp: cdp_avp_mod.c: cdp_avp_destroy(226)
 0(267157) INFO: cdp [cdp_mod.c:255]: cdp_exit(): CDiameterPeer child stopping ...
 0(267157) INFO: cdp [cdp_mod.c:257]: cdp_exit(): ... CDiameterPeer child stopped

I am using Kamailio v5.3 from https://github.com/herlesupreeth/kamailio. I confused that I re-compiled the code, but actually I didn't in https://github.com/open5gs/open5gs/discussions/2140#discussioncomment-5402945

herlesupreeth commented 1 year ago

I will take a look over the weekend

herlesupreeth commented 1 year ago

@johnpooh121 This should be fixed in latest commits. Please pull latest fixes and give it a try

johnpooh121 commented 1 year ago

Disabling IPsec works fine. Thanks!