Channel language getting discarded/reset/ignored?

System Information:
Asterisk Version: 20.4.0
OS: AlmaLinux 8.8 (Sapphire Carcal)

I’ve a set a default language based on the system settings. For Example German/DE.
All external peers get the default language applied to their channel by the PBX/Asterisk
But we’ve German, French and English speaking people on this PBX.

Due to the Channel language being set to German for all external peers, they all get german announcements version as playback, even when connected to english, or french speaking peers.

I’m trying to make it so, the external channel’s language is set to the same as the internal peers channel language.

Currently as a proof of concept, i’m just generally trying to force a different than system ommited language to all channels, to see if it works at all.

I added a SET(CHANNEL(language)=fr) via an AGI Script on my incoming line, so all incoming call channels should be set to french instead of the system default german.

The Asterisk Log shows:

Connected to Asterisk 20.4.0 currently running on testface (pid = 8242)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
0x7ff184074850 – Strict RTP learning after remote address set to: [Censored]:25644
– Executing [[Censored]@Leitungsname-incoming:1] Set(“SIP/[Censored]_obproxy0-00000002”, “channelname=Leitungsname-incoming”) in new stack
– Executing [[Censored]@Leitungsname-incoming:2] Set(“SIP/[Censored]_obproxy0-00000002”, “lineconfigid=1063”) in new stack

Setting Channel Language with AGI Script

– AGI Script Executing Application: (Set) Options: (CHANNEL(language)=fr)
– AGI Script Executing Application: (Set) Options: (CALLERID(name)=00[Censored] : [Censored])
– AGI Script Executing Application: (Set) Options: (CALLERID(number)=00[Censored])
– AGI Script Executing Application: (Dial) Options: (SIP/2226.ylnkt54,125,wWtT)

Call gets Picked up…

Triggering Monitoring with *1 as a Feature

[2023-10-10 10:23:44,525] DTMF[899924][C-00000002]: channel.c:4006 __ast_read: DTMF begin ‘*’ received on SIP/2226.ylnkt54-00000003

[2023-10-10 10:23:45,068] DTMF[899924][C-00000002]: channel.c:3958 __ast_read: DTMF end ‘1’ detected to have actual duration 79 on the wire, emulation will be triggered on SIP/2226.ylnkt54-00000003
[2023-10-10 10:23:45,068] DTMF[899924][C-00000002]: channel.c:3965 __ast_read: DTMF end ‘1’ has duration 79 but want minimum 80, emulating on SIP/2226.ylnkt54-00000003
[2023-10-10 10:23:45,068] DTMF[899924][C-00000002]: channel.c:4040 __ast_read: DTMF end emulation of ‘1’ queued on SIP/2226.ylnkt54-00000003

Both Channels have a monitor_announce playback in german

– <Local/3a178f85-5742-4277-9f8b-6a5154d6f6d2@playonchannel-00000001;1> Playing ‘monitor_announce.slin16’ (language ‘de’)
– <Local/e431eac6-2d52-46d1-a353-988157354f11@playonchannel-00000000;1> Playing ‘monitor_announce.slin16’ (language ‘de’)

– Goto (calling,exit,0)

My knowledge with asterisk is quite limited, i don’t know if what i’m trying to do is even possible.
The Full log does not show that the language is being changed back to german/de at any point.

I don’t quite know how to solve this, i’m hoping somebody could help me with this.


What is a “monitor_announce”? What is triggering that? How? Where?

Also, I couldn’t work out from where the AGI was being run (or even why AGI was necessary).

The monitor_announce is part of the playback of a Features.conf Function

callmonitor => *1,self,UserEvent,Monitor ;

So by pressing *1 it triggers as script which triggers normal Monitor() (Monitor - Asterisk Documentation) with an announcement playback monitor_announce to inform all peers/channels that the call is now being recorded/monitored.

That raises an AMI user specific event. It sounds like you have outside logic that is doing all of this, and depending on how it is written/how monitor_announce works it may be occurring on a channel where the language is not as you expect. The previous bit of log showing a Local channel doing the playback seems to show that, which is: you aren’t calling Playback on the channels the Playback is happening on Local channels with a different language - de.

1 Like

The whole System is running Asterisk under a PBX (STARFACE).

The way it works’ you can “hook” into active calls via Events
For example, on all incoming/outgoing calls/all calls/emergency calls ect. and interact with the calls,
Change, the destination, callerid, add more sip-headers (For exmaple ringtones, cameraurls…) via pre-defined Drag and Drop Programming,
Or you can place your own AGI Commands, and even load your own Java-Classes to interact with the calls, or do other stuff in the background.

I tried it both via AGI Calls, as well with just placing the command in the dialplan directly by editing it via SSH and reloading asterisk, both don’t work.

The final solution should be, that i can set the language of the call/channels via an AGI Command, based on the target peer

I noticed, that the cannels for the playback are some kind of local channel.

I tried to look for more details, as to how the feature works, but can’t find anything.
There is a total of 6.conf files which contains “Monitor” with uncommented files.

I think the important one is this one:

I found them inside the globals of the extension.conf

These are the same as the ones from the features.conf, which ae applicationmappings

; don't use e.g #9 for applicationmap or featuremap unless you have changed 'blindxfer' from # to e.g. #1 !
;testfeature => *9,callee,Playback,tt-monkeys	; Play tt-monkeys to callee if *9 was pressed - use 'callee' or 'caller'
switchphone => **,self,UserEvent,SwitchPhone	;
callatxfer => *2,self,UserEvent,CallAtxfer		;
instantconf => *3,self,UserEvent,InstantConf	;
callmonitor => *1,self,UserEvent,Monitor	;
nofeatures => *4,self,Set,NOFEATURES=10		;

So this is an AMI UserEvent that’s being fired, and i guess the overlaying STARFACE processes the AMI request, and create new audio channels, which i cannot interact with, or at least not by normal means.

So i’d have to probably override the *1 feature with my own Cusotm AMI Hook instead of faffing about with AGI Calls, and try to “replicate” the behavior of the original.

Entirely possible that is how it works, yes. As to whether you could recreate what Starface does that’s not something we could really know.

Yea, i’ll leave it at that for now.

I already found the AMI Calls inside the Java Code.
Its getting triggered via standard MonitorAction (org.asteriskjava.manager.action.MonitorAction)
The Action takes between 2-4 Params, depending on how much one wants to configure.
But none of them are a choice of language.
It seems this might be some kind of default-behavior for Audio-Monitoring.With external Channels.

Thank you for helping me out with this.

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