Outbound sip reg no insterting entrys in ps_contacts

Good day

I just installed Asterisk 18.20.2. I was using asterisk 13 with Static configs and wanted to change to realtime. Asterisk is working but ps_contacts can only be updated by local endpoint and no entry for outbound sip registration. On cli it pjsip show conatcts, it shows and I can receive calls using static extension.conf file.

Another problem is inserting 2 cdr records for outbound calls. Local extensions is fine. On cli it also shows that 2 calls are made to local extension when getting a call from the public network.

Can someone please assist me if i need to change some configs.

Regards
Johannes

The ps_contacts is not used for outbound registration. It stores contacts from received REGISTER requests. You’d need to actually state your real problem.

As for CDR records, you haven’t shown any console output or explained what your dialplan is doing so it may or may not be correct.

Hi.

Thank you for your reply. Where do I get the outbound registration cause i use PHP to display all registered extensions?

CDR I have attached the image showing my dial plan. I managed to show DISTINCT in MYSQL but the database has 2 records that has the same uniqueid and the only different is digits after full stop “.”

Regards
Johannes[quote=“jmokoena, post:1, topic:101170, full:true”]
Good day

I just installed Asterisk 18.20.2. I was using asterisk 13 with Static configs and wanted to change to realtime. Asterisk is working but ps_contacts can only be updated by local endpoint and no entry for outbound sip registration. On cli it pjsip show conatcts, it shows and I can receive calls using static extension.conf file.

Another problem is inserting 2 cdr records for outbound calls. Local extensions is fine. On cli it also shows that 2 calls are made to local extension when getting a call from the public network.

Can someone please assist me if i need to change some configs.

Regards
Johannes
CDR in extension

Outbound registration configuration would be wherever you are storing it. State of outbound registrations is not stored in a database, and would have to be queried from Asterisk itself.

You would still need to show console output for the double CDR records. It may actually be two calls to Asterisk from the remote side, in which case it would be the remote side doing that.

PJSIP Logging enabled
<— Transmitting SIP request (556 bytes) to UDP:102.129.40.3:22544 —>
OPTIONS sip:royalfuneralservices-100@102.129.40.3:22544;rinstance=0e064ecb5966f3f1 SIP/2.0
Via: SIP/2.0/UDP 102.129.40.33:5060;rport;branch=z9hG4bKPjf5e1c835-bd0f-4d2b-b5f8-b64c33e139ab
From: sip:royalfuneralservices-100@102.129.40.33;tag=d5f7f7be-3cd9-4ee5-ab23-8ad6466868b9
To: sip:royalfuneralservices-100@102.129.40.3;rinstance=0e064ecb5966f3f1
Contact: sip:royalfuneralservices-100@102.129.40.33:5060
Call-ID: e00b7a0b-4722-4ca5-a822-d4244ef384e0
CSeq: 40439 OPTIONS
Max-Forwards: 70
User-Agent: Lucky Connect PBX
Content-Length: 0

<— Transmitting SIP request (433 bytes) to UDP:102.129.40.3:1046 —>
OPTIONS sip:lct-106@102.129.40.3:1046 SIP/2.0
Via: SIP/2.0/UDP 102.129.40.33:5060;rport;branch=z9hG4bKPja02ccdc2-049f-4b0f-bc31-0024da5af711
From: sip:lct-106@102.129.40.33;tag=841661a4-4655-4857-a0c1-73ad7ba827fd
To: sip:lct-106@102.129.40.3
Contact: sip:lct-106@102.129.40.33:5060
Call-ID: add11519-6458-4e5f-ad35-b11ed4af46b7
CSeq: 24558 OPTIONS
Max-Forwards: 70
User-Agent: Lucky Connect PBX
Content-Length: 0

<— Received SIP response (495 bytes) from UDP:102.129.40.3:1046 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 102.129.40.33:5060;rport=5060;branch=z9hG4bKPja02ccdc2-049f-4b0f-bc31-0024da5af711
From: sip:lct-106@102.129.40.33;tag=841661a4-4655-4857-a0c1-73ad7ba827fd
To: sip:lct-106@102.129.40.3;tag=698687296
Call-ID: add11519-6458-4e5f-ad35-b11ed4af46b7
CSeq: 24558 OPTIONS
Supported: replaces, path, timer
User-Agent: Grandstream GXP2140 1.0.7.99
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0

