SIP Trunk UNREACHABLE (but registered)

Hello,
I’m using Asterisk 11 with my SIP provider since years without problem, but now, I want to add another SIP provider (Movistar Spain).
This provider is my ISP, that offers telephone via VoIP, and I think it’s interesting use it in my Asterisk.
This provider uses a outboundproxy, and it’s the only difference between this new SIP provider.
I’ve connected my Asterisk directly to the router, because it uses VLAN’s for VoIP, ipTV, and Internet.
This is my trunk configuration in sip.con:

[movistar]
type=peer
username=96XXXXXXX
fromuser=96XXXXXXX
secret=96XXXXXXX
fromdomain=telefonica.net
host=10.31.255.134
outboundproxy=10.31.255.134
outboundproxyport=5070
port=5070
nat=force_rport,comedia
insecure=port,invite
dtmfmode=auto
disallow=all
allow=ulaw
allow=alaw
context=casa
qualify=yes
trustpid=yes

And I register it with:

register => 96XXXXXXX@telefonica.net:96XXXXXXX@10.31.255.134:5070/96XXXXXXX

The problem is that I’m registered, but UNREACHABLE:

sip show registry
Host                                    dnsmgr Username       Refresh State                Reg.Time                
10.31.255.134:5070                      N      96XXXXXXX@te        55 Registered           Tue, 01 Aug 2017 11:42:07

If i try to do a UPD connection, it works:

nc -u 10.31.255.134 5070
REGISTER sip:telefonica.net SIP/2.0
SIP/2.0 400 Missing CSeq Header
CSeq: 0 REGISTER

And with wireshark I can see the REGISTER call:

35   5.503121   172.28.12.120   10.31.255.134   SIP   431   Request: REGISTER sip:telefonica.net  (1 binding) | 93   16.794847   10.31.255.134   172.28.12.120   SIP   679   Status: 200 OK  (2 bindings) | 

But all the requests OPTIONS are ko:

2   0.203298   172.28.12.120   213.4.130.95   SIP   581   Request: OPTIONS sip:telefonica.net | 122   21.085087   172.28.12.120   213.4.130.95   SIP   581   Request: OPTIONS sip:telefonica.net | 

In fact, there are only outbounding calls to my provider (telefonica.net (213.4.130.95)), but not incoming calls (replies). I only can see timeouts in Asterisk:

    <--- SIP read from UDP:10.31.255.134:5070 --->SIP/2.0 408 Request Timeout 020351913
    Via: SIP/2.0/UDP 172.28.12.120:5060;received=10.26.129.182;branch=z9hG4bK251cff65;rport=5060
    From: "asterisk" <sip:96XXXXXXX@172.28.12.120>;tag=as1d6418e4
    To: <sip:10.31.255.134>;tag=0ccde71601b7bb0790caa95ddd7af3cf
    Call-ID: 45230ebd151c840c37a16bc36ff9a16b@172.28.12.120:5060
    CSeq: 102 OPTIONS
    Content-Length: 0

Anyone can help me?
Regards

Attach router voip configuration screenshot:


If I try to configure it since my Android, it works (CSipSipmple). :sob:

If OPTIONS don’t get through, you will need to disable qualify.

Yes, but with qualify disabled, the error persist.

-- Called SIP/6XXXXXXXX@movistar
[Aug  1 21:58:19] WARNING[2392]: chan_sip.c:4175 retrans_pkt: Retransmission timeout reached on transmission 5cbf239e10fa211d1d2a9e1f5da1d692@telefonica.net for seqno 102 (Critical Request) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 32000ms with no response
[Aug  1 21:58:19] WARNING[2392]: chan_sip.c:4204 retrans_pkt: Hanging up call 5cbf239e10fa211d1d2a9e1f5da1d692@telefonica.net - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).

Which packet is being timed out?

Are the correct contact headers being sent and received?

I think it’s my call, because it found a CHANUNAVAIL:

