Call Declined By Unknown Reason

Hi,

We have 4 IoT devices that initially, in our office environment, were able to successfully register to our Asterisk server through WiFi, and establish VOIP calls with a mobile app.

Then, we deployed these 4 IoT devices to the field. They are all connected to the same WiFi, all in the same approximate location, but only 2 of the 4 devices are able to establish VOIP calls with the mobile app.

Does anyone have any idea, clues, or suggestions on what the problem might be?

They’d be wild guesses on the information provided. Generally for VoIP problems we would need the protocol logs enabled by pjsip or sip set logger commands, and general verbose logging at at least level 3. We are likely to need pjsip.conf or sip.conf, as appropriate, and may need extensions.conf.

If Asterisk is declining the call, the reason should be in the logs

Here is the log when the app calls received (Call Declined)
I used sip set debug on

== Setting global variable ‘SIPDOMAIN’ to ‘sip.domain.com

Executing [camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@testing:1] Dial (" PJSIP/userb914a506-b743-494b-a0ac-bad1414f5c8a-00000024 ", “”) in new stack

[Mar 22 22:56:49] WARNING [27680][C-00000020]: app_dial.c : 2298 dial_exec_full : Dial requires an argument (technology/resource)

== Spawn extension (testing, camerabcdae445-4887-4d5b-8b94-6593a8cc22f2, 1) exited non-zero on ‘PJSIP/userb914a506-b743-494b-a0ac-bad1414f5c8a-00000024’

extension.conf
[testing]
exten => _camera.,1,Dial({PJSIP_DIAL_CONTACTS({EXTEN})})

pjsip.config
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
external_media_address=My Amazon EC2 Asterisk Server Public IPv4 address
external_signaling_address=My Amazon EC2 Asterisk Server Public IPv4 address

I am also using Real time PJSIP configuration with MySQL database
The entry for camera and user inside ps_endpoints
transpot => transport-udp
context => testing
disallow => all
allow => ulaw
direct_media => no
rewrite_contact => yes
rtp_symmetric => yes

I assume you meant:

exten => _camera.,1,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})})

You don’t seem to have any type=aor section associated with the endpoint, so I don’t see how anything could have registered.

Hence or otherwise, the PJSIP_DIAL_CONTACTS function is evaluating to an empty string.

  1. When you paste a snippet, please use preformatted text tags (</> in the icon bar) so the forum doesn’t mung significant characters.
  2. If you actually included spaces around the dial string – don’t do that :slight_smile:
  3. If you used typographic quotes instead of plain single or double quotes, don’t do that.
  4. The dial string and the options should not be quoted.

This is the log message. Asterisk adds simple ASCII quotes when logging. The PJSIP string is the channel instance name, the channel being an implied parameter to all the dialplan applications. It isn’t a dialstring. This couldn’t contain spaces and I think the spaces are a transcription error.

The empty string is the complete set of parameters to Dial, which should have started with the actual dialstring.

That wouldn’t produce anything as you are not using chan_sip.

I stand corrected :slight_smile:

  1. Cut and paste – no transcribing. Also, no pictures.

From the real time pjsip, the aors is set inside the database under ps_aors
The setting for ps_aors is

id camerabcdae445-4887-4d5b-8b94-6593a8cc22f2
max_contacts 1000

https://wiki.asterisk.org/wiki/display/AST/Setting+up+PJSIP+Realtime
I have it set inside sorcery.conf

[res_pjsip] ; Realtime PJSIP configuration wizard

endpoint=realtime,ps_endpoints

auth=realtime,ps_auths

aor=realtime,ps_aors

domain_alias=realtime,ps_domain_aliases

contact=realtime,ps_contacts

[res_pjsip_endpoint_identifier_ip]

identify=realtime,ps_endpoint_id_ips

let me put the log here again, with text tags.

  == Setting global variable 'SIPDOMAIN' to 'sip.domain.com'
    -- Executing [camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@testing:1] Dial("PJSIP/userb914a506-b743-494b-a0ac-bad1414f5c8a-00000040", "") in new stack
[Mar 23 10:00:12] WARNING[31453][C-00000038]: app_dial.c:2298 dial_exec_full: Dial requires an argument (technology/resource)
  == Spawn extension (testing, camerabcdae445-4887-4d5b-8b94-6593a8cc22f2, 1) exited non-zero on 'PJSIP/userb914a506-b743-494b-a0ac-bad1414f5c8a-00000040'

Now, I used pjsip set logger on

<--- Received SIP request (1295 bytes) from UDP:92.55.XXX.XXX:48381 --->
INVITE sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com SIP/2.0
Via: SIP/2.0/UDP 92.55.XXX.XXX:48381;branch=z9hG4bK.82Q3~KYlu;rport
From: <sip:userb914a506-b743-494b-a0ac-bad1414f5c8a@sip.domain.com>;tag=zAsfRq69i
To: sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com
CSeq: 20 INVITE
Call-ID: 37PKzjpR5Q
Max-Forwards: 70
Supported: replaces, outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 554
Contact: <sip:userb914a506-b743-494b-a0ac-bad1414f5c8a@92.55.XXX.XXX:48381;transport=udp>;+sip.instance="<urn:uuid:a8bacfc4-92aa-4dcc-9464-e7bf84bfd15d>"
User-Agent: Unknown (belle-sip/1.6.3)

v=0
o=userb914a506-b743-494b-a0ac-bad1414f5c8a 2101 15 IN IP4 92.55.XXX.XXX
s=Talk
c=IN IP4 92.55.XXX.XXX
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7078 RTP/AVP 96 97 98 0 8 18 101 99 100
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1
a=rtpmap:97 speex/16000
a=fmtp:97 vbr=on
a=rtpmap:98 speex/8000
a=fmtp:98 vbr=on
a=fmtp:18 annexb=yes
a=rtpmap:101 telephone-event/48000
a=rtpmap:99 telephone-event/16000
a=rtpmap:100 telephone-event/8000
a=rtcp-fb:* trr-int 5000
a=rtcp-fb:* ccm tmmbr

