[asterisk-bugs] [JIRA] (ASTERISK-29202) res_pjsip: Cannot send OPTIONS to endpoint when transport= is unset and multiple explicitly bound transports

Mark Murawski (JIRA) noreply at issues.asterisk.org
Thu Dec 10 10:34:16 CST 2020


    [ https://issues.asterisk.org/jira/browse/ASTERISK-29202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=253068#comment-253068 ] 

Mark Murawski commented on ASTERISK-29202:
------------------------------------------

I have physical interfaces for the transports and some aliased.  Here you go:

You could simulate with multiple nic's on a vm to replication my setup

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.13.13.38  netmask 255.255.255.0  broadcast 10.13.13.255
        inet6 fe80::250:56ff:fe98:d2b1  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:98:d2:b1  txqueuelen 1000  (Ethernet)
        RX packets 186100996  bytes 137264107722 (127.8 GiB)
        RX errors 0  dropped 11913  overruns 0  frame 0
        TX packets 130909291  bytes 178101476954 (165.8 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.13.13.39  netmask 255.0.0.0  broadcast 10.255.255.255
        ether 00:50:56:98:d2:b1  txqueuelen 1000  (Ethernet)

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1770465537  bytes 650315372471 (605.6 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1770465537  bytes 650315372471 (605.6 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet 10.1.2.20  netmask 255.255.255.255  destination 10.1.2.18
        inet6 fe80::b02a:ead8:6201:a8fb  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 100  (UNSPEC)
        RX packets 39711456  bytes 2097223819 (1.9 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 79349830  bytes 110789017750 (103.1 GiB)
        TX errors 0  dropped 9696 overruns 0  carrier 0  collisions 0

tun1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet 10.3.2.20  netmask 255.255.255.255  destination 10.3.2.19
        inet6 fe80::766:a7cb:ae9b:801b  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 100  (UNSPEC)
        RX packets 1271856  bytes 418111602 (398.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1135856  bytes 411590761 (392.5 MiB)
        TX errors 0  dropped 6 overruns 0  carrier 0  collisions 0

tun2: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet 10.20.1.1  netmask 255.255.255.255  destination 10.20.1.2
        inet6 fe80::ee4e:ab41:32d:7796  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 100  (UNSPEC)
        RX packets 31097351  bytes 43433594166 (40.4 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6679661  bytes 351878934 (335.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


>From the outside world, we have 
 WAN1 -> DNAT 10.13.13.38
and
 WAN2 -> DNAT 10.13.13.39


> res_pjsip: Cannot send OPTIONS to endpoint when transport= is unset and multiple explicitly bound transports
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-29202
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29202
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip
>    Affects Versions: 16.15.0
>            Reporter: Mark Murawski
>            Assignee: Unassigned
>            Severity: Minor
>
> Reasonably complex setup here, but nothing out of the ordinary.  We have multiple ways to get in and out of this box, and we need to make sure Asterisk uses the right settings for the right subnet!
> {noformat}
> --------------------------------
> pjsip.conf
> -------------------------------
> [transport-udp-lo]
> type                       = transport
> protocol                   = udp
> bind                       = 127.0.0.1:5060
> external_media_address     = 127.0.0.1
> external_signaling_address = 127.0.0.1
> external_signaling_port    = 5060
> allow_reload               = yes
> tos                        = cs3
> cos                        = 3
> [transport-udp-tun0]
> type                       = transport
> protocol                   = udp
> bind                       = 10.1.2.20:5060
> external_media_address     = 10.1.2.20
> external_signaling_address = 10.1.2.20
> external_signaling_port    = 5060
> allow_reload               = yes
> tos                        = cs3
> cos                        = 3
> local_net                  = 10.1.2.0/24
> [transport-udp-tun1]
> type                       = transport
> protocol                   = udp
> bind                       = 10.3.2.20:5060
> external_media_address     = 10.3.2.20
> external_signaling_address = 10.3.2.20
> external_signaling_port    = 5060
> allow_reload               = yes
> tos                        = cs3
> cos                        = 3
> local_net                  = 10.3.2.0/24
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ; WAN1 and traffic to PBX-A / PBX-B
> [transport-udp]
> type                       = transport
> protocol                   = udp
> bind                       = 10.13.13.38:5060
> external_media_address     = XX.YY.171.40
> external_signaling_address = XX.YY.171.40
> external_signaling_port    = 5060
> allow_reload               = yes
> tos                        = cs3
> cos                        = 3
> local_net                  = 192.168.181.0/24
> local_net                  = 10.13.13.0/24
> [transport-tcp]
> type                       = transport
> protocol                   = tcp
> bind                       = 10.13.13.38:5060
> external_media_address     = XX.YY.171.40
> external_signaling_address = XX.YY.171.40
> external_signaling_port    = 5060
> allow_reload               = yes
> tos                        = cs3
> cos                        = 3
> local_net                  = 192.168.181.0/24
> [transport-tcp-tls]
> type                       = transport
> protocol                   = tls
> bind                       = 10.13.13.38:5061
> external_media_address     = XX.YY.171.40
> external_signaling_address = XX.YY.171.40
> external_signaling_port    = 5060
> allow_reload               = yes
> tos                        = cs3
> cos                        = 3
> local_net                  = 192.168.181.0/24
> local_net                  = 10.13.13.0/24
> cert_file                  = /etc/asterisk/keys/asterisk.crt
> priv_key_file              = /etc/asterisk/keys/asterisk.key
> method                     = sslv23
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;; WAN2
> [transport-udp-wan2]
> type                       = transport
> protocol                   = udp
> bind                       = 10.13.13.39:5060
> external_media_address     = ZZ.QQ.5.40
> external_signaling_address = ZZ.QQ.5.40
> external_signaling_port    = 5060
> allow_reload               = yes
> tos                        = cs3
> cos                        = 3
> local_net                  = 192.168.181.0/24
> [transport-tcp-wan2]
> type                       = transport
> protocol                   = tcp
> bind                       = 10.13.13.39:5060
> external_media_address     = XX.YY.171.40
> external_signaling_address = XX.YY.171.40
> external_signaling_port    = 5060
> allow_reload               = yes
> tos                        = cs3
> cos                        = 3
> local_net                  = 192.168.181.0/24
> [transport-tcp-wan2-tls]
> type                       = transport
> protocol                   = tls
> bind                       = 10.13.13.39:5061
> external_media_address     = ZZ.QQ.5.40
> external_signaling_address = ZZ.QQ.5.40
> external_signaling_port    = 5060
> allow_reload               = yes
> tos                        = cs3
> cos                        = 3
> local_net                  = 192.168.181.0/24
> cert_file                  = /etc/asterisk/keys/asterisk.crt
> priv_key_file              = /etc/asterisk/keys/asterisk.key
> method                     = sslv23
> --------------------------------
> pjsip_wizard.conf - Via psql extconfig
> --------------------------------
>  21005    | type                            | wizard
>  21005    | accepts_registrations           | yes
>  21005    | accepts_auth                    | yes
>  21005    | aor/max_contacts                | 4
>  21005    | aor/remove_existing             | yes
>  21005    | endpoint/context                | cos_internal+local+ld
>  21005    | endpoint/callerid               | <21005>
>  21005    | endpoint/aggregate_mwi          | yes
>  21005    | endpoint/mailboxes              | 21005 at internal
>  21005    | endpoint/set_var                | __ExtenMailBox=21005 at internal
>  21005    | endpoint/set_var                | __Tenant=default
>  21005    | endpoint/set_var                | __DeviceType=Exten
>  21005    | endpoint/set_var                | __DeviceTenantName=default
>  21005    | endpoint/set_var                | __ExtenDevice=SIP/21005
>  21005    | endpoint/set_var                | __ExtenDeviceName=21005
>  21005    | endpoint/set_var                | __ExtenPhoneNum=21005
>  21005    | endpoint/set_var                | __ExtenPhoneGroup=internal
>  21005    | endpoint/ice_support            | no
>  21005    | inbound_auth/username           | 21005
>  21005    | inbound_auth/password           | correcthorsebatterystaple
>  21005    | outbound_auth/username          | 21005
>  21005    | outbound_auth/password          | correcthorsebatterystaple
>  21005    | aor/qualify_frequency           | 60
>  21005    | aor/qualify_timeout             | 2000
>  21005    | endpoint/allow                  | ulaw,alaw,adpcm,gsm
>  21005    | endpoint/allow_subscribe        | yes
>  21005    | endpoint/direct_media           | no
>  21005    | endpoint/disallow               | g723,slin,ilbc,lpc10,g729,speex,g726aal2,g722
>  21005    | endpoint/force_rport            | yes
>  21005    | endpoint/log_subscription_error | no
>  21005    | endpoint/rewrite_contact        | yes
>  21005    | endpoint/rtp_symmetric          | yes
>  21005    | endpoint/rtp_timeout            | 60
>  21005    | endpoint/rtp_timeout_hold       | 60
>  21005    | endpoint/send_pai               | yes
>  21005    | endpoint/send_rpid              | yes
>  21005    | endpoint/subscribe_context      | blf
>  21005    | endpoint/trust_id_inbound       | no
>  21005    | endpoint/trust_id_outbound      | yes
> --------------------------------
> {noformat}
> Notes:
> Setting transport=transport-udp will 'work' and pjsip can successfully send SIP OPTIONS to this endpoint/contact, but if say the endpoint initiates a call to Asterisk via transport-udp-tun0, obviously asterisk will respond on the wrong transport and things will not work.
> Generic setting of having NO transport= will allow INVITEs to process from this endpoint to Asterisk properly and two way audio is successful and all that good stuff.  But asterisk cannot 'reach' the endpoint, because now it considers it down
> --------------------------------
> The situation:
> {noformat}
> [2020-12-07 16:26:06.157] VERBOSE[19882] res_pjsip_registrar.c: Added contact 'sip:21005 at AA.BB.184.42:56567;ob;x-ast-orig-host=192.168.125.103:56567' to AOR '21005' with expiration of 60 seconds
> [2020-12-07 17:12:19.060] ERROR[3674] res_pjsip.c: Error 171060 'Unsupported transport (PJSIP_EUNSUPTRANSPORT)' sending OPTIONS request to endpoint 21005
> {noformat}
> NOTIFY doesn't work either.... here's the core debug level 9
> {noformat}
> [2020-12-07 21:53:09.056] DEBUG[3674] res_pjsip_registrar.c: Refreshed contact 'sip:21005 at AA.BB.184.42:56567;ob;x-ast-orig-host=192.168.125.103:56567' on AOR '21005' with new expiration of 60 seconds
> [2020-12-07 21:53:09.056] DEBUG[3674] netsock2.c: Splitting 'AA.BB.184.42' into...
> [2020-12-07 21:53:09.056] DEBUG[3674] netsock2.c: ...host 'AA.BB.184.42' and port ''.
> [2020-12-07 21:53:09.056] DEBUG[3674] res_pjsip_nat.c: Re-wrote Contact URI port to 5060
> [2020-12-07 21:53:09.056] DEBUG[3674] res_pjsip_nat.c: Restoring contact 38.94.171.40:5060  to 192.168.125.103:56567
> [2020-12-07 21:53:09.056] DEBUG[25739] res_pjsip_mwi.c: Sending unsolicited MWI NOTIFY to endpoint 21005, new messages: 0, old messages: 0
> [2020-12-07 21:53:09.059] DEBUG[25739] config.c: extract double from [3.0] in [-inf, inf] gives [3.000000](0)
> [2020-12-07 21:53:09.059] DEBUG[25739] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
> [2020-12-07 21:53:09.059] DEBUG[25739] config.c: extract double from [2000.000000] in [-inf, inf] gives [2000.000000](0)
> [2020-12-07 21:53:09.059] DEBUG[25739] config.c: extract uint from [56567] in [0, 4294967295] gives [56567](0)
> [2020-12-07 21:53:09.059] DEBUG[25739] config.c: extract uint from [60] in [0, 86400] gives [60](0)
> [2020-12-07 21:53:09.059] DEBUG[25739] res_pjsip.c: 0x7f27ac03d400: Wrapper created
> [2020-12-07 21:53:09.059] DEBUG[25739] res_pjsip/pjsip_resolver.c: Performing SIP DNS resolution of target 'AA.BB.184.42'
> [2020-12-07 21:53:09.059] DEBUG[25739] res_pjsip/pjsip_resolver.c: Transport type for target 'AA.BB.184.42' is 'UDP transport'
> [2020-12-07 21:53:09.059] DEBUG[25739] res_pjsip/pjsip_resolver.c: Target 'AA.BB.184.42' is an IP address, skipping resolution
> [2020-12-07 21:53:09.059] DEBUG[25739] res_pjsip.c: 0x7f27ac03d400: PJSIP tsx response received
> [2020-12-07 21:53:09.059] DEBUG[25739] res_pjsip.c: 0x7f27ac03d400: Callbacks executed
> [2020-12-07 21:53:09.059] ERROR[25739] res_pjsip.c: Error 171060 'Unsupported transport (PJSIP_EUNSUPTRANSPORT)' sending NOTIFY request to endpoint 21005
> [2020-12-07 21:53:09.059] DEBUG[25739] res_pjsip.c: 0x7f27ac03d400: wrapper destroyed
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list