�INVITE sip:6XXXXXXXX@10.31.255.134:5070 SIP/2.0
�Via: SIP/2.0/UDP 172.28.12.120:5060;branch=z9hG4bK1b102cc8;rport
�Max-Forwards: 70
�From: "Clemente Casa" <sip:96XXXXXXX@telefonica.net>;tag=as716e862f
�To: <sip:6XXXXXXXX@10.31.255.134:5070>
�Contact: <sip:96XXXXXXX@172.28.12.120:5060>
�Call-ID: 54a7515d6f544fdb7d0fa4060188eced@telefonica.net
�CSeq: 102 INVITE
�User-Agent: Asterisk PBX
�Date: Thu, 03 Aug 2017 10:46:19 GMT
�Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
�Supported: replaces, timer
�Content-Type: application/sdp
�Content-Length: 277
[Aug  3 12:46:50] DEBUG[2392] chan_sip.c: Trying to put 'INVITE sip:' onto UDP socket destined for 10.31.255.134:5060
[Aug  3 12:46:51] WARNING[2392] chan_sip.c: Retransmission timeout reached on transmission 54a7515d6f544fdb7d0fa4060188eced@telefonica.net $
Packet timed out after 32000ms with no response
[Aug  3 12:46:51] WARNING[2392] chan_sip.c: Hanging up call 54a7515d6f544fdb7d0fa4060188eced@telefonica.net - no reply to our critical pack$
[Aug  3 12:46:51] DEBUG[2392] chan_sip.c: Setting SIP_ALREADYGONE on dialog 54a7515d6f544fdb7d0fa4060188eced@telefonica.net
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] channel.c: Hanging up channel 'SIP/movistar-00000051'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] chan_sip.c: Hangup call SIP/movistar-00000051, SIP callid 54a7515d6f544fdb7d0fa4060188eced@telefo$
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] chan_sip.c: Hanging up channel in state Down (not UP)
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] res_rtp_asterisk.c: Setting RTCP address on RTP instance '0x23d93b4'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] app_dial.c: Exiting with DIALSTATUS=CHANUNAVAIL.
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] pbx.c: Result of 'DIALSTATUS' is 'CHANUNAVAIL'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] pbx.c: Expression result is '0'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] pbx.c: Result of 'DIALSTATUS' is 'CHANUNAVAIL'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] pbx.c: Expression result is '0'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] pbx.c: Expression result is '0'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] pbx.c: Launching 'GotoIf'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] pbx.c: Not taking any branch
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] pbx.c: Launching 'Hangup'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] channel.c: Soft-Hanging up channel 'SIP/601-00000050'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] pbx.c: Spawn extension (casa,6XXXXXXXX,4) exited non-zero on 'SIP/601-00000050'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] channel.c: Soft-Hanging up channel 'SIP/601-00000050'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] channel.c: Hanging up channel 'SIP/601-00000050'
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] chan_sip.c: Hangup call SIP/601-00000050, SIP callid 142965194@172.28.12.121
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] chan_sip.c: Hanging up channel in state Ring (not UP)
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] res_rtp_asterisk.c: Setting RTCP address on RTP instance '0xb434355c'
[Aug  3 12:46:51] VERBOSE[9862][C-0000002e] chan_sip.c: Scheduling destruction of SIP dialog '142965194@172.28.12.121' in 8320 ms (Method: $
[Aug  3 12:46:51] VERBOSE[9862][C-0000002e] chan_sip.c:
�<--- Reliably Transmitting (NAT) to 172.28.12.121:5063 --->
�SIP/2.0 408 Request Timeout
�Via: SIP/2.0/UDP 172.28.12.121:5063;branch=z9hG4bK2319037921;received=172.28.12.121;rport=5063
�From: "Casa Cle" <sip:601@172.28.12.120>;tag=907508186
�To: <sip:6XXXXXXXX@172.28.12.120>;tag=as49ba119a
�Call-ID: 142965194@172.28.12.121
�CSeq: 2 INVITE
�Server: Asterisk PBX
�Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
�Supported: replaces, timer
�Content-Length: 0
�
�
�<------------>
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] chan_sip.c: *** SIP TIMER: Initializing retransmit timer on packet: Id  #347041
[Aug  3 12:46:51] DEBUG[9862][C-0000002e] chan_sip.c: Trying to put 'SIP/2.0 408' onto UDP socket destined for 172.28.12.121:5063
[Aug  3 12:46:51] DEBUG[2392] chan_sip.c: Destroying SIP dialog 54a7515d6f544fdb7d0fa4060188eced@telefonica.net
[Aug  3 12:46:51] VERBOSE[2392] chan_sip.c: Really destroying SIP dialog '54a7515d6f544fdb7d0fa4060188eced@telefonica.net' Method: INVITE
[Aug  3 12:46:51] DEBUG[2392] rtp_engine.c: Destroyed RTP instance '0x23d93b4'
[Aug  3 12:46:51] DEBUG[2186] devicestate.c: No provider found, checking channel drivers for SIP - movistar
[Aug  3 12:46:51] DEBUG[2186] chan_sip.c: Checking device state for peer movistar
[Aug  3 12:46:51] DEBUG[2186] devicestate.c: Changing state for SIP/movistar - state 1 (Not in use)
[Aug  3 12:46:51] DEBUG[2186] devicestate.c: device 'SIP/movistar' state '1'
[Aug  3 12:46:51] DEBUG[2405] app_queue.c: Device 'SIP/movistar' changed to state '1' (Not in use) but we don't care because they're not a $