<--- Transmitting SIP response (545 bytes) to UDP:92.55.XXX.XXX:48381 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 92.55.XXX.XXX:48381;rport=48381;received=92.55.XXX.XXX;branch=z9hG4bK.82Q3~KYlu
Call-ID: 37PKzjpR5Q
From: <sip:userb914a506-b743-494b-a0ac-bad1414f5c8a@sip.domain.com>;tag=zAsfRq69i
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=z9hG4bK.82Q3~KYlu
CSeq: 20 INVITE
WWW-Authenticate: Digest realm="asterisk",nonce="1616494155/af6df15adb95afef2a13187be814f2a1",opaque="16eb7f875ca5a6d2",algorithm=md5,qop="auth"
Server: Asterisk PBX 16.4.0
Content-Length:  0


<--- Received SIP request (546 bytes) from UDP:92.55.XXX.XXX:48381 --->
ACK sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com SIP/2.0
Via: SIP/2.0/UDP 92.55.XXX.XXX:48381;branch=z9hG4bK.82Q3~KYlu;rport
Call-ID: 37PKzjpR5Q
From: <sip:userb914a506-b743-494b-a0ac-bad1414f5c8a@sip.domain.com>;tag=zAsfRq69i
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=z9hG4bK.82Q3~KYlu
Contact: <sip:userb914a506-b743-494b-a0ac-bad1414f5c8a@92.55.XXX.XXX:48381;transport=udp>;+sip.instance="<urn:uuid:a8bacfc4-92aa-4dcc-9464-e7bf84bfd15d>"
Max-Forwards: 70
CSeq: 20 ACK


<--- Received SIP request (1655 bytes) from UDP:92.55.XXX.XXX:48381 --->
INVITE sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com SIP/2.0
Via: SIP/2.0/UDP 92.55.XXX.XXX:48381;branch=z9hG4bK.0Q7JRBO1B;rport
From: <sip:userb914a506-b743-494b-a0ac-bad1414f5c8a@sip.domain.com>;tag=zAsfRq69i
To: sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com
CSeq: 21 INVITE
Call-ID: 37PKzjpR5Q
Max-Forwards: 70
Supported: replaces, outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 554
Contact: <sip:userb914a506-b743-494b-a0ac-bad1414f5c8a@92.55.XXX.XXX:48381;transport=udp>;+sip.instance="<urn:uuid:a8bacfc4-92aa-4dcc-9464-e7bf84bfd15d>"
User-Agent: Unknown (belle-sip/1.6.3)
Authorization:  Digest realm="asterisk", nonce="1616494155/af6df15adb95afef2a13187be814f2a1", algorithm=md5, opaque="16eb7f875ca5a6d2", username="userb914a506-b743-494b-a0ac-bad1414f5c8a",  uri="sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com", response="dc48985add2296ce13533fc422fd0217", cnonce="ijmDYsqdTkoBvleD", nc=00000001, qop=auth

v=0
o=userb914a506-b743-494b-a0ac-bad1414f5c8a 2101 15 IN IP4 92.55.XXX.XXX
s=Talk
c=IN IP4 92.55.XXX.XXX
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7078 RTP/AVP 96 97 98 0 8 18 101 99 100
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1
a=rtpmap:97 speex/16000
a=fmtp:97 vbr=on
a=rtpmap:98 speex/8000
a=fmtp:98 vbr=on
a=fmtp:18 annexb=yes
a=rtpmap:101 telephone-event/48000
a=rtpmap:99 telephone-event/16000
a=rtpmap:100 telephone-event/8000
a=rtcp-fb:* trr-int 5000
a=rtcp-fb:* ccm tmmbr

  == Setting global variable 'SIPDOMAIN' to 'sip.domain.com'
<--- Transmitting SIP response (371 bytes) to UDP 92.55.XXX.XXX:48381 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 92.55.XXX.XXX:48381;rport=48381;received=92.55.XXX.XXX;branch=z9hG4bK.0Q7JRBO1B
Call-ID: 37PKzjpR5Q
From: <sip:userb914a506-b743-494b-a0ac-bad1414f5c8a@sip.domain.com>;tag=zAsfRq69i
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>
CSeq: 21 INVITE
Server: Asterisk PBX 16.4.0
Content-Length:  0


    -- Executing [camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@testing:1] Dial("PJSIP/userb914a506-b743-494b-a0ac-bad1414f5c8a-00000043", "") in new stack
[Mar 23 10:09:15] WARNING[31486][C-0000003b]: app_dial.c:2298 dial_exec_full: Dial requires an argument (technology/resource)
  == Spawn extension (testing, camerabcdae445-4887-4d5b-8b94-6593a8cc22f2, 1) exited non-zero on 'PJSIP/userb914a506-b743-494b-a0ac-bad1414f5c8a-00000043'
<--- Transmitting SIP response (436 bytes) to UDP:92.55.XXX.XXX:48381 --->
SIP/2.0 603 Decline
Via: SIP/2.0/UDP 92.55.XXX.XXX:48381;rport=48381;received=92.55.XXX.XXX;branch=z9hG4bK.0Q7JRBO1B
Call-ID: 37PKzjpR5Q
From: <sip:userb914a506-b743-494b-a0ac-bad1414f5c8a@sip.domain.com>;tag=zAsfRq69i
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=03e1ed3f-60a7-4836-a1fb-12e73c914f91
CSeq: 21 INVITE
Server: Asterisk PBX 16.4.0
Reason: Q.850;cause=0
Content-Length:  0


