[from-trunk]
2 exten => +48222300490,1,NoOp(Incoming call to +48222300490)
3 same => n,Answer()
4 same => n,Playback(welcome-message) ; Play welcome sound
5 same => n,Set(MUSICCLASS=default) ; Set background music
6 same => n,Queue(agents-queue) ; Call queue (plays music until answered)
7
8 ; API call after the call is connected
9 same => n,Set(CALLERID(num)=${CALLERID(num)}) ; Get caller number
10 same => n,System(curl -X POST “http://yourapi.com/call-connected” -d “phone=${CALLERID(num)}”)
11
12 ; Continue the call process
13 same => n,Wait(1)
14 same => n,Hangup()
15
16 exten => h,1,NoOp(Call ended for ${CALLERID(num)})
17 same => n,System(curl -X POST “http://yourapi.com/call-ended” -d “phone=${CALLERID(num)}&duration=${CDR(duration)}”)
18 same => n,Hangup()
~
this is connected with PBX why the background music is not playing the music file is in the /var/lib/asterisk/sounds/en/ but still the background sound is playing when we are calling .
[root@-:/etc/asterisk]# asterisk -rx “sip show registry”
Host dnsmgr Username Refresh State Reg.Time
217.149.244.35:6090 N 1690100 105 Registered Wed, 26 Feb 2025 13:11:17
1 SIP registrations.
[root@-:/etc/asterisk
It is not possible to answer without queues.conf, and musiconhold.conf would be useful as well. However:
has no overall effect, and
hints at a possible fundamental misunderstanding of how Queue works. This code will not be executed if an agent answers, and will only be executed after the call has failed.
something saying in pollish laguage
and the logs are showing like this
[Feb 27 10:47:25] WARNING[24407][C-00000019] acl.c: Unable to lookup ‘-’
[Feb 27 10:47:25] NOTICE[24407][C-00000019] chan_sip.c: Call from ‘1690100’ (217.149.244.35:6090) to extension ‘s’ rejected because extension not found in context ‘from-trunk’
The problem is that whatever you are receiving the call from isn’t sending the call to that in Asterisk. It is sending it to “s”. Another option is you could change the register line and add “/+48222300490” to the end. That will probably result in the call coming into “+48222300490” in Asterisk.