172.28.12.120 is the Asterisk server, and 172.28.12.121 is the extension from i’m triying to call to the PSTN (6XXXXXXXX).

It is not just OPTIONS that is not getting through. INVITE, or the response isn’t, either.

You need to trace through your network and find where the request or response is getting lost.

CHANUNAVAIL was a secondary symptom of the underlying network problem.

First of all, thanks @david551 for your help.
Opening the dump with wireshark, I can see this:

  1. The extension (.121) request a INVITE to the Asterisk server (.120), to origin the call.
  2. Asterisk return a Unauthorized (I don’t know why)
  3. Asterisk request a INVITE to the SIP proxy (and the EXTENSION proxy)
  4. No responses from SIP trunk

Finally, Asterisk return timeout to the extension:

That unauthorised is completely normal for any peer that needs to be authenticated.

The rest doesn’t provide any more information other than the debugging, assuming that the packet capture was run on the machine running Asterisk. You need to find at which hop in the network the INVITE gets lost, or at which point the 401 from the ITSP gets lost. You know that is happening outside of the Asterisk machine.

Can you confirm that you do have suitable port forwarding on your NAT device? Also that you all your firewalls are set to pass SIP/UDP.

Hi,
it’s not problem with the NAT or the firewall, because I can use without problem my other SIP trunk, and, if I open CSIPSimple in my Android device, and connected to the router, I can register and make (and receive calls) from it.
The problem is the Asterisk configuration, because the LAN is the same, for that reason, I cannot found the solution.
Obviously, the dump was run on the Asterisk server.
I’m a bit crazy, I don’t know what happen, if it was a problem with the LAN, the softphones would not work…
Regards

hey @clemenlg , did you ever found the solution? i have the exact same issue when i converted from chan_sip to pjsip

Hello @NoFate. I finally solved the issue, but I don’t remember what I finally did. Sorry.
I’ll check my configuration, maybe I can remember something…
Regards

Ok, but do you still use sip or pjsip?

I have a similar issue here. Recently moved from chan_sip to pjsip and at various times all three external SIP accounts give me and endpoint not found on the invite.