<--- Received SIP request (565 bytes) from UDP:92.55.XXX.XXX:48381 --->
ACK sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com SIP/2.0
Via: SIP/2.0/UDP 92.55.XXX.XXX:48381;branch=z9hG4bK.0Q7JRBO1B;rport
Call-ID: 37PKzjpR5Q
From: <sip:userb914a506-b743-494b-a0ac-bad1414f5c8a@sip.domain.com>;tag=zAsfRq69i
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=03e1ed3f-60a7-4836-a1fb-12e73c914f91
Contact: <sip:userb914a506-b743-494b-a0ac-bad1414f5c8a@92.55.XXX.XXX:48381;transport=udp>;+sip.instance="<urn:uuid:a8bacfc4-92aa-4dcc-9464-e7bf84bfd15d>"
Max-Forwards: 70
CSeq: 21 ACK

In this case, the protocol log isn’t relevant because it is quite clear that the problem is that PJSIP_DIAL_CONTACTS is returning an empty string causing the Dial application to fail.

How are you connecting the endpoint to the AOR?

Showing the output of “pjsip show contacts” would also be useful.

I do not see the device inside the contact list

  Contact:  <Aor/ContactUri..............................> <Hash....> <Status> <RTT(ms)..>
==========================================================================================

  Contact:  camera03019053-6b21-45a8-8e36-58e825df6bad/sip b0c1323cf1 NonQual         nan
  Contact:  camera077015f5-a593-4335-b32f-297cff70d3bc/sip c5d86fd119 NonQual         nan
  Contact:  camera07f63335-860d-4e69-98dc-006597afe28a/sip 4fac9f9aea NonQual         nan
  Contact:  camera1110739a-1aac-414d-b0b6-37adf0d65b38/sip 57ae38d1a4 NonQual         nan
  Contact:  camera12a27a0f-681f-424c-8422-0401c15ba14d/sip acc4b2a9a2 NonQual         nan
  Contact:  camera131ba7ff-12b0-4fb1-8f47-263fd9c41cc8/sip a7223b7f4b NonQual         nan
  Contact:  camera15678900-0abf-46c0-bcb0-ae49ece758d5/sip e3e1f0c0b2 NonQual         nan
  Contact:  camera15ac8de9-f470-485d-89ab-7222dc6f611c/sip cb60ba454a NonQual         nan
  Contact:  camera18105211-e5d2-43ec-bdf3-dcef94107c53/sip aa14257084 NonQual         nan
  Contact:  camera189bd9de-2bbe-460f-b179-be5526aa29c7/sip c69960319c NonQual         nan
  Contact:  camera1ca771dc-bc89-407d-8936-b67bf37305be/sip 5debe9ee04 NonQual         nan
  Contact:  camera1e227fbc-b1ee-4e43-8c59-d21f9552740f/sip 5055cacd40 NonQual         nan
  Contact:  camera1eb64ccf-3429-4dbf-bf4c-e8933279a7de/sip 3df0ec0625 NonQual         nan
  Contact:  camera21e99287-9749-4bb1-85cd-e5b8f17a9601/sip ad27ecaee2 NonQual         nan
  Contact:  camera23daae81-e1b8-4179-a3b1-78793f53673a/sip 7693d5f456 NonQual         nan
  Contact:  camera2557401d-64fa-43be-bba5-8f202ef8711e/sip 9c0b92768d NonQual         nan
  Contact:  camera2acac5b7-42b8-494e-9b5c-43229b101094/sip 8ca0b9867f NonQual         nan
  Contact:  camera2c76364b-422f-4e47-a73f-ef32536bf381/sip 93aa4b7d54 NonQual         nan
  Contact:  camera2d077440-4d25-485d-8928-73ad433cbe49/sip 87fb1a71ec NonQual         nan
  Contact:  camera2d7e7b10-de91-4449-a1ae-8fd46cda3524/sip e6084f22b8 NonQual         nan
  Contact:  camera2e93bf60-d6e4-475a-9f95-ca4def2f41ec/sip f118e53685 NonQual         nan
  Contact:  camera2f343363-64ba-4b55-b304-ce48142e4a74/sip cd358e0c30 NonQual         nan
  Contact:  camera32286bd1-1703-4f73-9a53-978c73fbc8c9/sip a5697a2146 NonQual         nan
  Contact:  camera34ef743b-ac38-4da5-9517-f8614d0eeb73/sip ea30241ad5 NonQual         nan
  Contact:  camera3570c031-9270-4216-a3f2-3119100ee4eb/sip 250ff072e1 NonQual         nan
  Contact:  camera393bda1c-1065-46d8-8159-e2295b326928/sip 553e970e56 NonQual         nan
  Contact:  camera3974c9c3-03c2-4ef6-94a9-7c5629ec0f44/sip bd135eea9f NonQual         nan
  Contact:  camera3a628dd5-de78-4b68-a246-eb88b17102af/sip ca16920fbc NonQual         nan
  Contact:  camera3c01c525-7a2b-4e4c-97a8-b928694ee8ee/sip c8b689a3fb NonQual         nan
  Contact:  camera3c27edb9-e329-45fb-9c74-059837feed80/sip e391176ab2 NonQual         nan
  Contact:  camera40383add-6381-4c04-8856-c9f5da0012db/sip 9bc99bb48a NonQual         nan
  Contact:  camera4178be5b-e632-4e95-af5d-cf077d4bf9ec/sip 5d41a911d7 NonQual         nan
  Contact:  camera4298bd75-b57b-4cd7-bf59-ee7a2ece6eea/sip 4ac6de4995 NonQual         nan
  Contact:  camera42d3a204-2616-4ea1-97cd-6520c9e99c05/sip f40b0ee183 NonQual         nan
  Contact:  camera43496ef3-baa4-4f3c-a181-c2f8d389fa58/sip 2f224b775c NonQual         nan
  Contact:  camera45c9835b-7976-4846-b342-7cf51030de0f/sip b9bf316493 NonQual         nan
  Contact:  camera4ac60ebd-31ce-4770-8066-831cf06367ce/sip 3fe26fc248 NonQual         nan
  Contact:  camera4ce4e47f-c171-422d-b802-715cd6afc5fb/sip 2d02da3969 NonQual         nan
  Contact:  camera4ceeea2e-7414-4d22-8c72-aadbce115caa/sip f04469c8a7 NonQual         nan
  Contact:  camera4d9cba16-552f-4ab2-87c7-90048d6b4c40/sip 2f0d0dfedb NonQual         nan
  Contact:  camera50eb463e-2b33-49cc-8da8-7691f9684cf4/sip 44da2b5687 NonQual         nan
  Contact:  camera51511a12-5964-4d89-a828-b4895f7304b3/sip a9b918bb8f NonQual         nan
  Contact:  camera5189969c-6fde-4293-a8e1-b1945a685a81/sip 1f8e26cc74 NonQual         nan
  Contact:  camera519a3683-1c53-48c8-b0aa-bd333ca8e1ed/sip 3e3006a635 NonQual         nan
  Contact:  camera51a73a06-42d9-4182-a2da-b8bab9a681e8/sip 4566b7f2ad NonQual         nan
  Contact:  camera51e8f7d3-9711-44d0-bb4d-adbfa763efb5/sip 5db0a1ee3a NonQual         nan
  Contact:  camera53947c63-9e5d-414c-b20b-719ae77faf4c/sip 29f9fa1ed7 NonQual         nan
  Contact:  camera539ae48c-9817-44d2-ac7a-e417258b2084/sip 987f853865 NonQual         nan
  Contact:  camera53bd9fb4-df54-4ae5-b24d-68095dcd0621/sip 5828260069 NonQual         nan
  Contact:  camera5615c6a7-a432-4840-b59e-06cc0e03b056/sip 1de6b5cec9 NonQual         nan
  Contact:  camera593808ec-1ebb-4b7b-a50f-f1189b3d9316/sip 6dc59381de NonQual         nan
  Contact:  camera5a898003-e5a8-44bb-9bcd-dea3d3537faf/sip 9206e2cc64 NonQual         nan
  Contact:  camera5a8bab21-6cf1-4627-b150-2947bf2d12e4/sip 6af8681a40 NonQual         nan
  Contact:  camera5c3cdec5-2ab0-4cae-972c-ca2484d86002/sip 12c03b97aa NonQual         nan
  Contact:  camera5d13ba3f-91b2-489c-b2b2-b3e345ec8e27/sip 03121b2531 NonQual         nan
  Contact:  camera5eaaa733-f920-4681-81cc-c1c5930edd98/sip 6fa8715416 NonQual         nan
  Contact:  camera5f3e6de6-b14f-4a9d-92be-34430a953088/sip 49fbc34fbf NonQual         nan
  Contact:  camera602d4640-37ff-4cd9-a6ee-8f5826ed47a3/sip b1d39e3c0d NonQual         nan
  Contact:  camera6246695e-c989-44ad-b738-f59cc2577c72/sip af02ef906f NonQual         nan
  Contact:  camera63f9cc07-eb4d-4d65-a601-f0814b61e0e5/sip 698f908734 NonQual         nan
  Contact:  camera64dd6358-34de-4847-bee2-ab68a69ffe9b/sip 2bc9fd747d NonQual         nan
  Contact:  camera67aa5d09-5986-4c96-b27b-6c480a0cf2e2/sip c5c7a3f0f9 NonQual         nan
  Contact:  camera67d3979e-40fd-4182-83aa-a7a2cccc9263/sip 3a66a9a0f3 NonQual         nan
  Contact:  camera685fe82e-ead6-4b20-b123-bd6bd486e37e/sip 4a83cb71dc NonQual         nan
  Contact:  camera6bf42365-9d48-41ed-a382-d7eeda6a6dbe/sip a9f796b110 NonQual         nan
  Contact:  camera6da0f0b3-504a-4b0f-a48f-5f725ac0b7f4/sip 596295b158 NonQual         nan
  Contact:  camera6e860d5c-d5bb-4886-ac87-4f52dbb3011c/sip df4e1f0e75 NonQual         nan
  Contact:  camera6ef19e13-4d9e-48a6-9fd2-30c3826489fb/sip 726f15eef2 NonQual         nan
  Contact:  camera7053fd74-4ea7-4d8c-9456-14efb00cf1b0/sip 547904732c NonQual         nan
  Contact:  camera71893a38-1875-461c-a01f-5c21b54f6ead/sip 8705c499f4 NonQual         nan
  Contact:  camera74d12f4c-d602-4264-a684-3f728fb07340/sip 8ec2b5edf5 NonQual         nan
  Contact:  camera75cf7ec2-9469-442c-8e32-dfa984cfcbce/sip 53c10f6c5a NonQual         nan
  Contact:  camera763e20bf-c8b2-40b8-a70e-12056436dccd/sip 236734b55f NonQual         nan
  Contact:  camera76472da3-de89-4b0e-9a28-4dc2263df9f6/sip 476f03313c NonQual         nan
  Contact:  camera76db2f17-3ac3-4030-986b-68b6d9511738/sip 78cb537ce1 NonQual         nan
  Contact:  camera79b1ccd1-3391-405d-b043-5d9665082b4b/sip 5d7b4efcd9 NonQual         nan
  Contact:  camera7bb6a121-d3e9-4576-82ce-84781f403d63/sip f99a5ac46b NonQual         nan
  Contact:  camera7c56ca6d-e3c9-452c-b8ad-6add5f2288de/sip 7decb920df NonQual         nan
  Contact:  camera7d1284d1-370b-4ae9-9805-f743f42c9f58/sip 836df6495c NonQual         nan
  Contact:  camera7e545d54-67ee-4359-9962-ec87f630d303/sip e73bf83310 NonQual         nan
  Contact:  camera82af7117-55cf-4605-ad71-7209b8285f0c/sip 71f12b24ab NonQual         nan
  Contact:  camera85c3f0b0-32c2-423a-bbe9-903be28c2f1e/sip 912e3f2453 NonQual         nan
  Contact:  camera882a8026-2d08-47e3-a131-fdf99fabfd8b/sip f05c204fd3 NonQual         nan
  Contact:  camera8be0d2a5-82cb-47c0-b848-9fd69e97ee37/sip f5fb36720c NonQual         nan
  Contact:  camera8d6d0880-75c2-48cf-b617-db1109de870b/sip d7b05d95ef NonQual         nan
  Contact:  camera8e686640-8eb9-4f9c-a0ec-fa0ce0061d3e/sip af2c1fc2e3 NonQual         nan
  Contact:  camera8fc83d26-185d-4daa-9ae2-09d54c903c42/sip d9d8d7983b NonQual         nan
  Contact:  camera905f3783-2769-4149-9144-a619bf41b1fa/sip bf850db444 NonQual         nan
  Contact:  camera932231fc-c9bd-429b-aa0f-119e03178134/sip 8acbe151a7 NonQual         nan
  Contact:  camera94059b2b-61ac-4ed9-a771-2cb13e728a32/sip 0e809ec399 NonQual         nan
  Contact:  camera950f3c7a-7131-425a-8197-76c7ae6e1fb5/sip 453c2f47d2 NonQual         nan
  Contact:  camera963b8433-64f9-4913-b700-5793a833ddf2/sip 05ada49fd2 NonQual         nan
  Contact:  camera98e24362-11d7-4180-aa59-a50e4330cc40/sip 75dbdd9e1c NonQual         nan
  Contact:  camera99bbcf6c-afc0-4c02-b526-c3a9a5396e9b/sip 6a14dd7623 NonQual         nan
  Contact:  camera9a5448f2-dae4-4578-87f0-95d20cf54bd2/sip 90dafed6ec NonQual         nan
  Contact:  camera9b1274b4-98b7-42ae-8fe2-c23027622b9e/sip 41698bb522 NonQual         nan
  Contact:  camera9c2754dd-1aef-4959-b2da-0c6c35710cd4/sip cdd99f7a41 NonQual         nan
  Contact:  camera9db53f99-d987-46a4-98d5-95016f1437f8/sip eaf5d00fbc NonQual         nan
  Contact:  camera9e3f0cbd-5768-4d75-ba7a-b225e1aecb63/sip fdc537c131 NonQual         nan
  Contact:  camera9e85bbc8-c969-448f-8354-1943be33b861/sip 74332a160e NonQual         nan
  Contact:  cameraa1f49eea-2949-4444-b09e-51dde633ce0d/sip f577a81c8d NonQual         nan
  Contact:  cameraa2e729c4-5d82-4220-a92f-6b88ef482f11/sip 5ee74d33f2 NonQual         nan
  Contact:  cameraa3272599-ce89-4bc8-a0ca-d8d9a16808e9/sip 98589e4a1a NonQual         nan
  Contact:  cameraa51f0149-3307-4492-8321-c53c04e5f9b4/sip 7a564d0df0 NonQual         nan
  Contact:  cameraa63c7e4d-c75c-4bc6-813a-e3ef138f17cc/sip 0b1b0ce2fd NonQual         nan
  Contact:  cameraa68f1116-02cc-46f7-9f17-238138458234/sip f85d032952 NonQual         nan
  Contact:  cameraac15c3bf-8b57-437d-9b42-090ba7e0e08f/sip 8db8f68ca5 NonQual         nan
  Contact:  cameraade262a1-c188-4c77-9618-13c7c4266c29/sip b2bb3cd3da NonQual         nan
  Contact:  cameraaf04ecf4-0347-42b4-9cd6-0e5b32f8111a/sip 83f25a4715 NonQual         nan
  Contact:  camerab00c0254-d540-45fc-b5db-deea8b5ff789/sip f82933a222 NonQual         nan
  Contact:  camerab0c6302b-3882-4fcf-af4e-4e4d14865365/sip 19be32cd9f NonQual         nan
  Contact:  camerab246a965-d65f-47ec-830a-14d81f44bc3a/sip 4fa3a91f89 NonQual         nan
  Contact:  camerab2bad5f8-1a2a-4f27-8fdf-e4e609fc3427/sip d4e6a55400 NonQual         nan
  Contact:  camerab4074cf2-77d3-4794-87d0-0bf50043abed/sip 2f190ced7f NonQual         nan
  Contact:  camerab5c29a69-1c8c-429e-aac7-146eba6c655e/sip 731e33a2ce NonQual         nan
  Contact:  camerab6fb47bb-0b59-4457-a5c6-63d1d677edf1/sip 6d31cd416b NonQual         nan
  Contact:  camerabc15a032-39a8-4d2a-a8b2-b02fd6052ec8/sip 075b87682e NonQual         nan
  Contact:  camerabc199086-f782-4a95-8295-5e41abe1eb05/sip 3af95afc8b NonQual         nan
  Contact:  camerabd32091f-de2c-4354-a0ac-ccce7d4a7a67/sip bc22c35e99 NonQual         nan
  Contact:  camerabda1abef-3d15-4f7b-a696-8eaf40a755c6/sip 268c962c3d NonQual         nan
  Contact:  camerabe4af4b2-0585-4d5c-97ea-ceb886f6c07b/sip c76245fa90 NonQual         nan
  Contact:  camerabe7fc477-d026-4dab-9371-a0143bf8463f/sip f10fa8105b NonQual         nan
  Contact:  camerabefa4296-dbb4-4d4e-ae30-ed75e531c112/sip cff8de3405 NonQual         nan
  Contact:  camerabf425993-405e-4f8c-a6c2-8c1baf6d0746/sip 28d5adbea6 NonQual         nan
  Contact:  camerabf8740a7-785d-4483-920d-2a3568945362/sip 96df414319 NonQual         nan
  Contact:  camerabf993072-e791-4536-9e32-8955469e9bf3/sip ddd8567e63 NonQual         nan
  Contact:  camerac0c077d6-1907-4808-9740-3b1f59d9c1b1/sip 36528b89bb NonQual         nan
  Contact:  camerac255c57e-bcba-45b9-abb0-d31a68080e4b/sip 43769e75b7 NonQual         nan
  Contact:  camerac40bb023-bbd6-4698-87c2-288de3e03935/sip beaec38254 NonQual         nan
  Contact:  camerac42ae819-e819-42d8-af35-76db00e47d93/sip cde3a735b4 NonQual         nan
  Contact:  camerac98aa82c-7f4e-492b-b299-46cb1f5ce08b/sip 9067bc605b NonQual         nan
  Contact:  cameracab01395-924c-4617-8c78-71e4d903283a/sip 6226bbea1a NonQual         nan
  Contact:  cameracbabc67d-e216-4c0b-8ab6-a40400b7aa65/sip 0aa50798af NonQual         nan
  Contact:  camerace6b40e1-23ea-4a89-ab5a-ed1033bfa47f/sip 2010677a63 NonQual         nan
  Contact:  camerad07b18a1-6679-47ad-b559-8acc2435835e/sip e538c727df NonQual         nan
  Contact:  camerad0b9be03-72c0-4329-b959-03cb0444c947/sip acc70c7159 NonQual         nan
  Contact:  camerad6c46e9c-a852-47b5-85c4-4c90044af201/sip bc7527882e NonQual         nan
  Contact:  camerad8bc28df-471f-40a8-b131-a9c9475a1f81/sip 6139bd4dae NonQual         nan
  Contact:  camerad9a8f190-420c-4428-ad4e-9a89cd86d183/sip bd66dd92d4 NonQual         nan
  Contact:  camerad9c2ab20-e783-454a-92ef-bb785e29cd8e/sip 394a1d572b NonQual         nan
  Contact:  cameradb49d299-0c44-42bc-accc-9bc4b0babd81/sip 0c037ba787 NonQual         nan
  Contact:  cameraddef4000-ee0f-4c1e-881f-43489f78c061/sip c7f1b6d93b NonQual         nan
  Contact:  camerae084f034-184f-4fb0-b0c5-8f0073396976/sip 29e8127047 NonQual         nan
  Contact:  camerae1b1580b-f879-49d6-84ad-7853e36194c5/sip a5f56bf07e NonQual         nan
  Contact:  camerae24ea9ca-d5ea-4416-9159-262761697bf7/sip 6254bd48c2 NonQual         nan
  Contact:  camerae2902183-423f-4bcc-b086-fb99b5c6a784/sip a86b962086 NonQual         nan
  Contact:  camerae4107853-bd46-464e-823e-569d7ed80249/sip 86921f2368 NonQual         nan
  Contact:  camerae445f2e7-004d-4590-8d2d-25ab1deb513c/sip 043f885450 NonQual         nan
  Contact:  camerae4b0cc22-c41a-45d3-9ac3-ff4785546f61/sip 8735dded63 NonQual         nan
  Contact:  camerae4ba3dcf-2f2c-45d1-9b94-c4d622f774eb/sip ab4ae46887 NonQual         nan
  Contact:  camerae5e44e76-da67-4708-af33-88de0f32a173/sip bb0d25e202 NonQual         nan
  Contact:  camerae6a20bd4-075d-4e08-9b62-5fb5bfe912e0/sip 17923a5a4a NonQual         nan
  Contact:  camerae940311b-48d7-43bf-b445-484031904a3e/sip dc945ab578 NonQual         nan
  Contact:  cameraea3bc443-3f5d-4912-9d60-9a3addac6ca1/sip 56e3f80d44 NonQual         nan
  Contact:  cameraea415dee-0751-4b97-876e-bf57599c4669/sip e1a396f85f NonQual         nan
  Contact:  cameraed5c041a-6418-4b3b-b9bb-bc3f66d22cf3/sip 735b763bde NonQual         nan
  Contact:  cameraf133f5cd-daee-4582-9b84-c17bdfa2ddb8/sip 223d115218 NonQual         nan
  Contact:  cameraf1dd220f-2cb7-4766-8f95-61e8bb351f23/sip 81b9e7f842 NonQual         nan
  Contact:  cameraf6f16795-8450-4203-aa88-d6918884190f/sip cf537adf5f NonQual         nan
  Contact:  cameraf88885e8-f570-464e-b679-fb06c381d472/sip 9328e9d039 NonQual         nan
  Contact:  cameraf8d7b768-0f3a-4c18-a785-2016206f56e6/sip e95caa1e46 NonQual         nan
  Contact:  cameraf8e6ea8a-68e0-4cfa-8ac6-31a554a16d20/sip 9fd5d7dd04 NonQual         nan
  Contact:  camerafb4a15a9-2a1b-4bc9-9a9d-462d8f1b1183/sip 3e1e40c506 NonQual         nan
  Contact:  camerafe264068-e622-43bd-82a8-6dd84ed7d3bf/sip 2711c644c4 NonQual         nan
  Contact:  camerafe4ead4c-66fa-40ac-afae-fdd029d7d1bc/sip 0447376da8 NonQual         nan

