Asterisk 16.1.1 not responding to SIP options request from SIP provider

This is an Azure install of Asterisk 16.1.1. The installation is using SIP not PJSIP. The SIP is re-registering every 30 seconds because Asterisk is not responding to the SIP provider option request. This creates an alert on the provider side which blocks all calls to the SIP.

How can i see the Option request from the provider in the console or logs? qualify=yes is set in sip.conf

i already have one asterisk server up and running as expected without any problem. I don’t know if this is a problem with the providers config or asterisk.

CEESO-INTL01CLI> sip show registry
Host dnsmgr Username Refresh State Reg.Time
tlsnyc.granitevoip.com:5061 N username 24 Registered Thu, 14 Feb 2019 17:26:18
1 SIP registrations.
CEESO-INTL01
CLI>

[general]
tlsenable=yes
tlsbindaddr=serverIP
tlsdontverifyserver=YES
tlscertfile=/etc/asterisk/keys/asterisk.pem
tlscafile=/etc/asterisk/keys/ca.crt
tlscipher=ALL:!eNULL:!CBC:!SSLv2:!SSLv3:!DH:!DHE:!ADH:!DES:!MD5:!RC4:!3DES:!EXPORT:@STRENGTH
register => tls://username:password@tlsnyc.granitevoip.com:5061/username
context=from-pstn
externip = x.x.x.x
localnet = x.x.x.x

[GRANITE-TLS-SIP]
transport=tls
port=5061
encryption=yes
;media_encryption=sdes
;ignorecryptolifetime=yes
type=friend
secret=password
defaultuser=username
host=tlsnyc.granitevoip.com
dtmfmode=rfc2833
qualify=yes
context=from-pstn
canreinvite=no
disallow=all
allow=ulaw
allow=alaw
allow=gsm
insecure=invite,port

sip set debug on.

Note you have a copy and paste configuration based on a very outdated source.

Please explain David. are you speaking of using SIP and not PJSIP?

SIP Debug ON

Connected to Asterisk 16.1.1 currently running on CEESO-INTL01 (pid = 89095)
CEESO-INTL01CLI> sip set debug on
SIP Debugging enabled
CEESO-INTL01
CLI>
CEESO-INTL01CLI>
CEESO-INTL01
CLI>
CEESO-INTL01CLI>
CEESO-INTL01
CLI>
CEESO-INTL01CLI>
CEESO-INTL01
CLI>
CEESO-INTL01*CLI> sip reload
Reloading SIP
Reliably Transmitting (no NAT) to 162.223.83.245:5061:
OPTIONS sip:tlsnyc.granitevoip.com SIP/2.0
Via: SIP/2.0/TLS 10.27.189.133:5061;branch=z9hG4bK00739899
Max-Forwards: 70
From: “asterisk” sip:asterisk@10.27.189.133;tag=as457c2304
To: sip:tlsnyc.granitevoip.com
Contact: sip:asterisk@10.27.189.133:5061;transport=tls
Call-ID: 059021da6e8625fd2a72533b357e0855@10.27.189.133:5061
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 16.1.1
Date: Thu, 14 Feb 2019 18:21:32 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<— SIP read from TLS:162.223.83.245:5061 —>
SIP/2.0 200 OK
Call-ID: 059021da6e8625fd2a72533b357e0855@10.27.189.133:5061
CSeq: 102 OPTIONS
From: “asterisk” sip:asterisk@10.27.189.133;tag=as457c2304
To: sip:tlsnyc.granitevoip.com;tag=sip+1+81700108+4adca2be
Via: SIP/2.0/TLS 10.27.189.133:5061;received=52.232.129.229;branch=z9hG4bK00739899
Content-Length: 0
Supported: resource-priority, siprec, 100rel
Server: DC-SIP/2.0
Organization: Metaswitch Networks
Allow-Events: message-summary, refer, dialog, line-seize, presence, call-info, as-feature-event, calling-name
Allow: INVITE, ACK, CANCEL, BYE, REGISTER, OPTIONS, PRACK, UPDATE, SUBSCRIBE, NOTIFY, REFER, INFO, PUBLISH
Accept-Encoding: identity
Accept: application/sdp, application/simple-message-summary, message/sipfrag, application/isup, application/x-simple-call-service-info, multipart/mixed, application/broadsoft, application/hook-flash, application/vq-rtcpxr, application/media_control+xml, application/dtmf-relay, text/plain, application/x-as-feature-event+xml, application/vnd.telekom.service_indication+xml, application/calling-name-info