This doesn’t happen with endpoints that are IP addresses based (SPA3102 and Yealink W60B) but only with DNS based endpoints. I have checked all the timeouts but they seem correct. I tried adding a qualify to 27 seconds (my firewall is set at 60 seconds for udp) and my ISPs SIP account has a qualify of 10 seconds (well if the invite is received). It is strange because I can see the endpoint when it says the endpoint is not found.

Hello Everyone,

First of all, I would like to apologize for commenting such an old thread, but my problem is pretty the same than @clemenlg started. Actually, I am using the same Home Assistant addon and my telco provider is the same (Movistar Spain -former Telefónica-). I am happy to open a new topic if necessary.

I open an issue in project’s Github but had no response yet. From my understanding, such Asterisk based addon works in the same way that Astrisk standalone, but with small differences. The most important one is that .conf files must be edited in a custom folder where you have to put a copy of the main file. Then, both the main and custom files are loaded. Main .conf files shall not be edited. Another thing is that commands have to be issued from an addon stdin service call, that’s the reason you will see below that commands are stated in the following way:

[12:21:25] INFO: Executing command from stdin: asterisk -rx '[COMMAND]'

I know that @clemenlg solved the issue although he did not remember how it was achieved. Then, I am just providing some information according to the point I am not able to move forward from. I need to be able to do an outbound call only, although I setup an inbound trunk as well for testing purposes.

I know SIP is deprecated, but given that I know a SIP account should work, I’d rather to setup SIP first. Once it is confirmed that SIP works, I will try to move to a JSIP config.

I am sorry if there is too much lines in the .conf files, but I have been doing a lot of trial&error, and honestly I am not sure at this point what it is there for a purpose or not.

For reference, I believe there is not any problem in regards of LAN configuration, because I have an ATA SIP device (Grandstream HT802) in my network that works fine. In addition, I can do calls with SessionTalk (a softphone App for iPhone) just providing the following information to the App config:

User = 949xxxxxx ; my FTTH VoIP number (my "landline" number)
Passport = 949xxxxxx ; same number
Domain/Port = telefonica.net:5060
Proxy/Port = 10.31.255.134:5070

My sip.conf (default) file content is the following:

; Note: this file has been modified from the Asterisk defaults to the add-on

[general]
udpbindaddr=0.0.0.0:5260
bindaddr=0.0.0.0:5260
protocol=udp

; TLS
tlsenable=yes
tlsbindaddr=0.0.0.0:5261
tlscertfile=/etc/asterisk/keys/asterisk.pem
tlscipher=ALL
tlsclientmethod=ALL

; HINTS
limitonpeers=yes
notifyringing=yes
notifyhold=yes
notifycid=yes
callcounter=yes

; AUTO GENERATED EXTENSIONS
#include sip_default.conf

; CUSTOM EXTENSIONS
#include sip_custom.conf

My actual sip.conf file content, which is inherited from the previous one is:

; Note: this file has been modified from the Asterisk defaults to the add-on

[general]
context=unauthenticated
allowguest=no
srvlookup=yes
udpbindaddr=0.0.0.0:5260
bindaddr=0.0.0.0:5260
protocol=udp
tcpenable=no
language=es
nat=force_rport,comedia
directmedia=off
localnet=192.168.0.0/255.255.255.0

; TLS
tlsenable=yes
tlsbindaddr=0.0.0.0:5261
tlscertfile=/etc/asterisk/keys/asterisk.pem
tlscipher=ALL
tlsclientmethod=ALL

register => 949xxxxxx@telefonica.net:949xxxxxx@10.31.255.134:5070

; HINTS
limitonpeers=yes
notifyringing=yes
notifyhold=yes
notifycid=yes
callcounter=yes

; AUTO GENERATED EXTENSIONS
#include sip_default.conf

; CUSTOM EXTENSIONS
#include sip_custom.conf

[Movistar](!)
type=peer
secret=949xxxxxx
insecure=port,invite
dtmfmode=auto
disallow=all
allow=ulaw,alaw
outboundproxy=10.31.255.134:5070

