Hi,
i noticed a weird behavior in 4.2 branch with this kamailio.cfg (snippet)
#!substdef "!UDP_SIP!udp:MY_IP_ADDRESS:5060!g" #!substdef "!TCP_SIP!tcp:MY_IP_ADDRESS:5060!g" listen=UDP_SIP listen=TCP_SIP
####### Routing Logic ######## route { # log the basic info regarding this call xlog("L_INFO", "$ci|start|recieved $oP request $rm $ou"); ..... }
when clients using TCP send a SUBSCRIBE we get log info that it is a UDP operation. when we send the first notify we get tcp errors. for reference, i'm using Bria 4 in testing.
Dec 20 16:49:29 kamailio-05 kamailio[5085]: INFO: <script>: YzYwYWVlOTFiMGU0YmNjM2IyMDA1NmQ4NjdiMGEwZDY|start|recieved UDP request SUBSCRIBE sip:2135@sip.com Dec 20 16:49:29 kamailio-05 kamailio[5072]: INFO: <script>: received dialog update for sip:2135@sip.com Dec 20 16:49:29 kamailio-05 kamailio[5072]: INFO: presence [notify.c:1604]: send_notify_request(): NOTIFY sip:user_7z7b6s@sip.com via sip:user_7z7b6s@192.168.16.12:62285;transpop on behalf of sip:2134@sip.com for event dialog Dec 20 16:49:29 kamailio-05 kamailio[5072]: CRITICAL: <core> [pass_fd.c:157]: send_all(): send on 0 failed: Socket operation on non-socket Dec 20 16:49:29 kamailio-05 kamailio[5072]: ERROR: <core> [tcp_main.c:2303]: tcpconn_send_put(): failed to get fd(write):Socket operation on non-socket (88) Dec 20 16:49:29 kamailio-05 kamailio[5072]: ERROR: tm [../../forward.h:227]: msg_send(): tcp_send failed Dec 20 16:49:29 kamailio-05 kamailio[5072]: ERROR: tm [uac.c:598]: send_prepared_request_impl(): t_uac: Attempt to send to precreated request failed
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11
the same thing happens with TLS connections.
one side effect is that the subscription doesn't get updated to active and gets cleaned by timer proc.
Dec 20 18:20:32 kamailio-05 kamailio[6089]: INFO: <script>: received dialog update for sip:2134@sip.com Dec 20 18:20:32 kamailio-05 kamailio[6089]: CRITICAL: <core> [pass_fd.c:157]: send_all(): send on 0 failed: Socket operation on non-socket Dec 20 18:20:32 kamailio-05 kamailio[6089]: ERROR: <core> [tcp_main.c:2303]: tcpconn_send_put(): failed to get fd(write):Socket operation on non-socket (88) Dec 20 18:20:32 kamailio-05 kamailio[6089]: ERROR: tm [../../forward.h:247]: msg_send(): tcp_send failed Dec 20 18:20:32 kamailio-05 kamailio[6089]: ERROR: tm [uac.c:598]: send_prepared_request_impl(): t_uac: Attempt to send to precreated request failed Dec 20 18:20:32 kamailio-05 kamailio[6089]: INFO: presence [notify.c:1604]: send_notify_request(): NOTIFY sip:user_7z7b6s@sip.com via sip:user_7z7b6s@192.168.16.12:15778;transport=tls on behalf of sip:2134@sip.com for event dialog
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67744870
$oP is the protocol specified in the transport parameter of original R-URI. If you want to take the value from the ip layer, use $pr.
You have to paste here the error messages you get in order to be able to assist further.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67893638
thanks about the $pr. the error is in the message (it doesn't show but if you try to edit you'll see it).
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67898110
JFTR, I edited @lazedo comments using markdown syntax in order to see the logs. Just my 2 cents
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67898902
Can you get the ngrep for the SUBSCRIBE as received by Kamailio? Apparently something is related to what is forced as outgoing protocol.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67900609
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67902003
It doesn't look like ngrep output. Better attach the pcap than a long paste from wireshark that is hard to spot the requests and analyze.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67902787
pcap file ________________________________ From: sr-dev [sr-dev-bounces@lists.sip-router.org] on behalf of Daniel-Constantin Mierla [notifications@github.com] Sent: Monday, December 22, 2014 3:09 PM To: Kamailio Devel List Subject: Re: [sr-dev] [kamailio] issue notifying subscribers with transport tcp/tls (#11)
It doesn't look like ngrep output. Better attach the pcap than a long paste from wireshark that is hard to spot the requests and analyze.
— Reply to this email directly or view it on GitHubhttps://github.com/kamailio/kamailio/issues/11#issuecomment-67902787.
The error message is about inter-process communication in Kamailio, not with the network. Do you see the NOTIFY on the net? If you do 'kamctl ps', do you see tcp workers and tcp main attendant processes?
I would need all logs messages with debug=3 to be able to troubleshoot further.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67905766
Hi,
the notify_watchers is being called from a background process that was forked like this pid=fork_process(i+2, "AMQP Consumer", 0); could this be the problem ? should it be pid=fork_process(i+2, "AMQP Consumer", 1); ?
also, is there a reason for send_notify_request in presence/notify.c to use tmb.t_request_within instead of tmb.t_request?
set_uac_req(&uac_r, &met, &str_hdr, notify_body, td, TMCB_LOCAL_COMPLETED, p_tm_callback, (void*)cb_param); result = tmb.t_request_within(&uac_r);
________________________________ From: sr-dev [sr-dev-bounces@lists.sip-router.org] on behalf of Daniel-Constantin Mierla [notifications@github.com] Sent: Monday, December 22, 2014 3:42 PM To: Kamailio Devel List Cc: kamailio-sync Subject: Re: [sr-dev] [kamailio] issue notifying subscribers with transport tcp/tls (#11)
The error message is about inter-process communication in Kamailio, not with the network. Do you see the NOTIFY on the net? If you do 'kamctl ps', do you see tcp workers and tcp main attendant processes?
I would need all logs messages with debug=3 to be able to troubleshoot further.
— Reply to this email directly or view it on GitHubhttps://github.com/kamailio/kamailio/issues/11#issuecomment-67905766.
Yes, you have to set last parameter to 1 for fork_process().
t_request_within() sends a request within an existing dialog (subscribe dialog in this case).
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67932864
Hi Daniel,
what about when there isn't a subscribe dialog ? or does the SUBSCRIBE keep a reference to the dialog ? in this case the NOTIFY is sent when other extension is ringing (BLF).
thanks
On Tue, Dec 23, 2014 at 9:07 AM, Daniel-Constantin Mierla < notifications@github.com> wrote:
Yes, you have to set last parameter to 1 for fork_process().
t_request_within() sends a request within an existing dialog (subscribe dialog in this case).
— Reply to this email directly or view it on GitHub https://github.com/kamailio/kamailio/issues/11#issuecomment-67932864.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67940050
presence module sends notify only to active subscribe dialogs (to active watchers) -- it doesn't know where to send the notify if there was no subscribe before it (it is how sip presence specs are).
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67943428
thank you for helping debug this. the problem was on the background process forked without the tcp option. the strange thing is that it works with udp.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#issuecomment-67982283
Closed #11.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/11#event-211459711