Re: [SR-Users] jsonrpcc problem

2017-09-19 Thread Adam Kuśmirek
Daniel, thanks for advice. I will try with janssonrpcc.

Regards Adam

2017-09-18 9:31 GMT+02:00 Daniel-Constantin Mierla :

> Hello,
>
> afaik, janssonrpcc module is supposed to be a better alternative to
> jsonrpcc, just in case you want to try it.
>
> Back to jsonrpcc and the logs, it appears that there is a crash:
>  0(921) ALERT:  [main.c:740]: handle_sigs(): child process 929
> exited by a signal 11
>  0(921) ALERT:  [main.c:743]: handle_sigs(): core was generated
>
> Can you locate the coredumo file and get the bactrace ('bt full') out of
> it with gdb?
>
> Cheers,
> Daniel
>
>
> On 14.09.17 19:53, Adam Kuśmirek wrote:
>
> Hello,
>
> I have a problem with jsonrpcc module.
>
> OS is Debian Jessie. I tried with packeged kamailio 4.4 and compiled
> kamailio 5.0.
>
> Kamailio starts properly. Routing block is very simple:
>
> route {
> jsonrpc_request("get_source", "{'ipv4': '$si', 'port': $sp}", "RESPONSE", 
> "ERROR", "$var(result)");
> exit;
> }
>
> route[RESPONSE] {
>xlog("Result received: $var(result)");
> }
>
> route[ERROR] {
>xlog("Error received: $var(result)");
> }
>
>
> If any message arrives, kamailio sends it to my rpc_server (netstring
> encoded):
>
>
> 106:{'id': 2, 'jsonrpc': '2.0', 'method': 'get_source', 'params': {'ipv4':
> '10.20.121.231', 'port': 5060}},
>
> My server decodes the message and immediately answers with netstring
> encoded response:
>
> 47:{"jsonrpc": "2.0", "result": "200 OK", "id": 2},
>
> At this moment kamailio logs errors and disconnects from rpc server:
>
> root@kamailio-test:/etc/kamailio#  4(925) DEBUG: 
> [parser/msg_parser.c:595]: parse_msg(): SIP Request:
>  4(925) DEBUG:  [parser/msg_parser.c:597]: parse_msg():  method:
>  
>  4(925) DEBUG:  [parser/msg_parser.c:599]: parse_msg():  uri:
> 
>  4(925) DEBUG:  [parser/msg_parser.c:601]: parse_msg():  version:
> 
>  4(925) DEBUG:  [parser/parse_via.c:1303]: parse_via_param(): Found
> param type 232,  = ; state=16
>  4(925) DEBUG:  [parser/parse_via.c:2639]: parse_via(): end of
> header reached, state=5
>  4(925) DEBUG:  [parser/msg_parser.c:486]: parse_headers(): Via
> found, flags=2
>  4(925) DEBUG:  [parser/msg_parser.c:488]: parse_headers(): this is
> the first via
>  4(925) DEBUG:  [receive.c:178]: receive_msg(): After parse_msg...
>  4(925) DEBUG:  [receive.c:221]: receive_msg(): preparing to run
> routing scripts...
>  4(925) DEBUG: tm [t_lookup.c:1312]: t_newtran(): DEBUG: t_newtran: msg
> id=1 , global msg id=0 , T on entrance=0x
>  4(925) DEBUG:  [parser/parse_addr_spec.c:864]: parse_addr_spec():
> end of header reached, state=10
>  4(925) DEBUG:  [parser/msg_parser.c:171]: get_hdr_field(): 
> [40]; uri=[sip:1...@kamailio.conpeek.com]
>  4(925) DEBUG:  [parser/msg_parser.c:172]: get_hdr_field(): to body
> ["1000" 
> ]
>  4(925) DEBUG:  [parser/msg_parser.c:152]: get_hdr_field(): cseq
> : <1> 
>  4(925) DEBUG:  [parser/msg_parser.c:183]: get_hdr_field():
> content_length=0
>  4(925) DEBUG:  [parser/msg_parser.c:89]: get_hdr_field(): found end
> of header
>  4(925) DEBUG: tm [t_lookup.c:466]: t_lookup_request(): t_lookup_request:
> start searching: hash=43020, isACK=0
>  4(925) DEBUG: tm [t_lookup.c:424]: matching_3261(): DEBUG: RFC3261
> transaction matching failed
>  4(925) DEBUG: tm [t_lookup.c:648]: t_lookup_request(): DEBUG:
> t_lookup_request: no transaction found
>  4(925) DEBUG:  [md5utils.c:67]: MD5StringArray(): MD5 calculated:
> 920bfe28c581e1bf18554e3a9b234ceb
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying list
> (nil)
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying list
> (nil)
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying list
> (nil)
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying list
> (nil)
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying list
> (nil)
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying list
> (nil)
>  4(925) DEBUG:  [xavp.c:446]: xavp_destroy_list(): destroying xavp
> list (nil)
>  4(925) DEBUG:  [receive.c:318]: receive_msg(): cleaning up
>  *0(921) ALERT:  [main.c:740]: handle_sigs(): child process 929
> exited by a signal 11*
> * 0(921) ALERT:  [main.c:743]: handle_sigs(): core was generated*
>  0(921) INFO:  [main.c:755]: handle_sigs(): terminating due to
> SIGCHLD
>  0(921) DEBUG:  [main.c:757]: handle_sigs(): terminating due to
> SIGCHLD
>  7(928) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  6(927) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  5(926) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  4(925) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  3(924) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  2(923) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  1(922) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  0(921) DEBUG: tm [t_funcs.c:86]: tm_shutdown(): DEBUG: tm_shutdown : start
>  0(921) DEBUG: tm [t_funcs.c:89]: 

Re: [SR-Users] jsonrpcc problem

