Auto provision endpoints in Pjsip conf

Greeting to all.
I want to ask if there is a method to add endpoints to PJsip.conf from MySQL database . I have finished implementing CDR which logs call history to MySQL Databas. At least this confirms that Asterisk can connect to MySQL Database

I want to be able to auto provision endpoints in real time.I have been searching for documentation but the only one I can find is using sorcery.conf for Asterisk 12. I don’t know if there is an update for higher versions of Asterisk

Please is there anyone who can put me in the right direction?

COLLINS ONYEGBADO | B.Tech; Msc | CCNA; CCNP
Head, Hardware Maintenance Operations & Networking Unit.
Mobile: +2348064550911 | Voip:4001 | www.fuotuoke.edu.ng
ICT CENTER
FEDERAL UNIVERSITY OTUOKE, BYELSA STATE

But, do you understand the consequences of tightly coupling Asterisk to a database in general? That is: If your database has problems, then Asterisk can have problems.

Thanks for sharing the document. I understand the implications but I will test in a lab environment and see how it goes first. Then I will adopt other strategies to ensure scalability

Let me read the document
Thanks a lot

COLLINS ONYEGBADO | B.Tech; Msc | CCNA; CCNP
Head, Hardware Maintenance Operations & Networking Unit.
Mobile: +2348064550911 | Voip:4001 | www.fuotuoke.edu.ng
ICT CENTER
FEDERAL UNIVERSITY OTUOKE, BYELSA STATE

On Sun, Sep 28, 2025, 13:38 jcolp via Asterisk Community <notifications@asterisk.discoursemail.com> wrote:

jcolp Asterisk Project Lead
September 28

docs.asterisk.org

Setting up PJSIP Realtime - Asterisk Documentation

But, do you understand the consequences of tightly coupling Asterisk to a database in general? That is: If your database has problems, then Asterisk can have problems.


Visit Topic or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.

Thanks a lot sir
The Document was helpful. I have been able to Auto provision endpoints from my SQL Database. It wasn’t an easy task. A lot of troubleshooting was done since I didnt make use of Alembi to create tables

COLLINS ONYEGBADO | B.Tech; Msc | CCNA; CCNP
Head, Hardware Maintenance Operations & Networking Unit.
Mobile: +2348064550911 | Voip:4001 | www.fuotuoke.edu.ng
ICT CENTER
FEDERAL UNIVERSITY OTUOKE, BYELSA STATE

On Sun, Sep 28, 2025, 13:38 jcolp via Asterisk Community <notifications@asterisk.discoursemail.com> wrote:

jcolp Asterisk Project Lead
September 28

docs.asterisk.org

Setting up PJSIP Realtime - Asterisk Documentation

But, do you understand the consequences of tightly coupling Asterisk to a database in general? That is: If your database has problems, then Asterisk can have problems.


Visit Topic or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.

I set up a sip trunk from Asterisk to cisco cucm sip serve. The sip trunk is registered on Asterisk sip server
portsip endpoint 1603 is registered on Asterisk
1005 and 1003 are endpoints in cucm
issues

  1. 1603 calls 1005 (video and audio work very well) 1005 transfers the active call to 1003. 1003 says no video stream from the remote end and disables its video. From the log below, Asterisk is sending video = 0 when a call is transferred or re-invite. How do i force Asterisk to send video when a call is transferred .
    see log below
    – Called PJSIP/1005@CUCM-Trunk
    – PJSIP/CUCM-Trunk-00000003 is ringing

