Asterisk DialPlan - Realtime

I am testing realtime on Asterisk (17.3.0), I am able to register PJSIP endpoints using realtime, the only issue that I have is that I cannot generate the dialplan in realtime, each time that I try to call any number in the realtime dialplan, the Asterisk CRASH (and restart automatically) and nothing else happen.

In the file “/etc/asterisk/extconfig.conf”, I have

[settings]
iaxusers => odbc,asterisk,iaxfriends
iaxpeers => odbc,asterisk,iaxfriends
sippeers => odbc,asterisk,sippeers
ps_aors => odbc,asterisk,ps_aors
ps_auths => odbc,asterisk,ps_auths
ps_contacts => odbc,asterisk,ps_contacts
ps_domain_aliases => odbc,asterisk,ps_domain_aliases
ps_endpoint_id_ips => odbc,asterisk,ps_endpoint_id_ips
ps_endpoints => odbc,asterisk,ps_endpoints
ps_globals => odbc,asterisk,ps_globals
ps_registrations => odbc,asterisk,ps_registrations
ps_subscription_persistence => odbc,asterisk,ps_subscription_persistence
ps_systems =>  odbc,asterisk,ps_systems
ps_transports => odbc,asterisk,ps_transports
voicemail => odbc,asterisk,voicemail
extensions => odbc,asterisk,extensions
meetme => odbc,asterisk,meetme
queues => odbc,asterisk,queues,
queue_members => obdc,asterisk,queue_members
queue_rules => odbc,asterisk,queue_rules
;acls => odbc,asterisk
musiconhold => odbc,asterisk,musiconhold

These are the tables

+-----------------------------+
| Tables_in_asterisk          |
+-----------------------------+
| alembic_version_config      |
| extensions                  |
| iaxfriends                  |
| meetme                      |
| musiconhold                 |
| musiconhold_entry           |
| ps_aors                     |
| ps_asterisk_publications    |
| ps_auths                    |
| ps_contacts                 |
| ps_domain_aliases           |
| ps_endpoint_id_ips          |
| ps_endpoints                |
| ps_globals                  |
| ps_inbound_publications     |
| ps_outbound_publishes       |
| ps_registrations            |
| ps_resource_list            |
| ps_subscription_persistence |
| ps_systems                  |
| ps_transports               |
| queue_members               |
| queue_rules                 |
| queues                      |
| sippeers                    |
| voicemail                   |
+-----------------------------+

This is the structure for the table extensions

+----+---------+-------+----------+-----------+----------------+
| id | context | exten | priority | app       | appdata        |
+----+---------+-------+----------+-----------+----------------+
| 13 | testing | 101   |        1 | Dial      | PJSIP/${EXTEN} |
| 14 | testing | 102   |        1 | Dial      | PJSIP/${EXTEN} |
|  4 | testing | 103   |        1 | Dial      | PJSIP/${EXTEN} |
|  1 | testing | 253   |        1 | SayNumber | 102            |
|  2 | testing | 254   |        1 | Playback  | pbx-invalid    |
|  3 | testing | 254   |        2 | Hangup    |                |
| 10 | testing | 45    |        1 | Playback  | hello-world    |
| 11 | testing | 45    |        2 | Playback  | hello-world    |
| 12 | testing | 45    |        3 | hangup    |                |
+----+---------+-------+----------+-----------+----------------+

This is what I have in the file “/etc/asterisk/extensions.conf

[my-context]
switch => Realtime/testing@extensions

Also, as additional information, you may see that the ODBC connection is up and running

odbc show

ODBC DSN Settings
-----------------

  Name:   asterisk
  DSN:    asterisk
    Number of active connections: 2 (out of 20)
    Logging: Disabled

Any help will be appreciate it!

Do you have any clear documentation about it? or do you recommend another method?

My understanding is that use of realtime dial plan is generally discouraged, mostly due to being too much load on the backend database because every single step of your call flow necessitates a separate SQL query.

Anyhow, the CRASH is bad – you might want to open a ticket. In the interim, you could try to change the ‘extensions => odbc,asterisk,extensions’ line in your extconfig.conf to just ‘extensions => odbc,asterisk’ because I think the table name there is redundant (your switch statement in extensions.conf already takes care of the table name.)

Do you know any other way to achieve someting similar, or do you recommend static dialplan?

Static dialplan, with use of func_odbc, CURL, etc. to get at the variable parts.

Stasis application is another option…

Thanks for you help, I will take into account all your suggestions!

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