2017-09-18 Thread Daniel-Constantin Mierla
Hello,

afaik, janssonrpcc module is supposed to be a better alternative to
jsonrpcc, just in case you want to try it.

Back to jsonrpcc and the logs, it appears that there is a crash:

 0(921) ALERT:  [main.c:740]: handle_sigs(): child process 929
exited by a signal 11
 0(921) ALERT:  [main.c:743]: handle_sigs(): core was generated

Can you locate the coredumo file and get the bactrace ('bt full') out of
it with gdb?

Cheers,
Daniel

On 14.09.17 19:53, Adam Kuśmirek wrote:
> Hello,
>
> I have a problem with jsonrpcc module.
>
> OS is Debian Jessie. I tried with packeged kamailio 4.4 and compiled
> kamailio 5.0. 
>
> Kamailio starts properly. Routing block is very simple:
>
> route {
> jsonrpc_request("get_source", "{'ipv4': '$si', 'port': $sp}", "RESPONSE", 
> "ERROR", "$var(result)");
> exit;
> }
>
> route[RESPONSE] {
>xlog("Result received: $var(result)");
> }
>
> route[ERROR] {
>xlog("Error received: $var(result)");
> }
>
> If any message arrives, kamailio sends it to my rpc_server (netstring
> encoded):
>
>
> 106:{'id': 2, 'jsonrpc': '2.0', 'method': 'get_source', 'params':
> {'ipv4': '10.20.121.231', 'port': 5060}},
>
> My server decodes the message and immediately answers with netstring
> encoded response:
>
> 47:{"jsonrpc": "2.0", "result": "200 OK", "id": 2},
>
> At this moment kamailio logs errors and disconnects from rpc server:
>
> root@kamailio-test:/etc/kamailio#  4(925) DEBUG: 
> [parser/msg_parser.c:595]: parse_msg(): SIP Request:
>  4(925) DEBUG:  [parser/msg_parser.c:597]: parse_msg():  method:
>  
>  4(925) DEBUG:  [parser/msg_parser.c:599]: parse_msg():  uri:  
>   http://kamailio.conpeek.com>>
>  4(925) DEBUG:  [parser/msg_parser.c:601]: parse_msg():
>  version: 
>  4(925) DEBUG:  [parser/parse_via.c:1303]: parse_via_param():
> Found param type 232,  = ; state=16
>  4(925) DEBUG:  [parser/parse_via.c:2639]: parse_via(): end of
> header reached, state=5
>  4(925) DEBUG:  [parser/msg_parser.c:486]: parse_headers(): Via
> found, flags=2
>  4(925) DEBUG:  [parser/msg_parser.c:488]: parse_headers(): this
> is the first via
>  4(925) DEBUG:  [receive.c:178]: receive_msg(): After parse_msg...
>  4(925) DEBUG:  [receive.c:221]: receive_msg(): preparing to run
> routing scripts...
>  4(925) DEBUG: tm [t_lookup.c:1312]: t_newtran(): DEBUG: t_newtran:
> msg id=1 , global msg id=0 , T on entrance=0x
>  4(925) DEBUG:  [parser/parse_addr_spec.c:864]:
> parse_addr_spec(): end of header reached, state=10
>  4(925) DEBUG:  [parser/msg_parser.c:171]: get_hdr_field(): 
> [40]; uri=[sip:1...@kamailio.conpeek.com
> ]
>  4(925) DEBUG:  [parser/msg_parser.c:172]: get_hdr_field(): to
> body ["1000"  >
> ]
>  4(925) DEBUG:  [parser/msg_parser.c:152]: get_hdr_field(): cseq
> : <1> 
>  4(925) DEBUG:  [parser/msg_parser.c:183]: get_hdr_field():
> content_length=0
>  4(925) DEBUG:  [parser/msg_parser.c:89]: get_hdr_field(): found
> end of header
>  4(925) DEBUG: tm [t_lookup.c:466]: t_lookup_request():
> t_lookup_request: start searching: hash=43020, isACK=0
>  4(925) DEBUG: tm [t_lookup.c:424]: matching_3261(): DEBUG: RFC3261
> transaction matching failed
>  4(925) DEBUG: tm [t_lookup.c:648]: t_lookup_request(): DEBUG:
> t_lookup_request: no transaction found
>  4(925) DEBUG:  [md5utils.c:67]: MD5StringArray(): MD5
> calculated: 920bfe28c581e1bf18554e3a9b234ceb
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying
> list (nil)
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying
> list (nil)
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying
> list (nil)
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying
> list (nil)
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying
> list (nil)
>  4(925) DEBUG:  [usr_avp.c:631]: destroy_avp_list(): destroying
> list (nil)
>  4(925) DEBUG:  [xavp.c:446]: xavp_destroy_list(): destroying
> xavp list (nil)
>  4(925) DEBUG:  [receive.c:318]: receive_msg(): cleaning up
>  *0(921) ALERT:  [main.c:740]: handle_sigs(): child process 929
> exited by a signal 11*
> * 0(921) ALERT:  [main.c:743]: handle_sigs(): core was generated*
>  0(921) INFO:  [main.c:755]: handle_sigs(): terminating due to
> SIGCHLD
>  0(921) DEBUG:  [main.c:757]: handle_sigs(): terminating due to
> SIGCHLD
>  7(928) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  6(927) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  5(926) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  4(925) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  3(924) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  2(923) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  1(922) INFO:  [main.c:810]: sig_usr(): signal 15 received
>  0(921) DEBUG: tm [t_funcs.c:86]: tm_shutdown(): DEBUG: tm_shutdown :
> start
>  0(921) DEBUG: tm [t_funcs.c:89]: tm_shutdown(): DEBUG: tm_shutdown :
> emptying hash table
>  0(921)