0x72b1f407a5f0 – Strict RTP learning after remote address set to: 172.16.48.249:16420
0x72b1f4071740 – Strict RTP learning after remote address set to: 172.16.48.249:16422
– PJSIP/CUCM-Trunk-00000003 answered PJSIP/1603-00000002
0x72b1f421bb60 – Strict RTP learning after remote address set to: 172.16.48.247:11700
0x72b1f4211c50 – Strict RTP learning after remote address set to: 172.16.48.247:11702
– Channel PJSIP/CUCM-Trunk-00000003 joined ‘simple_bridge’ basic-bridge <61c7fc45-cb3e-4e38-8820-a75893912847>
– Channel PJSIP/1603-00000002 joined ‘simple_bridge’ basic-bridge <61c7fc45-cb3e-4e38-8820-a75893912847>
0x72b1f407a5f0 – Strict RTP switching to RTP target address 172.16.48.249:16420 as source
0x72b1f421bb60 – Strict RTP switching to RTP target address 172.16.48.247:11700 as source
0x72b1f4211c50 – Strict RTP switching to RTP target address 172.16.48.247:11702 as source
(0x72b1f40713b0) RTP audio difference is 1561298621 set mark
[Oct 2 18:41:05] WARNING[7432][C-00000002]: res_rtp_asterisk.c:8272 ast_rtp_read: RTP Read too short
0x72b1f4071740 – Strict RTP switching to RTP target address 172.16.48.249:16422 as source
(0x72b1f4036600) RTP audio difference is 2116131509 set mark
(0x72b1f4036600) RTP audio difference is 13680 set mark
0x72b1f407a5f0 – Strict RTP learning complete - Locking on source address 172.16.48.249:16420
0x72b1f421bb60 – Strict RTP learning complete - Locking on source address 172.16.48.247:11700
0x72b1f4071740 – Strict RTP learning complete - Locking on source address 172.16.48.249:16422
0x72b1f4211c50 – Strict RTP learning complete - Locking on source address 172.16.48.247:11702
0x72b1f407a5f0 – Strict RTP learning after remote address set to: 0.0.0.0:16420
0x72b1f4071740 – Strict RTP learning after remote address set to: 0.0.0.0:16422
– Started music on hold, class ‘default’, on channel ‘PJSIP/1603-00000002’
– Stopped music on hold on PJSIP/1603-00000002
0x72b1f407a5f0 – Strict RTP learning after remote address set to: 172.17.67.14:4000
0x72b1f407a5f0 – Strict RTP qualifying stream type: audio
0x72b1f407a5f0 – Strict RTP switching source address to 172.17.67.14:24632
0x72b1f407a5f0 – Strict RTP learning complete - Locking on source address 172.17.67.14:24632
0x72b1f407a5f0 – Strict RTP learning after remote address set to: 0.0.0.0:4000
0x72b1f407a5f0 – Strict RTP learning after remote address set to: 172.16.48.248:16450
Bridge 61c7fc45-cb3e-4e38-8820-a75893912847: switching from simple_bridge technology to native_rtp
Locally RTP bridged ‘PJSIP/CUCM-Trunk-00000003’ and ‘PJSIP/1603-00000002’ in stack
Locally RTP bridged ‘PJSIP/CUCM-Trunk-00000003’ and ‘PJSIP/1603-00000002’ in stack
0x72b1f407a5f0 – Strict RTP switching to RTP target address 172.16.48.248:16450 as source
0x72b1f407a5f0 – Strict RTP learning complete - Locking on source address 172.16.48.248:16450
– Channel PJSIP/1603-00000002 left ‘native_rtp’ basic-bridge <61c7fc45-cb3e-4e38-8820-a75893912847>
== Spawn extension (default, 1005, 2) exited non-zero on ‘PJSIP/1603-00000002’
– Channel PJSIP/CUCM-Trunk-00000003 left ‘native_rtp’ basic-bridge <61c7fc45-cb3e-4e38-8820-a75893912847>

  1. cucm endpoints cant call Asterisk endpoints. I have AOR set up for cucm Trunk. I think there is another settings i need to be able receive incoming calls from cucm endpoints

i hope someone will put me in the right direction

You’ve provided console output, but none of the SIP signaling.

You need a type=identify section to match the Cisco signalling address.

For your first question, I think we need to see the complete signalling (“pjsip set logger on” output) for the call. Note that, if the roles were reversed, Asterisk would handle the transfer internally, so you should consider that possibility that the Cisco system is doing this.

here is the sip log.

webcall*CLI> pjsip set logger on
PJSIP Logging enabled
<— Received SIP request (1568 bytes) from UDP:172.16.48.247:8014 —>
INVITE sip:1005@webcall.collnetwork.net SIP/2.0
Via: SIP/2.0/UDP 172.16.48.247:8014;branch=z9hG4bK-524287-1—2c702a279370ac4b;rport
Max-Forwards: 70
Contact: <sip:1603@172.16.48.247:8014>;+sip.instance=“urn:uuid:c57ee66e-5a18-39ef-86aa-b7a9e6380e98
Call-ID: W9A7a43GNZr2hKT2F901rA..
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, REGISTER, SUBSCRIBE, INFO, PUBLISH, UPDATE
Content-Type: application/sdp
Supported: replaces, answermode, eventlist, park-info, outbound, path
User-Agent: PortSIP UC Client Android - v13.0.1
Allow-Events: hold, talk, conference, dialog, park-info
Content-Length: 823

