[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
Wed Dec 9 21:45:16 CST 2020


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

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

With WAN2 completely removed.  I get a different error, all else being equal:

[2020-12-09 22:36:57.757] ERROR[24546]: res_pjsip.c:4361 endpt_send_request: Error 120022 'Invalid argument' sending OPTIONS request to endpoint 21005

This endpoint/contact is coming in via tun0 transport
Same thing occurs when coming in via tun1
Same things occurs when coming in via wan1 (transport-udp)

> 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: Mark Murawski
>            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