Incorrect IP in contact header

Exactly. It massively depends on how it’s customized / configured by the provider. Some providers document it more or less or another example here, others not at all (but it’s discussed on free forums as an example for Deutsche Telekom (which is listed as customer of Assia) where even employees of the provider are involved). Deutsche Telekom is rather aggressive. Restarting for a firmware update is ok. But regular restarts could be critical. If you want to do a restart, you should completely turn off the modem (= disconnect power) and wait for at least 15 minutes (that’s what’s guessed for Deutsche Telekom), to be sure, that DLM doesn’t rate it as an DSL line error. I read about users complaining about (massively) reduced bandwidth just because of a short thunderstorm. I don’t know how others react.

Yes - FreePBX doesn’t support it on the GUI - you have to do it via direct configuration in the configfiles (that’s why I mentioned the file names). You can find it under Administrator → Config edit.

BTW: you always need this “feature” if your IP address changes - the reason for the change is pretty irrelevant :slight_smile:

Maybe DLM was the reason for the disconnects? Now, your line is considered stable by DLM and it doesn’t need to “optimize” the DSL parameters any more. Did you check for changed DSL parameters after each change of the IP address? After a DSL resync you always will get a new IP address (if your provider doesn’t give you a static one).

Question, why hasnt there been any output of the transports that was asked for? Follow up, why has no one asked to see an actual call this happens on?

@dirk2358 Really interesting and definitely good to know! Even though I don’t think I ever had any problems, the throughput here is always nearly constant. I just found out about the Config Edit module. I will check that out tonight. Until now I always edited the custom files via SSH.
No, I didn’t check for changed DSL parameters, because since I noticed that problem the IP address didn’t change.

@BlazeStudios I couldn’t post the output of the transports when the issue occurs, because it didn’t occur since @Stewart1 requested those logs. I have a cronjob that will inform me the next time the IP address changes, but until then I don’t have them, so I cannot post them.

@AdFun7911 Your configured transports. Output what you have configured.

@BlazeStudios Oh, okay. I’m sorry, @Stewart1 said

so I waited for it to happen. But here you go:

pjsip show transports:

Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress....................>
==========================================================================================

Transport:  0.0.0.0-tls               tls      3     96  0.0.0.0:5061
Transport:  0.0.0.0-udp               udp      3     96  0.0.0.0:5060

Objects found: 2

pjsip show transport 0.0.0.0-tls:

Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress....................>
==========================================================================================

Transport:  0.0.0.0-tls               tls      3     96  0.0.0.0:5061

 ParameterName              : ParameterValue
 ======================================================================
 allow_reload               : false
 async_operations           : 1
 bind                       : 0.0.0.0:5061
 ca_list_file               : /etc/ssl/certs/ca.crt
 ca_list_path               :
 cert_file                  : /etc/asterisk/keys/cert.crt
 cipher                     :
 cos                        : 3
 domain                     :
 external_media_address     : domain.domain.domain
 external_signaling_address : domain.domain.domain
 external_signaling_port    : 0
 local_net                  : 172.17.0.0/255.255.0.0
 local_net                  : 172.19.0.0/255.255.0.0
 local_net                  : 172.17.0.0/255.255.0.0
 method                     : tlsv1
 password                   :
 priv_key_file              : /etc/asterisk/keys/key.key
 protocol                   : tls
 require_client_cert        : No
 symmetric_transport        : false
 tos                        : 96
 verify_client              : No
 verify_server              : Yes
 websocket_write_timeout    : 100