v=0
o=- 4068249312115680929 2 IN IP4 172.16.48.247
s=-
t=0 0
m=audio 10200 RTP/AVP 105 101
c=IN IP4 172.16.48.247
a=mid:audio
a=sendrecv
a=rtpmap:105 opus/48000/2
a=rtcp-fb:105 transport-cc
a=fmtp:105 minptime=10;useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=ssrc:3825323576 cname:Wft1PfpYWMunRjfk
m=video 10202 RTP/AVP 125 120
c=IN IP4 172.16.48.247
a=mid:video
a=sendrecv
a=rtcp-rsize
a=rtpmap:125 H264/90000
a=rtcp-fb:125 goog-remb
a=rtcp-fb:125 transport-cc
a=rtcp-fb:125 ccm fir
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:120 VP8/90000
a=rtcp-fb:120 goog-remb
a=rtcp-fb:120 transport-cc
a=rtcp-fb:120 ccm fir
a=rtcp-fb:120 nack
a=rtcp-fb:120 nack pli
a=ssrc:378861730 cname:Wft1PfpYWMunRjfk

<— Transmitting SIP response (554 bytes) to UDP:172.16.48.247:8014 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 172.16.48.247:8014;rport=8014;received=172.16.48.247;branch=z9hG4bK-524287-1—2c702a279370ac4b
Call-ID: W9A7a43GNZr2hKT2F901rA..
CSeq: 1 INVITE
WWW-Authenticate: Digest realm=“collnetwork.net”,nonce=“1759504222/37df434aeb31f5ee3ff7bffbcf3343f8”,opaque=“6b8797fa7a39a6e8”,algorithm=MD5,qop=“auth”
Server: Asterisk PBX 22.2.0~dfsg+~cs6.15.60671435-2
Content-Length: 0

<— Received SIP request (354 bytes) from UDP:172.16.48.247:8014 —>
ACK sip:1005@webcall.collnetwork.net SIP/2.0
Via: SIP/2.0/UDP 172.16.48.247:8014;branch=z9hG4bK-524287-1—2c702a279370ac4b;rport
Max-Forwards: 70
Call-ID: W9A7a43GNZr2hKT2F901rA..
CSeq: 1 ACK
Content-Length: 0

<— Received SIP request (1869 bytes) from UDP:172.16.48.247:8014 —>
INVITE sip:1005@webcall.collnetwork.net SIP/2.0
Via: SIP/2.0/UDP 172.16.48.247:8014;branch=z9hG4bK-524287-1—8dd88e5d46596067;rport
Max-Forwards: 70
Contact: <sip:1603@172.16.48.247:8014>;+sip.instance=“urn:uuid:c57ee66e-5a18-39ef-86aa-b7a9e6380e98
Call-ID: W9A7a43GNZr2hKT2F901rA..
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, REGISTER, SUBSCRIBE, INFO, PUBLISH, UPDATE
Content-Type: application/sdp
Supported: replaces, answermode, eventlist, park-info, outbound, path
User-Agent: PortSIP UC Client Android - v13.0.1
Authorization: Digest username=“1603”,realm=“collnetwork.net”,nonce=“1759504222/37df434aeb31f5ee3ff7bffbcf3343f8”,uri=“sip:1005@webcall.collnetwork.net”,response=“c68eba393c0c8217a13ed8679d507ee0”,cnonce=“33787a0ff2e91e6fafc3803c1ea2b6d7”,nc=00000001,qop=auth,algorithm=MD5,opaque=“6b8797fa7a39a6e8”
Allow-Events: hold, talk, conference, dialog, park-info
Content-Length: 823

v=0
o=- 4068249312115680929 2 IN IP4 172.16.48.247
s=-
t=0 0
m=audio 10200 RTP/AVP 105 101
c=IN IP4 172.16.48.247
a=mid:audio
a=sendrecv
a=rtpmap:105 opus/48000/2
a=rtcp-fb:105 transport-cc
a=fmtp:105 minptime=10;useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=ssrc:3825323576 cname:Wft1PfpYWMunRjfk
m=video 10202 RTP/AVP 125 120
c=IN IP4 172.16.48.247
a=mid:video
a=sendrecv
a=rtcp-rsize
a=rtpmap:125 H264/90000
a=rtcp-fb:125 goog-remb
a=rtcp-fb:125 transport-cc
a=rtcp-fb:125 ccm fir
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:120 VP8/90000
a=rtcp-fb:120 goog-remb
a=rtcp-fb:120 transport-cc
a=rtcp-fb:120 ccm fir
a=rtcp-fb:120 nack
a=rtcp-fb:120 nack pli
a=ssrc:378861730 cname:Wft1PfpYWMunRjfk