Then it is not registered and can not be called.

The endpoint connect aors in the ps_endpoints table using its id

ps_aors table

id camerabcdae445-4887-4d5b-8b94-6593a8cc22f2
max_contacts 1000

ps_endpoints table

id camerabcdae445-4887-4d5b-8b94-6593a8cc22f2
transport  transport-udp
aors  camerabcdae445-4887-4d5b-8b94-6593a8cc22f2
auth  camerabcdae445-4887-4d5b-8b94-6593a8cc22f2
context testing
disallow all
allow ulaw 
direct_media no
rewrite_contact yes
rtp_symmetic yes

Thanks, that make sense to me now.
So the device didn’t register successfully.

What could be the reason, it cannot be registered?
I have tested it in office environment, it worked before.
However, the device does not work when it deploys to the field.
Could it relate to the firewall issue? Is there anyway I can find it out?
I do not have access for the router setting at the field.

I don’t know your deployment or how things work, but break down the problem and isolate things:

  1. Is the device configured to connect to the right address for SIP?
  2. If Asterisk is behind NAT, is port forwarding set up and Asterisk configured to know it is behind NAT?
  3. Is Asterisk seeing the REGISTER request from it?
  4. Is Asterisk seeing the REGISTER request and sending a response, but not seeing a followup REGISTER with authentication?
  5. If the remote side is behind NAT is their endpoint configured to know it is behind NAT?
  1. Yes
  2. Cannot confirm, I do not have access to it, but it is a normal home network.
  3. I can see the register request