[MovistarOut](Movistar)
type=peer
secret=949xxxxxx
insecure=port,invite
dtmfmode=auto
disallow=all
allow=ulaw,alaw
outboundproxy=10.31.255.134:5070
fromuser=949xxxxxx
fromdomain=telefonica.net
host=telefonica.net
nat=force_rport,comedia
insecure=port,invite
dtmfmode=auto
trustrpid=yes


[MovistarIn](Movistar)
context=incoming
defaultuser=949xxxxxx
host=10.31.255.134
port=5060
qualify=no
trustrpid=yes

[MovistarOut]
type=registration
outbound_auth=949xxxxxx
server_uri=sip:telefonica.net
client_uri=sip:949xxxxxx@telefonica.net
retry_interval=10
contact_user=949xxxxxx
expiration=600
outboundproxy=10.31.255.134:5070
fromuser=949xxxxxx
fromdomain=telefonica.net
host=telefonica.net
nat=force_rport,comedia
insecure=port,invite
dtmfmode=auto
trustrpid=yes

[MovistarOut]
type = auth
username = 949xxxxxx
password = 949xxxxxx

My extensions.conf file is:

[globals]
trunk = SIP/MovistarOut

[dispositivos]
include = internos
include = moviles
include = gratuitos
include = nacionales
include = emergencias

[internos]
exten => 100,1,Dial(${ext100})
exten => 101,1,Dial(${ext101})
exten => 102,1,Dial(${ext102})

exten => 103,1,Answer()
exten => 104,2,Playback(tt-monkeys)
exten => 105,3,Hangup()

[moviles]
exten => _[67]XXXXXXXX,1,Dial(${trunk}/${EXTEN})

[gratuitos]
exten => _[89]00XXXXXX,1,Dial(${trunk}/${EXTEN})

[nacionales]
exten => _[89]ZXXXXXXX,1,Dial(${trunk}/${EXTEN})
exten => _[89]01XXXXXX,1,Dial(${trunk}/${EXTEN})
exten => _[89]02XXXXXX,1,Dial(${trunk}/${EXTEN})

[emergencias]
exten => 061,1,Dial(${trunk}/${EXTEN})
exten => 091,1,Dial(${trunk}/${EXTEN})
exten => 092,1,Dial(${trunk}/${EXTEN})
exten => 112,1,Dial(${trunk}/${EXTEN})

[incoming]
exten => s,1,Dial(${ext100}&${ext101},15)

My Asterisk output to sip show registry command is:

[12:21:25] INFO: Executing command from stdin: asterisk -rx 'sip show registry'
[Jul 26 12:21:25]     -- Remote UNIX connection
Host                                    dnsmgr Username       Refresh State                Reg.Time                 
10.31.255.134:5070                      N      949xxxxxx@te        55 Registered           Wed, 26 Jul 2023 12:21:08
1 SIP registrations.
[Jul 26 12:21:25]     -- Remote UNIX connection disconnected
Asterisk ending (0).

My Asterisk output to sip show peers is the following:

[12:21:14] INFO: Executing command from stdin: asterisk -rx 'sip show peers'
[Jul 26 12:21:14]     -- Remote UNIX connection
Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description                      
100/100                   (Unspecified)                            D  Yes        Yes            0        Unmonitored                                  
101/101                   (Unspecified)                            D  Yes        Yes            0        Unmonitored                                  
102/102                   (Unspecified)                            D  Yes        Yes            0        Unmonitored                                  
MovistarIn/949xxxxxx      10.31.255.134                               Yes        Yes            5060     Unmonitored                                  
MovistarOut               (Unspecified)                               Yes        Yes            0        Unmonitored                                  
5 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 4 offline]
[Jul 26 12:21:14]     -- Remote UNIX connection disconnected
Asterisk ending (0).

My Asterisk output to sip show peer MovistarOut is:

[12:43:06] INFO: Executing command from stdin: asterisk -rx 'sip show peer MovistarOut'
[Jul 26 12:43:06]     -- Remote UNIX connection
  * Name       : MovistarOut
  Description  : 
  Secret       : <Set>
  MD5Secret    : <Not set>
  Remote Secret: <Not set>
  Context      : unauthenticated
  Record On feature : automon
  Record Off feature : automon
  Subscr.Cont. : <Not set>
  Language     : es
  Tonezone     : <Not set>
  AMA flags    : Unknown
  Transfer mode: open
  CallingPres  : Presentation Allowed, Not Screened
  FromUser     : 949xxxxxx
  FromDomain   : telefonica.net Port 5060
  Callgroup    : 
  Pickupgroup  : 
  Named Callgr : 
  Nam. Pickupgr: 
  MOH Suggest  : 
  Mailbox      : 
  VM Extension : asterisk
  LastMsgsSent : 0/0
  Call limit   : 2147483647
  Max forwards : 0
  Dynamic      : No
  Callerid     : "" <>
  MaxCallBR    : 384 kbps
  Expire       : -1
  Insecure     : port,invite
  Force rport  : Yes
  Symmetric RTP: Yes
  ACL          : No
  ContactACL   : No
  DirectMedACL : No
  T.38 support : No
  T.38 EC mode : Unknown
  T.38 MaxDtgrm: 4294967295
  DirectMedia  : No
  PromiscRedir : No
  User=Phone   : No
  Video Support: No
  Text Support : No
  Ign SDP ver  : No
  Trust RPID   : Yes
  Send RPID    : No
  Path support : No
  Path         : N/A
  TrustIDOutbnd: Legacy
  Subscriptions: Yes
  Overlap dial : Yes
  Outb. proxy  : 10.31.255.134 
  DTMFmode     : auto
  Timer T1     : 500
  Timer B      : 32000
  ToHost       : telefonica.net
  Addr->IP     : (null)
  Defaddr->IP  : (null)
  Prim.Transp. : UDP
  Allowed.Trsp : UDP
  Def. Username: 
  SIP Options  : (none)
  Codecs       : (ulaw|alaw)
  Auto-Framing : No
  Status       : Unmonitored
  Useragent    : 
  Reg. Contact : 
  Qualify Freq : 60000 ms
  Keepalive    : 0 ms
  Sess-Timers  : Accept
  Sess-Refresh : uas
  Sess-Expires : 1800 secs
  Min-Sess     : 90 secs
  RTP Engine   : asterisk
  Parkinglot   : 
  Use Reason   : No
  Encryption   : No
  RTCP Mux     : No
[Jul 26 12:43:06]     -- Remote UNIX connection disconnected
Asterisk ending (0).

And finally, my response to issuing the command for dialing to my cellphone is:

[12:45:07] INFO: Executing command from stdin: asterisk -rx 'originate SIP/MovistarOut/686xxxxxx application Playback tt-monkeys'
[Jul 26 12:45:07]     -- Remote UNIX connection
[Jul 26 12:45:07]     -- Remote UNIX connection disconnected
Asterisk ending (0).

It is strange that the system is not displaying any relevant error or response. Of course, a call is not received.

That’s basically all the information I can share. I have read similar topics with this telco provider in some forums with similar topics. However, I haven’t found any definitive solution anywhere. I’d appreciate very much if someone can give a solution, any suggestion or help to move forward at least. Thanks!

Sésar

EDIT: After enabling SIP debug, I get the following response upon issuing the originate command as per above:

[13:40:49] INFO: Executing command from stdin: asterisk -rx 'originate SIP/MovistarOut/686xxxxxx application Playback tt-monkeys'
[Jul 26 13:40:49]     -- Remote UNIX connection
[Jul 26 13:40:49]     -- Remote UNIX connection disconnected
Asterisk ending (0).
[Jul 26 13:40:50] Really destroying SIP dialog '3f0166d931a97b7f791b9ebe7dd9330b@172.30.32.1:5260' Method: INVITE
[Jul 26 13:41:02] NOTICE[464]: chan_sip.c:15891 sip_reregister:    -- Re-registration for  949xxxxxx@10.31.255.134
[Jul 26 13:41:02] REGISTER 11 headers, 0 lines
[Jul 26 13:41:02] Reliably Transmitting (NAT) to 10.31.255.134:5070:
[Jul 26 13:41:02] REGISTER sip:telefonica.net SIP/2.0

[Jul 26 13:41:02] Via: SIP/2.0/UDP 192.168.0.100:5260;branch=z9hG4bK63c6aa0e;rport

[Jul 26 13:41:02] Max-Forwards: 70

[Jul 26 13:41:02] From: <sip:949xxxxxx@telefonica.net>;tag=as0658d1ee

[Jul 26 13:41:02] To: <sip:949xxxxxx@telefonica.net>

[Jul 26 13:41:02] Call-ID: 5646b04202c76a9248514535241b67a4@172.30.32.1

[Jul 26 13:41:02] CSeq: 190 REGISTER

[Jul 26 13:41:02] Supported: replaces, timer

[Jul 26 13:41:02] User-Agent: Asterisk PBX 20.2.1

[Jul 26 13:41:02] Expires: 120

[Jul 26 13:41:02] Contact: <sip:s@192.168.0.100:5260>

[Jul 26 13:41:02] Content-Length: 0

[Jul 26 13:41:02] 

[Jul 26 13:41:02] 
[Jul 26 13:41:02] ---
[Jul 26 13:41:02] 
[Jul 26 13:41:02] <--- SIP read from UDP:10.31.255.134:5070 --->
[Jul 26 13:41:02] SIP/2.0 200 OK
[Jul 26 13:41:02] Via: SIP/2.0/UDP 192.168.0.100:5260;received=10.29.1.241;branch=z9hG4bK63c6aa0e;rport=5260
[Jul 26 13:41:02] From: <sip:949xxxxxx@telefonica.net>;tag=as0658d1ee
[Jul 26 13:41:02] To: <sip:949xxxxxx@telefonica.net>;tag=aprqv2ii1gecd3pa6-legtm500000sb
[Jul 26 13:41:02] Call-ID: 5646b04202c76a9248514535241b67a4@172.30.32.1
[Jul 26 13:41:02] CSeq: 190 REGISTER
[Jul 26 13:41:02] P-Associated-URI: <sip:949xxxxxx@telefonica.net>
[Jul 26 13:41:02] P-Associated-URI: <tel:+34949xxxxxx>
[Jul 26 13:41:02] P-Associated-URI: <sip:f2018009635772_1@telefonica.net>
[Jul 26 13:41:02] Contact: <sip:s@192.168.0.100:5260>;expires=70
[Jul 26 13:41:02] Contact: <sip:949xxxxxx@10.29.3.206:5060;transport=udp>;expires=3588
[Jul 26 13:41:02] Service-Route: <sip:s@10.31.255.134:5070;transport=udp;lr>
[Jul 26 13:41:02] Content-Length: 0
[Jul 26 13:41:02] 
[Jul 26 13:41:02] <------------->
[Jul 26 13:41:02] --- (13 headers 0 lines) ---
[Jul 26 13:41:02] NOTICE[464]: chan_sip.c:24963 handle_response_register: Outbound Registration: Expiry for 10.31.255.134 is 70 sec (Scheduling reregistration in 55 s)
[Jul 26 13:41:02] Really destroying SIP dialog '5646b04202c76a9248514535241b67a4@172.30.32.1' Method: REGISTER

I have not been able to make outbound calls with SIP, so I switched to PJSIP. Now, calls work like a charm. However, I don’t figure out why CallerID is not being received in y cellphone, but I thing that’s a different topic, so in order to keep things tidy, I will open a new thread.

Cheers!