<— Transmitting SIP response (355 bytes) to UDP:172.16.48.247:8014 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 172.16.48.247:8014;rport=8014;received=172.16.48.247;branch=z9hG4bK-524287-1—8dd88e5d46596067
Call-ID: W9A7a43GNZr2hKT2F901rA..
CSeq: 2 INVITE
Server: Asterisk PBX 22.2.0~dfsg+~cs6.15.60671435-2
Content-Length: 0

<— Transmitting SIP request (2115 bytes) to UDP:172.17.67.14:5060 —>
INVITE sip:1005@cucm-pub-west.fuotuoke.edu.ng:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.48.3:5060;rport;branch=z9hG4bKPj06681a35-d9c7-4c3b-8ed0-282cbfbe1bf4
Contact: <sip:asterisk@172.16.48.3:5060>
Call-ID: cd6a9c37-e9a0-45ab-a494-cc87c950df2c
CSeq: 28362 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 22.2.0~dfsg+~cs6.15.60671435-2
Content-Type: application/sdp
Content-Length: 1394

v=0
o=- 226567392 226567392 IN IP4 172.16.48.3
s=Asterisk
c=IN IP4 172.16.48.3
t=0 0
m=audio 15442 RTP/AVPF 107 9 0 8 101 103
a=ice-ufrag:02f4a4430e15252239e539e341c77948
a=ice-pwd:17d488c47e6bdabf3f918bba53def831
a=candidate:Hac103003 1 UDP 2130706431 172.16.48.3 15442 typ host
a=candidate:S665a64c5 1 UDP 1694498815 102.90.100.197 50250 typ srflx raddr 172.16.48.3 rport 15442
a=candidate:Hac103003 2 UDP 2130706430 172.16.48.3 15443 typ host
a=candidate:S665a64c5 2 UDP 1694498814 102.90.100.197 50251 typ srflx raddr 172.16.48.3 rport 15443
a=rtpmap:107 opus/48000/2
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/48000
a=fmtp:101 0-16
a=rtpmap:103 telephone-event/8000
a=fmtp:103 0-16
a=ptime:20
a=maxptime:60
a=sendrecv
m=video 13418 RTP/AVPF 99 100
a=ice-ufrag:66b1b0b620565ed02ad44bc771048e2c
a=ice-pwd:2efa8a34496bb71828ea3da21ad1b2e2
a=candidate:Hac103003 1 UDP 2130706431 172.16.48.3 13418 typ host
a=candidate:S665a64c5 1 UDP 1694498815 102.90.100.197 50252 typ srflx raddr 172.16.48.3 rport 13418
a=candidate:Hac103003 2 UDP 2130706430 172.16.48.3 13419 typ host
a=candidate:S665a64c5 2 UDP 1694498814 102.90.100.197 50253 typ srflx raddr 172.16.48.3 rport 13419
a=rtpmap:99 H264/90000
a=fmtp:99 packetization-mode=1;level-asymmetry-allowed=1;profile-level-id=42001F
a=rtpmap:100 VP8/90000
a=sendrecv

<— Received SIP response (380 bytes) from UDP:172.17.67.14:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 172.16.48.3:5060;rport;branch=z9hG4bKPj06681a35-d9c7-4c3b-8ed0-282cbfbe1bf4

Something is removing the To and From headers in the logs. I’m guessing it is a flawed attempt at redacting, as if it were real it would break so many systems that I doubt the code would have got anywhere near a user.

Also the logs have been screen scraped, which means there are no time stamps. Please use the actual log files.

Giving the missing headers, I don’t think I can really trust them, but the outgoing leg is received by CUCM and it is able to make the initial reply. It should get to a response or 200 or greater before any input comes from an address that differs from the one that is good for Trying.

The request is quite long, so it is possible that the response got fragmented and blocked by a firewall, as many people discard second and subsequent packets from fragmented messages. It’s got nowhere near a point where it would be valid to initate a transfer.

ok.i decided to test from cucm endpoint to asterisk endpoint but no video and audio.
from Asterisk endpoint to cucm endpoint, there is video and audio