<--- Received SIP request (611 bytes) from UDP:36.XXX.XXX.XXX:12614 --->
REGISTER sip:sip.domain.com SIP/2.0
Via: SIP/2.0/UDP 192.168.0.100:5060;branch=z9hG4bKPj8wwhu1XPFLYdGVC1zatzmkWK4L0QNM7I;rport
Call-ID: mEjpsZTkoeElvy9q4nx9BbElVmk1hPWU
From: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=lWQaFSmtK4cnhTyiPhb7MOr6syTmjRLA
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>
CSeq: 44425 REGISTER
Max-Forwards: 70
Contact: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob>
Expires: 300
Allow: PRACK,INVITE,ACK,BYE,CANCEL,UPDATE,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,OPTIONS
Content-Length: 0


<--- Transmitting SIP response (644 bytes) to UDP:36.XXX.XXX.XXX:12614 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.0.100:5060;rport=12614;received=36.XXX.XXX.XXX;branch=z9hG4bKPj8wwhu1XPFLYdGVC1zatzmkWK4L0QNM7I
Call-ID: mEjpsZTkoeElvy9q4nx9BbElVmk1hPWU
From: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=lWQaFSmtK4cnhTyiPhb7MOr6syTmjRLA
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=z9hG4bKPj8wwhu1XPFLYdGVC1zatzmkWK4L0QNM7I
CSeq: 44425 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1616621673/1b9d5041f3bd3c9d8a7321c744efedfa",opaque="2c58e0bd2cd55434",algorithm=md5,qop="auth"
Server: Asterisk PBX 16.4.0
Content-Length:  0