<— Received SIP request (1501 bytes) from UDP:102.129.40.40:5060 —>
INVITE sip:0155001@102.129.40.33:5060;line=ncghzfm SIP/2.0
Record-Route: sip:102.129.40.40;r2=on;ftag=as5729a97f;lr;did=e81.a3e
Record-Route: sip:102.129.40.40;transport=tcp;r2=on;ftag=as5729a97f;lr;did=e81.a3e
Via: SIP/2.0/UDP 102.129.40.40:5060;branch=z9hG4bKe505.896c16008d20400e4b0e62c778ab037b.0;i=9a3
Max-Forwards: 69
From: sip:+27835078100@102.129.40.40;tag=as5729a97f
To: sip:0155*001@102.129.40.40:5060
Call-ID: 6439cebe4bf9c7ab3ef5abfc09bab646@102.129.40.40:5050
Contact: sip:+27835078100@102.129.40.40:5060
CSeq: 102 INVITE
User-Agent: LUCKY CONNECT PBX
Date: Fri, 01 Mar 2024 15:27:22 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
X-voipnow-did: 27127860100
X-voipnow-extension: 0155
001
X-voipnow-pbx: ca92c0ccaf
X-voipnow-infrastructureid: 3d239932
X-voipnow-recording: disabled
Content-Type: application/sdp
Content-Length: 557

v=0
o=root 473869034 473869034 IN IP4 102.129.40.40
s=VoipNow
c=IN IP4 102.129.40.40
t=0 0
a=msid-semantic: WMS
m=audio 12156 RTP/AVP 18 101
c=IN IP4 102.129.40.40
a=rtcp:12157 IN IP4 102.129.40.40
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=ice-ufrag:06faec8e3dfc3ea976b727ae30b760f3
a=ice-pwd:711423cd063f43ab23fd5bc61c455438
a=candidate:1719740456 1 udp 2130706431 102.129.40.40 12156 typ host
a=candidate:1719740456 2 udp 2130706430 102.129.40.40 12157 typ host
a=sendrecv

<— Transmitting SIP response (735 bytes) to UDP:102.129.40.40:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 102.129.40.40:5060;rport=5060;received=102.129.40.40;branch=z9hG4bKe505.896c16008d20400e4b0e62c778ab037b.0;i=9a3
Record-Route: sip:102.129.40.40:5060;lr;r2=on;ftag=as5729a97f;did=e81.a3e
Record-Route: sip:102.129.40.40;transport=tcp;lr;r2=on;ftag=as5729a97f;did=e81.a3e
Call-ID: 6439cebe4bf9c7ab3ef5abfc09bab646@102.129.40.40:5050
From: sip:+27835078100@102.129.40.40;tag=as5729a97f
To: sip:0155*001@102.129.40.40;tag=z9hG4bKe505.896c16008d20400e4b0e62c778ab037b.0
CSeq: 102 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1709306842/69e3e7ffc2eb8bec109f8f4f00456058”,opaque=“4611533b5643db28”,algorithm=MD5,qop=“auth”
Server: Lucky Connect PBX
Content-Length: 0

<— Received SIP request (411 bytes) from UDP:102.129.40.40:5060 —>
ACK sip:0155*001@102.129.40.33:5060;line=ncghzfm SIP/2.0
Via: SIP/2.0/UDP 102.129.40.40:5060;branch=z9hG4bKe505.896c16008d20400e4b0e62c778ab037b.0;i=9a3
Max-Forwards: 69
From: sip:+27835078100@102.129.40.40;tag=as5729a97f
To: sip:0155*001@102.129.40.40;tag=z9hG4bKe505.896c16008d20400e4b0e62c778ab037b.0
Call-ID: 6439cebe4bf9c7ab3ef5abfc09bab646@102.129.40.40:5050
CSeq: 102 ACK
Content-Length: 0

<— Received SIP request (1715 bytes) from UDP:102.129.40.40:5060 —>
INVITE sip:0155001@102.129.40.33:5060;line=ncghzfm SIP/2.0
Record-Route: sip:102.129.40.40;transport=tcp;ftag=as5729a97f;lr;did=e81.a3e
Via: SIP/2.0/UDP 102.129.40.40;branch=z9hG4bKe505.896c16008d20400e4b0e62c778ab037b.1;i=9a3
Max-Forwards: 69
From: sip:+27835078100@102.129.40.40;tag=as5729a97f
To: sip:0155*001@102.129.40.40:5060
Call-ID: 6439cebe4bf9c7ab3ef5abfc09bab646@102.129.40.40:5050
Contact: sip:+27835078100@102.129.40.40:5060
CSeq: 102 INVITE
User-Agent: LUCKY CONNECT PBX
Date: Fri, 01 Mar 2024 15:27:22 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
X-voipnow-did: 27127860100
X-voipnow-extension: 0155
001
X-voipnow-pbx: ca92c0ccaf
X-voipnow-infrastructureid: 3d239932
X-voipnow-recording: disabled
Content-Type: application/sdp
Content-Length: 557
Authorization: Digest username=“0155001", realm=“asterisk”, nonce=“1709306842/69e3e7ffc2eb8bec109f8f4f00456058”, uri="sip:0155001@102.129.40.33:5060;line=ncghzfm”, opaque=“4611533b5643db28”, qop=auth, nc=00000001, cnonce=“2297680016”, response=“1f59acb3d3e2deded6aab2a3d2fb5b34”, algorithm=MD5