*CLI> pjsip set logger on
PJSIP Logging enabled
*CLI> <— Transmitting SIP request (443 bytes) to UDP:172.16.48.247:8014 —>
OPTIONS sip:1603@172.16.48.247:8014 SIP/2.0
Via: SIP/2.0/UDP 172.16.48.3:5060;rport;branch=z9hG4bKPj87918e99-4260-4d64-93bb-ea79ab7cdb46
Contact: <sip:1603@172.16.48.3:5060>
Call-ID: 333cdf0a-a245-415b-a27d-f602ae9df9c1
CSeq: 33679 OPTIONS
Max-Forwards: 70
User-Agent: Asterisk PBX 22.2.0~dfsg+~cs6.15.60671435-2
Content-Length: 0

<— Received SIP response (753 bytes) from UDP:172.16.48.247:8014 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.48.3:5060;rport=5060;branch=z9hG4bKPj87918e99-4260-4d64-93bb-ea79ab7cdb46
Contact: sip:[172.16.48.247:8014](http://172.16.48.247:8014)
Call-ID: 333cdf0a-a245-415b-a27d-f602ae9df9c1
CSeq: 33679 OPTIONS
Accept: application/sdp, multipart/mixed, multipart/signed, multipart/alternative, application/vnd.3gpp.cw+xml
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, REGISTER, SUBSCRIBE, INFO, PUBLISH, UPDATE
Supported: replaces, answermode, eventlist, park-info, outbound, path
User-Agent: PortSIP UC Client Android - v13.0.1
Allow-Events: hold, talk, conference, dialog, park-info
Content-Length: 0

== Endpoint 1603 is now Reachable
– Contact 1603/sip:1603@172.16.48.247:8014 is now Reachable. RTT: 20.047 msec
[Oct 3 18:05:07] WARNING[15831]: res_rtp_asterisk.c:9632 stunaddr_resolve_callback: Resolution for stunaddr ‘stun.l.google.com’ returned TTL = 0. Recurring resolution was cancelled.
<— Transmitting SIP request (477 bytes) to UDP:172.17.67.14:5060 —>
OPTIONS sip:cucm-pub-west.fuotuoke.edu.ng:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.48.3:5060;rport;branch=z9hG4bKPjf4315695-3c76-45fb-8b68-1340181bf0f0
Contact: <sip:CUCM-Trunk@172.16.48.3:5060>
Call-ID: 591c0161-a476-4384-bebc-7c8ed9af4f03
CSeq: 46479 OPTIONS
Max-Forwards: 70
User-Agent: Asterisk PBX 22.2.0~dfsg+~cs6.15.60671435-2
Content-Length: 0

<— Received SIP response (482 bytes) from UDP:172.17.67.14:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.48.3:5060;rport;branch=z9hG4bKPjf4315695-3c76-45fb-8b68-1340181bf0f0

Hi,

I am in the middle of an installation of a FreePBX server into a network that has a CUCM server. I have audio only trunks in between the CUCM and the FreePBX server that work perfectly. I have not tried video on these even though I am using video phones on both the CUCM and FreePBX server.

If you are willing to post your problem on a NEW question thread I’ll take a look at it. However, you are hijacking a thread about autoprovisioning which has nothing to do with CUCM-to-Asterisk trunking. So I am not going to respond because nobody will be able to find this in the future.

It is bad form in public help forums to not stay on topic.

Thank you so much for your contributions. Thought I was the same who created the thread,I would create another thread .
Right now, I want to install freepbx and try .

COLLINS ONYEGBADO | B.Tech; Msc | CCNA; CCNP
Head, Hardware Maintenance Operations & Networking Unit.
Mobile: +2348064550911 | Voip:4001 | www.fuotuoke.edu.ng
ICT CENTER
FEDERAL UNIVERSITY OTUOKE, BYELSA STATE

On Sat, Oct 4, 2025, 10:43 TedM via Asterisk Community <notifications@asterisk.discoursemail.com> wrote:

TedM
October 4

Hi,

I am in the middle of an installation of a FreePBX server into a network that has a CUCM server. I have audio only trunks in between the CUCM and the FreePBX server that work perfectly. I have not tried video on these even though I am using video phones on both the CUCM and FreePBX server.

If you are willing to post your problem on a NEW question thread I’ll take a look at it. However, you are hijacking a thread about autoprovisioning which has nothing to do with CUCM-to-Asterisk trunking. So I am not going to respond because nobody will be able to find this in the future.

It is bad form in public help forums to not stay on topic.


Visit Topic or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.

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