pjsip show endpoint 331:

 Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
  Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
   Identify:  <Identify/Endpoint.........................................................>
        Match:  <criteria.........................>
    Channel:  <ChannelId......................................>  <State.....>  <Time.....>
        Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================

 Endpoint:  331/331                                              Not in use    0 of inf
     InAuth:  331-auth/331
        Aor:  331                                                1
      Contact:  331/sips:331@<redacted external ip address of remote extension>:1066;transport 2c81f8d12c Avail        97.772


 ParameterName                      : ParameterValue
 ==========================================================================================
 100rel                             : yes
 accept_multiple_sdp_answers        : false
 accountcode                        :
 acl                                :
 aggregate_mwi                      : false
 allow                              : (g722|g726|alaw|ulaw|g723|g729|speex|speex16|speex32)
 allow_overlap                      : true
 allow_subscribe                    : true
 allow_transfer                     : true
 allow_unauthenticated_options      : false
 aors                               : 331
 asymmetric_rtp_codec               : false
 auth                               : 331-auth
 bind_rtp_to_media_address          : false
 bundle                             : false
 call_group                         :
 callerid                           : "Test 331" <331>
 callerid_privacy                   : allowed_not_screened
 callerid_tag                       :
 connected_line_method              : invite
 contact_acl                        :
 context                            : from-internal
 cos_audio                          : 5
 cos_video                          : 4
 device_state_busy_at               : 0
 direct_media                       : true
 direct_media_glare_mitigation      : none
 direct_media_method                : invite
 disable_direct_media_on_nat        : false
 dtls_auto_generate_cert            : No
 dtls_ca_file                       :
 dtls_ca_path                       :
 dtls_cert_file                     :
 dtls_cipher                        :
 dtls_fingerprint                   : SHA-256
 dtls_private_key                   :
 dtls_rekey                         : 0
 dtls_setup                         : active
 dtls_verify                        : No
 dtmf_mode                          : rfc4733
 fax_detect                         : false
 fax_detect_timeout                 : 0
 follow_early_media_fork            : true
 force_avp                          : false
 force_rport                        : true
 from_domain                        :
 from_user                          :
 g726_non_standard                  : false
 ice_support                        : false
 identify_by                        : username,ip
 ignore_183_without_sdp             : false
 inband_progress                    : false
 incoming_mwi_mailbox               :
 language                           : de_DE
 mailboxes                          : 331@default
 max_audio_streams                  : 1
 max_video_streams                  : 1
 media_address                      :
 media_encryption                   : sdes
 media_encryption_optimistic        : false
 media_use_received_transport       : false
 message_context                    :
 moh_passthrough                    : false
 moh_suggest                        : default
 mwi_from_user                      :
 mwi_subscribe_replaces_unsolicited : yes
 named_call_group                   :
 named_pickup_group                 :
 notify_early_inuse_ringing         : false
 one_touch_recording                : true
 outbound_auth                      :
 outbound_proxy                     :
 pickup_group                       :
 preferred_codec_only               : false
 record_off_feature                 : apprecord
 record_on_feature                  : apprecord
 refer_blind_progress               : true
 rewrite_contact                    : true
 rpid_immediate                     : false
 rtcp_mux                           : false
 rtp_engine                         : asterisk
 rtp_ipv6                           : false
 rtp_keepalive                      : 0
 rtp_symmetric                      : true
 rtp_timeout                        : 30
 rtp_timeout_hold                   : 300
 sdp_owner                          : -
 sdp_session                        : Asterisk
 send_connected_line                : yes
 send_diversion                     : true
 send_history_info                  : false
 send_pai                           : true
 send_rpid                          : false
 set_var                            :
 srtp_tag_32                        : false
 stir_shaken                        : false
 sub_min_expiry                     : 0
 subscribe_context                  :
 suppress_q850_reason_headers       : false
 t38_udptl                          : false
 t38_udptl_ec                       : none
 t38_udptl_ipv6                     : false
 t38_udptl_maxdatagram              : 0
 t38_udptl_nat                      : false
 timers                             : yes
 timers_min_se                      : 90
 timers_sess_expires                : 1800
 tone_zone                          :
 tos_audio                          : 184
 tos_video                          : 136
 transport                          :
 trust_connected_line               : yes
 trust_id_inbound                   : true
 trust_id_outbound                  : false
 use_avpf                           : false
 use_ptime                          : false
 user_eq_phone                      : false
 voicemail_extension                :
 webrtc                             : no

So you have they same local network twice and you have conflicts.

Edit: Did the math wrong. But not sure why you need two /16s. Either way remove the duplicate.

And this is using Dynamic DNS?