<--- Received SIP request (936 bytes) from UDP:36.XXX.XXX.XXX:12614 --->
REGISTER sip:sip.domain.com SIP/2.0
Via: SIP/2.0/UDP 36.XXX.XXX.XXX:12614;branch=z9hG4bKPjrh1d55kR7-4QXnftyOzslOYKFd1uiKpX;rport
Call-ID: mEjpsZTkoeElvy9q4nx9BbElVmk1hPWU
From: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=lWQaFSmtK4cnhTyiPhb7MOr6syTmjRLA
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>
CSeq: 44426 REGISTER
Max-Forwards: 70
Contact: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob>
Expires: 300
Allow: PRACK,INVITE,ACK,BYE,CANCEL,UPDATE,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,OPTIONS
Authorization: Digest username="camerabcdae445-4887-4d5b-8b94-6593a8cc22f2",realm="asterisk",nonce="1616621673/1b9d5041f3bd3c9d8a7321c744efedfa",uri="sip:sip.domain.com",response="8b54f3d084aba30d242cdf2a982d7dc1",algorithm=MD5,cnonce="HTDJA0sk4f7UsWWiFji265sSDAf33HbL",opaque="2c58e0bd2cd55434",qop=auth,nc=00000001
Content-Length: 0


  == Endpoint camerabcdae445-4887-4d5b-8b94-6593a8cc22f2 is now Reachable
    -- Added contact 'sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob' to AOR 'camerabcdae445-4887-4d5b-8b94-6593a8cc22f2' with expiration of 300 seconds
