Two realtime engines

Hello, how can I use two realtime engines at one time?

sorcery.conf
;aor=config,pjsip.conf,criteria=type=aor
aor=realtime,ldap_ps_aors
aor=realtime,odbc_ps_aors

extconfig.conf
odbc_ps_aors => odbc,asterisk,ps_aors
ldap_ps_aors => ldap,"OU=test,DC=domain,DC=tld",ps_aors

For the above pjsip show aors shows aors always from ldap only, if I swap lines in sorcery.conf above then it will show aors from odbc only.

I’ve got Asterisk 16.7.0.

I don’t think you can.

Why not? Configuring sorcery for realtime and non-realtime data sources is possible as written here: https://wiki.asterisk.org/wiki/display/AST/Setting+up+PJSIP+Realtime#SettingupPJSIPRealtime-Optionallyconfiguringsorceryforrealtimeandnon-realtimedatasources

Correct, you can use both a static and realtime configuration together but that also means it’s 1 static and 1 realtime source. When you are adding the other realtime sources it can’t switch between the two. It’s going to use the first one read into memory just like everything else does.

At least that’s how I see it. I’m not a big realtime user.

Thanks, it looks like you said, but is this a bug or lack of knowledge how to configure it? I would like to be sure that it can be done or not.

I don’t think it’s a bug or a lack of knowledge. I think it is just how Asterisk works. Asterisk still needs to load things into memory to use them when it is started. That includes your extconfig.conf. Like everything else in Asterisk if in extensions.conf I have the context [outbound-calls] and then 50 lines down I have another context called [outbound-calls] that has some differences in it. The first one to load wins, all others are ignored because it already loaded it.

So when you have the above, my guess is that Asterisk is reading the ldap one first and ignoring the ODBC call because it’s already been loaded.

Now someone else with more realtime knowledge can correct me but I think my logic is correct.

It makes sense, but if so, why does the following work?
aor=config,pjsip.conf,criteria=type=aor
aor=realtime,ps_aors
aor in this case is also defined two times.

Because they aren’t the same and as you pointed out it supports using both static and a realtime source. So one is calling on static and one is calling realtime versus what you want, two realtime calls for the same config object.

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