Hey there,
I’ve been working with Asterisk for a while now and was able to achieve what I wanted so far.
However, now I’m a bit stumped as I’m faced with a situation where I’d have to make a caller do two things at once.
But as I’ve learned, a channel in Asterisk can only do one thing at the same time in a dialplan.
The situation is the following (using PJSIP, if that makes a difference):
I need a call to an extension join another endpoint (which auto-answers) to a ConfBridge, make the calling user join the Confbridge as well and lastly make the calling user execute an EAGI() command to pass the audio to an application on the same filesystem as Asterisk.
The idea is the following:
- Caller (an existing endpoint in PJSIP) makes a call to an extension in the dialplan. Works fine, of course.
- Use Originate to join another endpoint to a bridge (via ConfBridge). Works fine. Originate returns successfully.
- Use ConfBridge on the caller to join them to the bridge as well. Also works fine, BUT…
- Use EAGI(/usr/bin/magicapplication,"-magicargument 42"). This never gets executed due to ConfBridge blocking.
An abbridged version of the dialplan looks somewhat like this:
exten => testextension,1,Verbose(Starting testextension...)
same => n,Originate(PJSIP/otherendpoint,exten,default,join_other_to_confbridge,1)
same => n,ConfBridge(1234,my_bridge,my_user)
same => n,Set(EAGI_AUDIO_FORMAT=slin16)
same => n,Set(AGIEXITONHANGUP=yes)
same => n,EAGI(/usr/bin/magicapplication,"-someparam")
Switching the ConfBridge and EAGI commands around leads to the EAGI working fine, but ConfBridge never being executed as now EAGI is the one blocking.
I do, however, need to have both. The “magicapplication” is not something I have control over, but part of our internal infrastructure that needs to have the call audio fed to it via the dialplan.
I’m sure there must be some way to achieve this, but in my searching so far, I did not find any examples of something similar being done.
Local channels have been mentioned, but even after reading up on them, I still don’t understand what exactly they are, how they are different from e.g. a channel created by an endpoint calling an extension or how they could help me achieve this.
What I’d need is really a basic example showcasing how a user can both join a confbridge and have the audio passed on via EAGI. Or something else that does enable a user to “do two things at once”.
While functions themselves are fairly well documented for Asterisk, I’m someone who learns radically better looking at example code and not really from just reading function documentation which for me usually lacks context necessary for understanding.