<--- Transmitting SIP response (633 bytes) to UDP:36.XXX.XXX.XXX:12614 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 36.XXX.XXX.XXX:12614;rport=12614;received=36.XXX.XXX.XXX;branch=z9hG4bKPjrh1d55kR7-4QXnftyOzslOYKFd1uiKpX
Call-ID: mEjpsZTkoeElvy9q4nx9BbElVmk1hPWU
From: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=lWQaFSmtK4cnhTyiPhb7MOr6syTmjRLA
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=z9hG4bKPjrh1d55kR7-4QXnftyOzslOYKFd1uiKpX
CSeq: 44426 REGISTER
Date: Wed, 24 Mar 2021 21:34:33 GMT
Contact: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@52.80.127.76:12614;ob>;expires=299
Expires: 300
Server: Asterisk PBX 16.4.0
Content-Length:  0


<--- Received SIP request (693 bytes) from UDP:36.XXX.XXX.XXX:12614 --->
REGISTER sip:sip.domain.com SIP/2.0
Via: SIP/2.0/UDP 36.XXX.XXX.XXX:5060;branch=z9hG4bKPjEBBld-7UWO2WCGZJuj.Ez83mvy5xbcDt;rport
Call-ID: mEjpsZTkoeElvy9q4nx9BbElVmk1hPWU
From: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=VGkdVfCgUDmfKtqGhzzjLAfwYJAMluuV
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>
CSeq: 44427 REGISTER
Max-Forwards: 70
Contact: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob>,<sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob>;expires=0
Expires: 300
Allow: PRACK,INVITE,ACK,BYE,CANCEL,UPDATE,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,OPTIONS
Content-Length: 0