<------------->
— (14 headers 0 lines) —
[Feb 14 18:21:33] NOTICE[89161]: chan_sip.c:15821 sip_reregister: – Re-registration for 5813196241@tlsnyc.granitevoip.com
REGISTER 12 headers, 0 lines
Reliably Transmitting (no NAT) to 162.223.83.245:5061:
REGISTER sip:tlsnyc.granitevoip.com:5061 SIP/2.0
Via: SIP/2.0/TLS 10.27.189.133:5061;branch=z9hG4bK280e519b
Max-Forwards: 70
From: sip:5813196241@tlsnyc.granitevoip.com;tag=as2fad55bb
To: sip:5813196241@tlsnyc.granitevoip.com
Call-ID: 61a19cf078c6781345e7ce3372f69fef@[fe80::20d:3aff:fef4:9a6c]
CSeq: 193 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 16.1.1
Authorization: Digest username=“5813196241”, realm=“tlsnyc.granitevoip.com”, algorithm=MD5, uri=“sip:tlsnyc.granitevoip.com:5061”, nonce=“36661b27dd27”, response=“7a25fd50608b4ed302f833f369c37c14”, qop=auth, cnonce=“6de6ffe4”, nc=0000005b
Expires: 120
Contact: sip:5813196241@10.27.189.133:5061;transport=tls
Content-Length: 0


Really destroying SIP dialog ‘059021da6e8625fd2a72533b357e0855@10.27.189.133:5061’ Method: OPTIONS

<— SIP read from TLS:162.223.83.245:5061 —>
SIP/2.0 200 OK
Via: SIP/2.0/TLS 10.27.189.133:5061;branch=z9hG4bK280e519b
Max-Forwards: 70
From: sip:5813196241@tlsnyc.granitevoip.com;tag=as2fad55bb
To: sip:5813196241@tlsnyc.granitevoip.com
Call-ID: 61a19cf078c6781345e7ce3372f69fef@[fe80::20d:3aff:fef4:9a6c]
CSeq: 193 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 16.1.1
Authorization: Digest username=“5813196241”, realm=“tlsnyc.granitevoip.com”, algorithm=MD5, uri=“sip:tlsnyc.granitevoip.com:5061”, nonce=“36661b27dd27”, response=“7a25fd50608b4ed302f833f369c37c14”, qop=auth, cnonce=“6de6ffe4”, nc=0000005b
Expires: 30
Contact: sip:5813196241@10.27.189.133:5061;transport=tls;expires=30
Content-Length: 0

<------------->
— (13 headers 0 lines) —
[Feb 14 18:21:33] NOTICE[89163]: chan_sip.c:24828 handle_response_register: Outbound Registration: Expiry for tlsnyc.granitevoip.com is 30 sec (Scheduling reregistration in 24 s)
Really destroying SIP dialog ‘61a19cf078c6781345e7ce3372f69fef@[fe80::20d:3aff:fef4:9a6c]’ Method: REGISTER
CEESO-INTL01*CLI> sip show registry
Host dnsmgr Username Refresh State Reg.Time
tlsnyc.granitevoip.com:5061 N 5813196241 24 Registered Thu, 14 Feb 2019 18:21:33
1 SIP registrations.
[Feb 14 18:21:58] NOTICE[89161]: chan_sip.c:15821 sip_reregister: – Re-registration for 5813196241@tlsnyc.granitevoip.com
REGISTER 12 headers, 0 lines
Reliably Transmitting (no NAT) to 162.223.83.245:5061:
REGISTER sip:tlsnyc.granitevoip.com:5061 SIP/2.0
Via: SIP/2.0/TLS 10.27.189.133:5061;branch=z9hG4bK3519619d
Max-Forwards: 70
From: sip:5813196241@tlsnyc.granitevoip.com;tag=as2fad55bb
To: sip:5813196241@tlsnyc.granitevoip.com
Call-ID: 61a19cf078c6781345e7ce3372f69fef@[fe80::20d:3aff:fef4:9a6c]
CSeq: 194 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 16.1.1
Authorization: Digest username=“5813196241”, realm=“tlsnyc.granitevoip.com”, algorithm=MD5, uri=“sip:tlsnyc.granitevoip.com:5061”, nonce=“36661b27dd27”, response=“6c2d07034408c34788c2b19c6ed1a9ed”, qop=auth, cnonce=“6763bf33”, nc=0000005c
Expires: 120
Contact: sip:5813196241@10.27.189.133:5061;transport=tls
Content-Length: 0


