openwrt / telephony

The telephony packages feed
105 stars 247 forks source link

asterisk-app-queue causes a crash of asterisk #865

Open fedv-mbu opened 5 months ago

fedv-mbu commented 5 months ago

Maintainer: @jslachta

Environment: OpenWRT 23.05.3 on Zyxel NBG6716 ath79 / mips_24kc

Description:

I Installed OpenWRT 23.05.3 with Asterisk 20 on a Zyxel NBG6716 Router with all my other required modules for asterisk. So far everything works great, except app_queue.

The Issue is as follows: I dial my Queue test number which forwards the call to a queue called "zentrale" The Member from this queue "6002" picks up Asterisk Crashes with a SIGSEGV:

[ 4168.760322] do_page_fault(): sending SIGSEGV to asterisk for invalid read access from 00000001 [ 4168.769157] epc = 77356b3c in libc.so.6[772b0000+1b3000] [ 4168.774603] ra = 77873ced in libjansson.so.4.14.0[77870000+9000]

Any Idea what might be the cause? Things I've tried:

Different OpenWRT version (22) Different Asterisk version (18) PJSIP instead of chan_sip

Thanks! Michel

micmac1 commented 5 months ago

Hi there,

Can you post a simple asterisk config to reproduce this?

fedv-mbu commented 5 months ago

Hi There,

Here's my pjsip.conf:

;===============TRANSPORT

[simpletrans]
type=transport
protocol=udp
bind=0.0.0.0

;===============EXTENSION 6001

[6001]
type=endpoint
context=default
disallow=all
allow=ulaw
auth=auth6001
aors=6001

[auth6001]
type=auth
auth_type=userpass
password=6001
username=6001

[6001]
type=aor
max_contacts=10

;===============EXTENSION 6002

[6002]
type=endpoint
context=default
disallow=all
allow=ulaw
auth=auth6002
aors=6002

[auth6002]
type=auth
auth_type=userpass
password=6002
username=6002

[6002]
type=aor
max_contacts=10

And here's my extensions.conf: (The part that gets run)

[default]
exten => 6001,hint,SIP/6001
exten => 6002,hint,SIP/6002
include => vod-in
exten => 425,1,Answer
exten => 425,n,Wait(1)
exten => 425,n(rwlqueue),Noop(Zentrale an Warteschlange)
exten => 425,n,Goto(queue,zentrale,1)

And of course my queues.conf:

[zentrale]
;music = default
strategy = ringall
servicelevel = 30
timeout = 120
wrapuptime=5
announce = /mnt/usb/ansagen/ansage21
announce-frequency = 30
;announce-holdtime = no

;member => Local/zentrale1@default
member => SIP/6002
micmac1 commented 5 months ago

Hi there,

I tried your config. Only changed the "announce" in queues.conf and pointed it to a wav file that exists on my router. Upon start these are the logs:

Sat May  4 11:55:53 2024 daemon.info asterisk[4831]: PBX UUID: acbf9772-ae1f-4777-8108-3a659fe4f92e
Sat May  4 11:55:53 2024 daemon.info asterisk[4831]: [May  4 09:55:53] NOTICE[4831]: loader.c:2405 load_modules: 82 modules will be loaded.
Sat May  4 11:55:53 2024 daemon.info asterisk[4831]: [May  4 09:55:53] ERROR[4831]: config_options.c:710 aco_process_config: Unable to load config file 'cdr.conf'
Sat May  4 11:55:53 2024 daemon.info asterisk[4831]: [May  4 09:55:53] NOTICE[4831]: cdr.c:4444 process_config: Failed to process CDR configuration; using defaults
Sat May  4 11:55:53 2024 daemon.info asterisk[4831]: [May  4 09:55:53] NOTICE[4831]: cdr.c:4568 cdr_toggle_runtime_options: CDR simple logging enabled.
Sat May  4 11:55:54 2024 daemon.info asterisk[4831]: [May  4 09:55:54] NOTICE[4831]: indications.c:1100 load_indications: Default country for indication tones: us
Sat May  4 11:55:54 2024 daemon.info asterisk[4831]: [May  4 09:55:54] NOTICE[4831]: indications.c:424 ast_set_indication_country: Setting default indication country to 'us'
Sat May  4 11:55:54 2024 daemon.info asterisk[4831]: [May  4 09:55:54] ERROR[4882]: res_pjsip/config_system.c:267 system_create_resolver_and_set_nameservers: There are no local system nameservers configured, resorting to system resolution
Sat May  4 11:55:54 2024 daemon.info asterisk[4831]: [May  4 09:55:54] ERROR[4882]: res_pjsip/config_system.c:267 system_create_resolver_and_set_nameservers: There are no local system nameservers configured, resorting to system resolution
Sat May  4 11:55:54 2024 daemon.info asterisk[4831]: [May  4 09:55:54] WARNING[4831]: pbx.c:8797 ast_context_verify_includes: Context 'default' tries to include nonexistent context 'vod-in'
Sat May  4 11:55:54 2024 daemon.info asterisk[4831]: [May  4 09:55:54] WARNING[4831]: pbx.c:8797 ast_context_verify_includes: Context 'local' tries to include nonexistent context 'parkedcalls'
Sat May  4 11:55:54 2024 daemon.info asterisk[4831]: [May  4 09:55:54] WARNING[4831]: loader.c:2509 load_modules: The deprecated module 'app_macro.so' has been loaded and is running, it may be removed in a future version
Sat May  4 11:55:54 2024 daemon.info asterisk[4831]: Asterisk Ready.

