Hello Chusov, The presence modules disable the opening of new TCP conns for sequential requests (like NOTIFIES) as they follow the same TCP conn as the SUBSCRIBE.
What I see on your trace is that SUBSCRIBE comes from 10.222.1.253:37827 , but the advertised address in Contact hdr is sip:[email protected]:5060 - a different port, which will prevent the re-usage of the same TCP connection. What you can do is to force the re-usage of the existing TCP conn (from SUBSCRIBE) by using the global parameter: tcp_accept_aliases = 1 Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com On 05/23/2013 01:25 PM, Chusov Alexsandr wrote: > Sorry send wrong trace > T 2013/05/23 13:24:13.215773 10.222.1.253:37827 -> 10.222.0.17:5060 [AP] > SUBSCRIBE sip:[email protected] SIP/2.0. > Via: SIP/2.0/TCP 10.222.1.253:5060;branch=z9hG4bK1334330933;rport;alias. > From: <sip:[email protected]>;tag=1005928247. > To: <sip:[email protected]>. > Call-ID: [email protected]. > CSeq: 20070 SUBSCRIBE. > Contact: <sip:[email protected]:5060;transport=tcp>. > X-Grandstream-PBX: true. > Max-Forwards: 70. > User-Agent: Grandstream GXP2120 1.0.5.24. > Expires: 300. > Supported: replaces, path, timer, eventlist. > Event: dialog. > Accept: application/dialog-info+xml,multipart/related,application/rlmi+xml. > Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, > REFER, UPDATE, MESSAGE. > Content-Length: 0. > . > > > T 2013/05/23 13:24:13.216339 10.222.0.17:5060 -> 10.222.1.253:37827 [AP] > SIP/2.0 200 OK. > Via: SIP/2.0/TCP > 10.222.1.253:5060;received=10.222.1.253;branch=z9hG4bK1334330933;rport=37827;alias. > From: <sip:[email protected]>;tag=1005928247. > To: <sip:[email protected]>;tag=6b081e8cb2be0cc593bdd08e52ae2811-dae0. > Call-ID: [email protected]. > CSeq: 20070 SUBSCRIBE. > Expires: 180. > Contact: <sip:[email protected]:5060;transport=tcp>. > Server: OpenSIPS (1.8.3-tls (x86_64/linux)). > Content-Length: 0. > > > > > May 23 13:24:13 stb-bsip-TEST opensips[14672]: > INFO:presence:update_subscription: notify > May 23 13:24:13 stb-bsip-TEST opensips[14672]: ERROR:tm:msg_send: > tcp_send failed > May 23 13:24:13 stb-bsip-TEST opensips[14672]: ERROR:tm:t_uac: attempt > to send to 'sip:[email protected]:5060;transport=tcp' failed > May 23 13:24:13 stb-bsip-TEST opensips[14672]: > INFO:presence:send_notify_request: NOTIFY sip:[email protected] via > sip:[email protected]:5060;transport=tcp on behalf of > sip:[email protected] for event dialog, > to_tag=6b081e8cb2be0cc593bdd08e52ae2811-dae0, cseq=1 > > 2013/5/23 Chusov Alexsandr <[email protected]>: >> Hello, >> >> Log Opensips: >> >> May 23 12:29:37 stb-bsip-TEST opensips[13572]: >> INFO:presence:update_subscription: notify >> May 23 12:29:37 stb-bsip-TEST opensips[13572]: ERROR:tm:msg_send: >> tcp_send failed >> May 23 12:29:37 stb-bsip-TEST opensips[13572]: ERROR:tm:t_uac: attempt >> to send to 'sip:[email protected]:5060;transport=tcp' failed >> May 23 12:29:37 stb-bsip-TEST opensips[13572]: >> INFO:presence:send_notify_request: NOTIFY sip:[email protected] via >> sip:[email protected]:5060;transport=tcp on behalf of >> sip:[email protected] for event dialog, >> to_tag=6b081e8cb2be0cc593bdd08e52ae2811-fcef, cseq=1 >> >> SIP trace tcp: >> >> T 2013/05/23 12:29:37.439107 10.222.1.253:45393 -> 10.222.0.17:5060 [AP] >> SUBSCRIBE sip:[email protected] SIP/2.0. >> Via: SIP/2.0/TCP 10.222.1.253:5060;branch=z9hG4bK1476817771;rport;alias. >> From: <sip:[email protected]>;tag=971365295. >> To: <sip:[email protected]>. >> Call-ID: [email protected]. >> CSeq: 20070 SUBSCRIBE. >> Contact: <sip:[email protected]:5060;transport=tcp>. >> X-Grandstream-PBX: true. >> Max-Forwards: 70. >> User-Agent: Grandstream GXP2120 1.0.5.24. >> Expires: 300. >> Supported: replaces, path, timer, eventlist. >> Event: dialog. >> Accept: application/dialog-info+xml,multipart/related,application/rlmi+xml. >> Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, >> REFER, UPDATE, MESSAGE. >> Content-Length: 0. >> . >> >> >> T 2013/05/23 12:29:37.439608 10.222.0.17:5060 -> 10.222.1.253:45393 [AP] >> SIP/2.0 200 OK. >> Via: SIP/2.0/TCP >> 10.222.1.253:5060;received=10.222.1.253;branch=z9hG4bK1476817771;rport=45393;alias. >> From: <sip:[email protected]>;tag=971365295. >> To: <sip:[email protected]>;tag=6b081e8cb2be0cc593bdd08e52ae2811-fcef. >> Call-ID: [email protected]. >> CSeq: 20070 SUBSCRIBE. >> Expires: 180. >> Contact: <sip:[email protected]:5061;transport=tcp>. >> Server: OpenSIPS (1.8.3-tls (x86_64/linux)). >> Content-Length: 0. >> >> 2013/5/22 Bogdan-Andrei Iancu <[email protected]>: >>> The registration info is used only for routing the SUBSCRIBE (which is ok). >>> For the NOTIFY routing, the info from SUBSCRIBE + its 200 OK is used - this >>> is why I need the pcap. >>> >>> Regards, >>> >>> Bogdan-Andrei Iancu >>> OpenSIPS Founder and Developer >>> http://www.opensips-solutions.com >>> >>> >>> On 05/22/2013 08:24 PM, Chusov Alexsandr wrote: >>> >>> I do not have pcap because use TLS. But I can tomorrow create pcap TCP. >>> Two phone one enable "Use Actual Ephemeral Port in Contact with TCP/TLS" ( >>> [email protected] ) >>> >>> AOR:: [email protected] >>> Contact:: sip:[email protected]:5060;transport=tls Q= >>> Expires:: 247 >>> Callid:: [email protected] >>> Cseq:: 2053 >>> User-agent:: Grandstream GXP2120 1.0.5.24 >>> State:: CS_SYNC >>> Flags:: 0 >>> Cflag:: 0 >>> Socket:: tls:10.222.0.17:5061 >>> Methods:: 6015 >>> AOR:: [email protected] >>> Contact:: sip:[email protected]:45266;transport=tls Q= >>> Expires:: 88 >>> Callid:: [email protected] >>> Cseq:: 2047 >>> User-agent:: Grandstream GXP1405 1.0.5.15 >>> State:: CS_SYNC >>> Flags:: 0 >>> Cflag:: 0 >>> Socket:: tls:10.222.0.17:5061 >>> Methods:: 6015 >>> >>> I also asked a friend to test the asterisk. He send NOTIFY to port is >>> connected to not Contact. >>> >>> >>> >>> 2013/5/22 Bogdan-Andrei Iancu <[email protected]> >>>> Hi Chusov, >>>> >>>> The NOTIFY is sent back to the IP:port from the Contact in received >>>> SUBSCRIBE. Do you have a pcap capture of the SUBSCRIBE + NOTIFY on the >>>> opensips side ? >>>> >>>> Regards, >>>> >>>> Bogdan-Andrei Iancu >>>> OpenSIPS Founder and Developer >>>> http://www.opensips-solutions.com >>>> >>>> >>>> On 05/22/2013 06:12 PM, Chusov Alexsandr wrote: >>>>> Hello >>>>> I have Grandstream phone with setup BLF button. >>>>> Opensips use for REGISTER|Presence|BLF >>>>> When set Grandstream options to "Use Actual Ephemeral Port in Contact >>>>> with TCP/TLS" phone add to Contact header port to which it is >>>>> connected BLF work fine. >>>>> But if phone set port to standard 5060 Opensips cant send NOTIFY >>>>> >>>>> Phone - > SUBSCRIBE -> Opensips >>>>> Opensips -> Ok - > Phone >>>>> Opensips -> NOTIFY -> tcp_send failed >>>>> >>>>> On phone log i don't see problem. He send SUBSCRIBE received OK. About >>>>> NOTIFY nothing. >>>>> >>>>> >>>>> DBG:presence:send_notify_request: built notify_body 0x10d16f0 >>>>> DBG:presence:send_notify_request: headers:#012Event: >>>>> dialog#015#012Contact: >>>>> <sip:[email protected]:5061;transport=tls>#015#012Subscription-State: >>>>> active;expires=180#015#012Content-Type: >>>>> application/dialog-info+xml#015#012 >>>>> DBG:presence:build_dlg_t: CONTACT = >>>>> sip:[email protected]:5060;transport=tls >>>>> DBG:presence_dialoginfo:dlginfo_body_setversion: set version >>>>> DBG:presence_dialoginfo:dlginfo_body_setversion: replace version with >>>>> "0" >>>>> DBG:tm:t_uac: next_hop=<sip:[email protected]:5060;transport=tls> >>>>> DBG:core:mk_proxy: doing DNS lookup... >>>>> DBG:tm:dlg2hash: 650 >>>>> DBG:tm:print_request_uri: sip:[email protected]:5060;transport=tls >>>>> ERROR:tm:msg_send: tcp_send failed >>>>> ERROR:tm:t_uac: attempt to send to >>>>> 'sip:[email protected]:5060;transport=tls' failed >>>>> DBG:tm:set_timer: relative timeout is 5 >>>>> DBG:tm:insert_timer_unsafe: [0]: 0x7f9a7d7b0fe0 (34) >>>>> INFO:presence:send_notify_request: NOTIFY sip:[email protected] via >>>>> sip:[email protected]:5060;transport=tls on behalf of >>>>> sip:[email protected] for event dialog, >>>>> to_tag=6b081e8cb2be0cc593bdd08e52ae2811-c7c2, cseq=1 >>>>> DBG:tm:t_unref: UNREF_UNSAFE: [0x7f9a7d7a5cc0] after is 0 >>>>> DBG:core:destroy_avp_list: destroying list (nil) >>>>> DBG:core:receive_msg: cleaning up >>>>> >>>>> >>>>> Thanks in advance >>>>> Sorry for my English >>>>> >>>>> _______________________________________________ >>>>> Users mailing list >>>>> [email protected] >>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users >>>>> >>> _______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
