Discussion related to the AudioFork module. See Github repo.
Is the Asterisk module External Media the “standard” way of forking audio from Asterisk, and preferred over AudioFork?
It is the core supported mechanism, and used by Sangoma.
In a 2-way phone conversation, can External Media module grok the different channels? Scenario: my app prefers to ingest interwoven inbound / outbound audio chunks, which is fairly standard for telephony platforms that fork the real-time audio stream. However, in AudioFork, the best you can do is get a monochannel which contains both inbound / outbound audio chunks but does not segregate the two. Can we differentiate the real-time inbound / outbound audio chunks with External Media?
On a single external media no, you’d need two. External media is built on the same fundamental base as AudioFork.
Is there some way within the C-lang APIs that we can segregate inbound / outbound chunks? This is pretty standard in many CCaaS solutions I’ve seen. Just for example, the real-time audio stream out of Amazon Connect marks individual chunks with meta data – including whether each is inbound or outbound.
The audiohook API can provide each direction.
@jcolp: do you mean that within the same C-lang loop, we can read and mark each audio chunk in the conversation so as to indicate channel (IE, inbound or outbound)?
Audiohooks doesn’t work on the concept of inbound or outbound channels or groups of channels. It works on audio going TO a channel, or audio going FROM a channel. Just a single channel. Anything further channel aware is above it in the consumer of the API. It provides the ability to independently retrieve audio from both directions.
@jcolp: I was able to retool AudioFork logic to stream interwoven audio chunks for from each side of a 2-sided phone call. What I did not figure out: how to determine which side initiated the call. Is there a flag somewhere in the ast_frame or elsewhere that might indicate the originating party?
There’s a flag on the channel which can sometimes indicate that it is an outgoing leg. That’s all I can think of. Such information isn’t on a per-frame basis.
@jcolp: looking through the enum ast_option_flags
, I do not see any candidate flags that might indicate inbound / outbound. Any further suggestions here?
In DialPlans, it sounds like we can access SIP headers, which should indicate caller origin and therefore whether the phone call is inbound or outbound. So maybe we can simply rely on SIP headers rather than anything in the C logic.
With an example of usage:
@jcolp: that’s really helpful. But even if we can determine that the call is inbound into Asterisk (IE, into the phone # affiliated with the Asterisk PBX), it still is not clear whether we can determine which side of the phone call is the inbound (from) party, and which side is the outbound (to) counterparty. From your other comments, it does not sound like there is a clear way to determine that – IE, can I look at the read / write sides of an audio stream for some call and accurately recognize whether read / write side is inbound or outbound?
No, audio streams have no concept of that either. What you see is what there is.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.