<--- Transmitting SIP response (644 bytes) to UDP:36.XXX.XXX.XXX:12614 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 36.XXX.XXX.XXX:5060;rport=12614;received=36.XXX.XXX.XXX;branch=z9hG4bKPjEBBld-7UWO2WCGZJuj.Ez83mvy5xbcDt
Call-ID: mEjpsZTkoeElvy9q4nx9BbElVmk1hPWU
From: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=VGkdVfCgUDmfKtqGhzzjLAfwYJAMluuV
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=z9hG4bKPjEBBld-7UWO2WCGZJuj.Ez83mvy5xbcDt
CSeq: 44427 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1616621673/1b9d5041f3bd3c9d8a7321c744efedfa",opaque="1d533dd075ac5bc5",algorithm=md5,qop="auth"
Server: Asterisk PBX 16.4.0
Content-Length:  0


<--- Received SIP request (1017 bytes) from UDP:36.XXX.XXX.XXX:12614 --->
REGISTER sip:sip.domain.com SIP/2.0
Via: SIP/2.0/UDP 36.XXX.XXX.XXX:5060;branch=z9hG4bKPj79T0XcBQy68ajNA3.fYiADJBK.GNrrzq;rport
Call-ID: mEjpsZTkoeElvy9q4nx9BbElVmk1hPWU
From: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=VGkdVfCgUDmfKtqGhzzjLAfwYJAMluuV
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>
CSeq: 44428 REGISTER
Max-Forwards: 70
Contact: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob>,<sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob>;expires=0
Expires: 300
Allow: PRACK,INVITE,ACK,BYE,CANCEL,UPDATE,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,OPTIONS
Authorization: Digest username="camerabcdae445-4887-4d5b-8b94-6593a8cc22f2",realm="asterisk",nonce="1616621673/1b9d5041f3bd3c9d8a7321c744efedfa",uri="sip:sip.domain.com",response="119721c467b3ac98af982242b84498bc",algorithm=MD5,cnonce="HTDJA0sk4f7UsWWiFji265sSDAf33HbL",opaque="1d533dd075ac5bc5",qop=auth,nc=00000002
Content-Length: 0


  == Contact camerabcdae445-4887-4d5b-8b94-6593a8cc22f2/sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob has been deleted
  == Endpoint camerabcdae445-4887-4d5b-8b94-6593a8cc22f2 is now Unreachable
    -- Removed contact 'sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob' from AOR 'camerabcdae445-4887-4d5b-8b94-6593a8cc22f2' due to request
<--- Transmitting SIP response (539 bytes) to UDP:36.XXX.XXX.XXX:12614 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 36.XXX.XXX.XXX:5060;rport=12614;received=36.XXX.XXX.XXX;branch=z9hG4bKPj79T0XcBQy68ajNA3.fYiADJBK.GNrrzq
Call-ID: mEjpsZTkoeElvy9q4nx9BbElVmk1hPWU
From: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=VGkdVfCgUDmfKtqGhzzjLAfwYJAMluuV
To: <sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@sip.domain.com>;tag=z9hG4bKPj79T0XcBQy68ajNA3.fYiADJBK.GNrrzq
CSeq: 44428 REGISTER
Date: Wed, 24 Mar 2021 21:34:33 GMT
Expires: 300
Server: Asterisk PBX 16.4.0
Content-Length:  0

  1. From the log above, I can see that the device attempted to register 2 times, the first time has 401 unauthorized. But in second attempt, I see the log it added the contact, then later on it removed the contact again. If it added the contact once before, does it mean it authorized in second attempt? But somehow the contact is removed again?
  == Endpoint camerabcdae445-4887-4d5b-8b94-6593a8cc22f2 is now Reachable
    -- Added contact 'sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob' to AOR 'camerabcdae445-4887-4d5b-8b94-6593a8cc22f2' with expiration of 300 seconds
.........
  == Contact camerabcdae445-4887-4d5b-8b94-6593a8cc22f2/sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob has been deleted
  == Endpoint camerabcdae445-4887-4d5b-8b94-6593a8cc22f2 is now Unreachable
    -- Removed contact 'sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob' from AOR 'camerabcdae445-4887-4d5b-8b94-6593a8cc22f2' due to request
  1. Cannot confirm, I do not have access to it, but it is a normal home network.

1 more thing caught my attention is this, removed contact due to request, is that mean the device requested to remove the contact itself?

    -- Removed contact 'sip:camerabcdae445-4887-4d5b-8b94-6593a8cc22f2@36.XXX.XXX.XXX:12614;ob' from AOR 'camerabcdae445-4887-4d5b-8b94-6593a8cc22f2' due to request

You really need to know this, and know quite a lot about NAT, if NAT applies, which it does here, and generally does on consumer grade services.

This problem applies. Either the response isn’t reaching the device, or the device is unable to respond, because it doesn’t know its password.

This problem also applies. It is behind NAT, and is only partly aware of that, in that it is correcting the Contact address, but not the Via address for NAT. However, given the rport on the Via, this might not be fatal.

Also, it looks like you have taken the logs from a screen scrape, which means there are no time stamps. If it were reacting correctly to the register responses, the next REGISTER would follow quickly, but if it isn’t, there will be a delay.

Thanks.
I checked the asterisk log under /etc/log/asterisk/messages, I do not see the same things as above.
I am not sure how to get the log with timestamp.

If I assume this is the NAT problem, is that mean I need to set an ICE server to solve this issue? With the signal and relay server, I think it can solve the NAT issue?

Generally you enable the full log, in logger.conf, as the protocol logging is in the VERBOSE (and DEBUG) category.