If you can use a newer/better method than ‘tlsv1’ you should. tlsv1_2 is recommended in the absense of tlsv1_3

I don’t know why it’s there twice. I entered it just once in the GUI.
Yeah, I’m not having a Static IP Address.

@dicko Thanks for the hint, I didn’t notice that yet.

But no cure for your IP thingy I’m afraid.

@BlazeStudios I just figured out why it’s appearing there two times. I set the local network once in ‘Settings’ -> ‘Asterisk SIP Settings’ -> ‘General SIP Settings’ and another time in ‘Settings’ -> ‘Asterisk SIP Settings’ -> ‘SIP Settings [chan_pjsip]’ -> ‘0.0.0.0 (tls)’ -> ‘Local network’. I thought that’s how it’s supposed to be. Which one is wrong?

@dicko It seems like ‘Default’ is ‘tlsv1’ instead of the newer methods. Changed it now.

So, the IP address changed again and the issue occured. This time I didn’t use fwconsole restart but instead I tried a few other commands and checked in-between if that makes it work again:

dnsmgr refresh
dnsmgr reload
pjsip send register *all

The last one gave out the error Unable to load config file 'pjsip_wizard.conf', but none of them made a change, so I gave up. Around 30 minutes later I sent a call from a remote extension and then it magically worked. I didn’t change any configuration in those 30 minutes. But even worse, after 4 more hours I tried making another call from the same remote extension and it stopped working again. The IP address didn’t change during that time.

I have not the slightest explanation how this is possible.

And where is the call debug? Show us what is happening.

@BlazeStudios Here you go:

https://pastebin.freepbx.org/view/04a4b3c7

Are you in US/Canada or outside the US/Canada? PMCU (g711u) for the former, PMCA (g711a) for the latter. Do not use both.

1. a=rtpmap:8 PCMA/8000
2. a=rtpmap:0 PCMU/8000

So this echo test had no audio? What about a real call with two endpoints involved?

@BlazeStudios I always expected the more supported codecs the better, but I changed that now.
Exactly, it doesn’t matter which endpoints I use, there is always no audio at all (in both directions).

So there is still no audio, as of this moment? If that is the case what is your DynDNS domain resolving to from FreePBX itself

@BlazeStudios No audio, that’s right. Ping or host command from FreePBX itself shows that it resolves correctly to the external IP address. The same like on every other device.

I don’t believe that a real call would show more useful info with these logging settings. The 200 OK response has both an incorrect (local) Contact header (just like the similar thread) and c=IN IP4 <SERVER INTERNAL IP> (unlike the similar thread), so it explains why there was no audio.

It appears that either pjsip somehow decided the remote address was local, or something went wrong when it attempted to substitute the external address.

One thing that looks strange is that Direct Media is set for the extension. While an echo test of course could not actually use direct media, it’s conceivable that the test is wrong and turning this off will help.

For further debugging, turn on Enable Debug in Asterisk SIP Settings → [chan_pjsip]. I don’t know enough about pjsip to interpret the output, but hope that if you paste logs for a failing call and a working one, we’ll be able to see where things go astray.

Turn off direct media.

1 Like

So, I tried turning off Direct Media, but with no effect. Anyway I still left it turned off.
Then I had the idea to enable the option ‘Settings’ -> ‘Asterisk SIP Settings’ -> ‘SIP Settings [chan_pjsip]’ -> ‘Allow Transports Reload’ and applied the configuration. This made the issue (probably just temporarily) disappear. I also disabled it, because it’s not recommended.

Does anyone of you know where I can find the PJSIP Debug Log I just activated? I cannot find it next to the other logs.

Edit: I just checked pjsip show transport 0.0.0.0-tls and it still shows me the subnet two times, even though I removed it from ‘Settings’ -> ‘Asterisk SIP Settings’ -> ‘SIP Settings [chan_pjsip]’ -> ‘0.0.0.0 (tls)’ -> ‘Local network’ and now it’s only in ‘Settings’ -> ‘Asterisk SIP Settings’ -> ‘General SIP Settings’. What am I missing?