<— SIP read from TLS:162.223.83.245:5061 —>
SIP/2.0 200 OK
Via: SIP/2.0/TLS 10.27.189.133:5061;branch=z9hG4bK3519619d
Max-Forwards: 70
From: sip:5813196241@tlsnyc.granitevoip.com;tag=as2fad55bb
To: sip:5813196241@tlsnyc.granitevoip.com
Call-ID: 61a19cf078c6781345e7ce3372f69fef@[fe80::20d:3aff:fef4:9a6c]
CSeq: 194 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 16.1.1
Authorization: Digest username=“5813196241”, realm=“tlsnyc.granitevoip.com”, algorithm=MD5, uri=“sip:tlsnyc.granitevoip.com:5061”, nonce=“36661b27dd27”, response=“6c2d07034408c34788c2b19c6ed1a9ed”, qop=auth, cnonce=“6763bf33”, nc=0000005c
Expires: 30
Contact: sip:5813196241@10.27.189.133:5061;transport=tls;expires=30
Content-Length: 0

<------------->
— (13 headers 0 lines) —
[Feb 14 18:21:58] NOTICE[89163]: chan_sip.c:24828 handle_response_register: Outbound Registration: Expiry for tlsnyc.granitevoip.com is 30 sec (Scheduling reregistration in 24 s)
Really destroying SIP dialog ‘61a19cf078c6781345e7ce3372f69fef@[fe80::20d:3aff:fef4:9a6c]’ Method: REGISTER
– Remote UNIX connection
– Remote UNIX connection disconnected
– Remote UNIX connection
– Remote UNIX connection disconnected
– Remote UNIX connection
– Remote UNIX connection disconnected
– Remote UNIX connection
– Remote UNIX connection disconnected
– Remote UNIX connection
– Remote UNIX connection disconnected
– Remote UNIX connection
– Remote UNIX connection disconnected
– Remote UNIX connection
– Remote UNIX connection disconnected
– Remote UNIX connection
– Remote UNIX connection disconnected
– Remote UNIX connection
– Remote UNIX connection disconnected
– Remote UNIX connection
– Remote UNIX connection disconnected
– Remote UNIX connection
– Remote UNIX connection disconnected
[Feb 14 18:22:23] NOTICE[89161]: chan_sip.c:15821 sip_reregister: – Re-registration for 5813196241@tlsnyc.granitevoip.com
REGISTER 12 headers, 0 lines
Reliably Transmitting (no NAT) to 162.223.83.245:5061:
REGISTER sip:tlsnyc.granitevoip.com:5061 SIP/2.0
Via: SIP/2.0/TLS 10.27.189.133:5061;branch=z9hG4bK08ff3161
Max-Forwards: 70
From: sip:5813196241@tlsnyc.granitevoip.com;tag=as2fad55bb
To: sip:5813196241@tlsnyc.granitevoip.com
Call-ID: 61a19cf078c6781345e7ce3372f69fef@[fe80::20d:3aff:fef4:9a6c]
CSeq: 195 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 16.1.1
Authorization: Digest username=“5813196241”, realm=“tlsnyc.granitevoip.com”, algorithm=MD5, uri=“sip:tlsnyc.granitevoip.com:5061”, nonce=“36661b27dd27”, response=“e01987e06b137d54d520156d4565032a”, qop=auth, cnonce=“62c35850”, nc=0000005d
Expires: 120
Contact: sip:5813196241@10.27.189.133:5061;transport=tls
Content-Length: 0


<— SIP read from TLS:162.223.83.245:5061 —>
SIP/2.0 200 OK
Via: SIP/2.0/TLS 10.27.189.133:5061;branch=z9hG4bK08ff3161
Max-Forwards: 70
From: sip:5813196241@tlsnyc.granitevoip.com;tag=as2fad55bb
To: sip:5813196241@tlsnyc.granitevoip.com
Call-ID: 61a19cf078c6781345e7ce3372f69fef@[fe80::20d:3aff:fef4:9a6c]
CSeq: 195 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 16.1.1
Authorization: Digest username=“5813196241”, realm=“tlsnyc.granitevoip.com”, algorithm=MD5, uri=“sip:tlsnyc.granitevoip.com:5061”, nonce=“36661b27dd27”, response=“e01987e06b137d54d520156d4565032a”, qop=auth, cnonce=“62c35850”, nc=0000005d
Expires: 30
Contact: sip:5813196241@10.27.189.133:5061;transport=tls;expires=30
Content-Length: 0