Then I register two phones, 6001 and 6002. Then I call 425 and I only see this in the log:

Sat May 4 11:56:02 2024 daemon.info asterisk[4831]: [May 4 09:56:02] WARNING[4901][C-00000001]: pbx.c:4507 __ast_pbx_run: Channel 'PJSIP/6001-00000000' sent to invalid extension but no invalid handler: context,exten,priority=queue,zentrale,1

Asterisk didn't crash, but the call didn't work either. I guess something is missing in the reproducer. Please double-check and let me know what's missing.

fedv-mbu commented 5 months ago

Sorry, you're missing this context in extensions.conf:

[queue]
; Zentrale -0
; 30 Sekunden Announcement fehlt
exten => zentrale,1,Answer
exten => zentrale,n,Wait(2)
exten => zentrale,n,Playback(/mnt/usb/ansagen/ansage11)
exten => zentrale,n,Queue(zentrale,tT,,120)
exten => zentrale,n,Playback(/mnt/usb/ansagen/ansage12)
exten => zentrale,n,Voicemail(98,s)
micmac1 commented 5 months ago

Now I can call extension 425 and get played the audio file. Nothing else happens.

fedv-mbu commented 5 months ago

Does the other extension not ring? You need to dial from 6001, so 6002 as a queue member rings. And pickup is where it crashes.

micmac1 commented 5 months ago

Yes, that's what I'm doing. I got 6001 & 6002 registered to asterisk. Then I call 425 from 6001. This call leg gets answered, my wave gets played. That's it. 6002 doesn't get notified.

Maybe missing some config still, or maybe a missing module. I don't know.

Mon May 6 20:41:52 2024 daemon.info asterisk[9281]: PBX UUID: acbf9772-ae1f-4777-8108-3a659fe4f92e Mon May 6 20:41:52 2024 daemon.info asterisk[9281]: [May 6 18:41:52] NOTICE[9281]: loader.c:2405 load_modules: 92 modules will be loaded. Mon May 6 20:41:53 2024 daemon.info asterisk[9281]: [May 6 18:41:53] ERROR[9281]: config_options.c:710 aco_process_config: Unable to load config file 'cdr.conf' Mon May 6 20:41:53 2024 daemon.info asterisk[9281]: [May 6 18:41:53] NOTICE[9281]: cdr.c:4444 process_config: Failed to process CDR configuration; using defaults Mon May 6 20:41:53 2024 daemon.info asterisk[9281]: [May 6 18:41:53] NOTICE[9281]: cdr.c:4568 cdr_toggle_runtime_options: CDR simple logging enabled. Mon May 6 20:41:53 2024 daemon.info asterisk[9281]: [May 6 18:41:53] NOTICE[9281]: indications.c:1100 load_indications: Default country for indication tones: us Mon May 6 20:41:53 2024 daemon.info asterisk[9281]: [May 6 18:41:53] NOTICE[9281]: indications.c:424 ast_set_indication_country: Setting default indication country to 'us' Mon May 6 20:41:53 2024 daemon.info asterisk[9281]: [May 6 18:41:53] ERROR[9332]: res_pjsip/config_system.c:267 system_create_resolver_and_set_nameservers: There are no local system nameservers configured, resorting to system resolution Mon May 6 20:41:53 2024 daemon.info asterisk[9281]: [May 6 18:41:53] ERROR[9332]: res_pjsip/config_system.c:267 system_create_resolver_and_set_nameservers: There are no local system nameservers configured, resorting to system resolution Mon May 6 20:41:53 2024 daemon.info asterisk[9281]: [May 6 18:41:53] WARNING[9281]: pbx.c:8797 ast_context_verify_includes: Context 'default' tries to include nonexistent context 'vod-in' Mon May 6 20:41:53 2024 daemon.info asterisk[9281]: [May 6 18:41:53] WARNING[9281]: pbx.c:8797 ast_context_verify_includes: Context 'local' tries to include nonexistent context 'parkedcalls' Mon May 6 20:41:53 2024 daemon.info asterisk[9281]: [May 6 18:41:53] WARNING[9281]: loader.c:2509 load_modules: The deprecated module 'app_macro.so' has been loaded and is running, it may be removed in a future version Mon May 6 20:41:53 2024 daemon.info asterisk[9281]: Asterisk Ready. Mon May 6 20:43:40 2024 daemon.info asterisk[9281]: [May 6 18:43:40] WARNING[9353]: res_pjsip_pubsub.c:3396 pubsub_on_rx_publish_request: No registered publish handler for event presence from 6002 Mon May 6 20:43:52 2024 daemon.info asterisk[9281]: [May 6 18:43:52] WARNING[9307]: asterisk.c:3459 canary_thread: The canary is no more. He has ceased to be! He's expired and gone to meet his maker! He's a stiff! Bereft of life, he rests in peace. His metabolic processes are now history! He's off the twig! He's kicked the bucket. He's shuffled off his mortal coil, run down the curtain, and joined the bleeding choir invisible!! THIS is an EX-CANARY. (Reducing priority) Mon May 6 20:43:52 2024 daemon.info asterisk[9281]: [May 6 18:43:52] WARNING[9307]: asterisk.c:1817 set_priority_all: Unable to set regular thread priority on main thread Mon May 6 20:43:59 2024 daemon.info asterisk[9281]: [May 6 18:43:59] WARNING[9353]: res_pjsip_pubsub.c:3396 pubsub_on_rx_publish_request: No registered publish handler for event presence from 6001

micmac1 commented 5 months ago

I misspoke, previous entry corrected.