v=0
o=root 473869034 473869034 IN IP4 102.129.40.40
s=VoipNow
c=IN IP4 102.129.40.40
t=0 0
a=msid-semantic: WMS
m=audio 12156 RTP/AVP 18 101
c=IN IP4 102.129.40.40
a=rtcp:12157 IN IP4 102.129.40.40
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=ice-ufrag:06faec8e3dfc3ea976b727ae30b760f3
a=ice-pwd:711423cd063f43ab23fd5bc61c455438
a=candidate:1719740456 1 udp 2130706431 102.129.40.40 12156 typ host
a=candidate:1719740456 2 udp 2130706430 102.129.40.40 12157 typ host
a=sendrecv

<— Received SIP request (1715 bytes) from UDP:102.129.40.40:5060 —>
INVITE sip:0155001@102.129.40.33:5060;line=ncghzfm SIP/2.0
Record-Route: sip:102.129.40.40;transport=tcp;ftag=as5729a97f;lr;did=e81.a3e
Via: SIP/2.0/UDP 102.129.40.40;branch=z9hG4bKe505.896c16008d20400e4b0e62c778ab037b.2;i=9a3
Max-Forwards: 69
From: sip:+27835078100@102.129.40.40;tag=as5729a97f
To: sip:0155*001@102.129.40.40:5060
Call-ID: 6439cebe4bf9c7ab3ef5abfc09bab646@102.129.40.40:5050
Contact: sip:+27835078100@102.129.40.40:5060
CSeq: 102 INVITE
User-Agent: LUCKY CONNECT PBX
Date: Fri, 01 Mar 2024 15:27:22 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
X-voipnow-did: 27127860100
X-voipnow-extension: 0155
001
X-voipnow-pbx: ca92c0ccaf
X-voipnow-infrastructureid: 3d239932
X-voipnow-recording: disabled
Content-Type: application/sdp
Content-Length: 557
Authorization: Digest username=“0155001", realm=“asterisk”, nonce=“1709306842/69e3e7ffc2eb8bec109f8f4f00456058”, uri="sip:0155001@102.129.40.33:5060;line=ncghzfm”, opaque=“4611533b5643db28”, qop=auth, nc=00000001, cnonce=“2297680016”, response=“1f59acb3d3e2deded6aab2a3d2fb5b34”, algorithm=MD5

v=0
o=root 473869034 473869034 IN IP4 102.129.40.40
s=VoipNow
c=IN IP4 102.129.40.40
t=0 0
a=msid-semantic: WMS
m=audio 12156 RTP/AVP 18 101
c=IN IP4 102.129.40.40
a=rtcp:12157 IN IP4 102.129.40.40
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=ice-ufrag:06faec8e3dfc3ea976b727ae30b760f3
a=ice-pwd:711423cd063f43ab23fd5bc61c455438
a=candidate:1719740456 1 udp 2130706431 102.129.40.40 12156 typ host
a=candidate:1719740456 2 udp 2130706430 102.129.40.40 12157 typ host
a=sendrecv

<— Transmitting SIP response (435 bytes) to UDP:102.129.40.40:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 102.129.40.40;rport=5060;received=102.129.40.40;branch=z9hG4bKe505.896c16008d20400e4b0e62c778ab037b.1;i=9a3
Record-Route: sip:102.129.40.40:5060;lr;ftag=as5729a97f;did=e81.a3e
Call-ID: 6439cebe4bf9c7ab3ef5abfc09bab646@102.129.40.40:5050
From: sip:+27835078100@102.129.40.40;tag=as5729a97f
To: sip:0155*001@102.129.40.40
CSeq: 102 INVITE
Server: Lucky Connect PBX
Content-Length: 0

When Asterisk restart it receive 1 call fine but after some time it start receiving 2 calls.

Please assist.

That is a retransmitted INVITE, which would not result in two calls happening at once. Collecting Debug Information - Asterisk Documentation would be the instructions to follow to get an actual complete log.

Hi

kindly find attached file. It seems like pbx_realtime.c is excecuting twice.
debug_log_123456.txt (1.5 KB)

Regards
Johannes

I did core restart now and for about 5 minutes it was fine then back to the problem. I have attached another file showing the time it was ok and current state.

Regards
Johannes


ohannes

I see the above and it was not answered. That is the same thing I am getting.

Regards
Johannes

Good Morning

Did you manage to check the logs and assist with the problem?

Regards
Johannes

There is no SLA on forum posts, or any guarantee of a response. If I have anything of value to add I’ll respond in my own time.

Noted.

Anyone who can assist please.

Regards
Johannes

I have checked on my other system running asterisk 13 and there is no re-invite on sip. They are connected on the same trunk provider.

Anyone who can assist. Will also try to run another version of asterisk and test if maybe there might be a bug on the version I am running.

Regards
Johannes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.