<------------->
— (13 headers 0 lines) —
[Feb 14 18:22:23] NOTICE[89163]: chan_sip.c:24828 handle_response_register: Outbound Registration: Expiry for tlsnyc.granitevoip.com is 30 sec (Scheduling reregistration in 24 s)
Really destroying SIP dialog ‘61a19cf078c6781345e7ce3372f69fef@[fe80::20d:3aff:fef4:9a6c]’ Method: REGISTER
Reliably Transmitting (no NAT) to 162.223.83.245:5061:
OPTIONS sip:tlsnyc.granitevoip.com SIP/2.0
Via: SIP/2.0/TLS 10.27.189.133:5061;branch=z9hG4bK7809db1a
Max-Forwards: 70
From: “asterisk” sip:asterisk@10.27.189.133;tag=as1bc1ea04
To: sip:tlsnyc.granitevoip.com
Contact: sip:asterisk@10.27.189.133:5061;transport=tls
Call-ID: 3b7503eb649c11be75e639432d6fe1fc@10.27.189.133:5061
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 16.1.1
Date: Thu, 14 Feb 2019 18:22:32 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<— SIP read from TLS:162.223.83.245:5061 —>
SIP/2.0 200 OK
Call-ID: 3b7503eb649c11be75e639432d6fe1fc@10.27.189.133:5061
CSeq: 102 OPTIONS
From: “asterisk” sip:asterisk@10.27.189.133;tag=as1bc1ea04
To: sip:tlsnyc.granitevoip.com;tag=sip+3+bcee011f+d913be92
Via: SIP/2.0/TLS 10.27.189.133:5061;received=52.232.129.229;branch=z9hG4bK7809db1a
Content-Length: 0
Supported: resource-priority, siprec, 100rel
Server: DC-SIP/2.0
Organization: Metaswitch Networks
Allow-Events: message-summary, refer, dialog, line-seize, presence, call-info, as-feature-event, calling-name
Allow: INVITE, ACK, CANCEL, BYE, REGISTER, OPTIONS, PRACK, UPDATE, SUBSCRIBE, NOTIFY, REFER, INFO, PUBLISH
Accept-Encoding: identity
Accept: application/sdp, application/simple-message-summary, message/sipfrag, application/isup, application/x-simple-call-service-info, multipart/mixed, application/broadsoft, application/hook-flash, application/vq-rtcpxr, application/media_control+xml, application/dtmf-relay, text/plain, application/x-as-feature-event+xml, application/vnd.telekom.service_indication+xml, application/calling-name-info

<------------->
— (14 headers 0 lines) —
Really destroying SIP dialog ‘3b7503eb649c11be75e639432d6fe1fc@10.27.189.133:5061’ Method: OPTIONS
CEESO-INTL01*CLI>
Disconnected from Asterisk server
Asterisk cleanly ending (0).
Executing last minute cleanups
[root@CEESO-INTL01 asterisk]# ^C
[root@CEESO-INTL01 asterisk]#

Your configuration file was one for chan_sip.

Your log shows no incoming OPTIONS. On that basis you need to find out why they are not reaching Asterisk.

David, is this asterisk attempt to send options to SIP provider?

Reliably Transmitting (no NAT) to 162.223.83.245:5061:
OPTIONS sip:tlsnyc.granitevoip.com SIP/2.0
Via: SIP/2.0/TLS 52.232.129.229:5061;branch=z9hG4bK2a51728e
Max-Forwards: 70
From: “asterisk” sip:asterisk@52.232.129.229;tag=as35b2e49d
To: sip:tlsnyc.granitevoip.com
Contact: sip:asterisk@52.232.129.229:5061;transport=tls
Call-ID: 7d6fa99a5f9089642b0bbb1d45826944@52.232.129.229:5061
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 16.1.1
Date: Thu, 14 Feb 2019 19:55:19 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

It is, and the provider is replying to it.

thanks David, I’m going back to the provider. Asterisk is responding to their option request.

Hi David, I’m still working this problem with SIP provider trying to determine why the SIP provider is not receiving Asterisk reply to Options Polling. The SIP provider ask if Asterisk could be configured to reply to option polling by way of a different SIP proxy address over UDP. While still maintaining TLS SIP signaling and Voice.
Is something like this possible and how would sip.conf look?

Hi, I am implementing a sip proxy with kamailio and multiple asterisk servers, when kamailio send the OPTIONS asterisk don´t reply, and i see with sngrep tool that in the asterisk servers the SIP message OPTIONS arrives, but has no reply from asterisk, and enabling the sip debug nothing occurs, but the OPTIONS message between asterisk servers is all ok.

SIP Messages from kamailio to an asterisk server:

SIP Messages from another asterisk server: