[OpenSIPS-Users] Presence BLF TLS

Bogdan-Andrei Iancu bogdan at opensips.org
Mon May 27 19:05:26 CEST 2013


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:9999 at 10.222.1.253: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:2004 at g-voip.stb.ua SIP/2.0.
> Via: SIP/2.0/TCP 10.222.1.253:5060;branch=z9hG4bK1334330933;rport;alias.
> From: <sip:9999 at g-voip.stb.ua>;tag=1005928247.
> To: <sip:2004 at g-voip.stb.ua>.
> Call-ID: 310582788-5060-10 at BA.CCC.B.CFD.
> CSeq: 20070 SUBSCRIBE.
> Contact: <sip:9999 at 10.222.1.253: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:9999 at g-voip.stb.ua>;tag=1005928247.
> To: <sip:2004 at g-voip.stb.ua>;tag=6b081e8cb2be0cc593bdd08e52ae2811-dae0.
> Call-ID: 310582788-5060-10 at BA.CCC.B.CFD.
> CSeq: 20070 SUBSCRIBE.
> Expires: 180.
> Contact: <sip:sa at 10.222.0.17: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:9999 at 10.222.1.253:5060;transport=tcp' failed
> May 23 13:24:13 stb-bsip-TEST opensips[14672]:
> INFO:presence:send_notify_request: NOTIFY sip:9999 at g-voip.stb.ua via
> sip:9999 at 10.222.1.253:5060;transport=tcp on behalf of
> sip:2004 at g-voip.stb.ua for event dialog,
> to_tag=6b081e8cb2be0cc593bdd08e52ae2811-dae0, cseq=1
>
> 2013/5/23 Chusov Alexsandr <chusov.alexsandr at gmail.com>:
>> 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:9999 at 10.222.1.253:5060;transport=tcp' failed
>> May 23 12:29:37 stb-bsip-TEST opensips[13572]:
>> INFO:presence:send_notify_request: NOTIFY sip:9999 at g-voip.stb.ua via
>> sip:9999 at 10.222.1.253:5060;transport=tcp on behalf of
>> sip:2004 at g-voip.stb.ua 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:2004 at g-voip.stb.ua SIP/2.0.
>> Via: SIP/2.0/TCP 10.222.1.253:5060;branch=z9hG4bK1476817771;rport;alias.
>> From: <sip:9999 at g-voip.stb.ua>;tag=971365295.
>> To: <sip:2004 at g-voip.stb.ua>.
>> Call-ID: 1552429319-5060-10 at BA.CCC.B.CFD.
>> CSeq: 20070 SUBSCRIBE.
>> Contact: <sip:9999 at 10.222.1.253: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:9999 at g-voip.stb.ua>;tag=971365295.
>> To: <sip:2004 at g-voip.stb.ua>;tag=6b081e8cb2be0cc593bdd08e52ae2811-fcef.
>> Call-ID: 1552429319-5060-10 at BA.CCC.B.CFD.
>> CSeq: 20070 SUBSCRIBE.
>> Expires: 180.
>> Contact: <sip:sa at 10.222.0.17:5061;transport=tcp>.
>> Server: OpenSIPS (1.8.3-tls (x86_64/linux)).
>> Content-Length: 0.
>>
>> 2013/5/22 Bogdan-Andrei Iancu <bogdan at opensips.org>:
>>> 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" (
>>> 2083 at g-voip.stb.ua )
>>>
>>>         AOR:: 9999 at g-voip.stb.ua
>>>                 Contact:: sip:9999 at 10.222.1.253:5060;transport=tls Q=
>>>                         Expires:: 247
>>>                         Callid:: 311684349-5060-1 at BA.CCC.B.CFD
>>>                         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:: 2083 at g-voip.stb.ua
>>>                 Contact:: sip:2083 at 10.222.1.221:45266;transport=tls Q=
>>>                         Expires:: 88
>>>                         Callid:: 991321032-5060-1 at BA.CCC.B.CCB
>>>                         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 <bogdan at opensips.org>
>>>> 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:sa at 10.222.0.17: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:9999 at 10.222.1.253: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:9999 at 10.222.1.253:5060;transport=tls>
>>>>> DBG:core:mk_proxy: doing DNS lookup...
>>>>> DBG:tm:dlg2hash: 650
>>>>> DBG:tm:print_request_uri: sip:9999 at 10.222.1.253:5060;transport=tls
>>>>> ERROR:tm:msg_send: tcp_send failed
>>>>> ERROR:tm:t_uac: attempt to send to
>>>>> 'sip:9999 at 10.222.1.253: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:9999 at g-voip.stb.ua via
>>>>> sip:9999 at 10.222.1.253:5060;transport=tls on behalf of
>>>>> sip:1818 at g-voip.stb.ua 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
>>>>> Users at lists.opensips.org
>>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>
>>>



More information about the Users mailing list