Good afternoon everyone,
After scouring the web and doing some searches through the forums I’ve decided to stop beating my head against a wall and pose my question to anyone who might know the answer.
First off, i’m currently running Asterisk 188.8.131.52-samy-r27 through TrixBox
What I’m trying to do is get the background application to stay in the macro that I’m currently in. From what it looks like I should be able to put the macro context (in this case macro-1237-inter) into the Background App like this Background(CCPOC/intro,macro-1237-inter) but it still exits out to the previous context.
Here’s what I currently have, I’ve given the relevant information that I have
exten => 1237,1,Playback(goodbye)
exten => 1237,n,Macro(1237-inter)
exten => 1237,n,hangup()
exten => 1,1,SayDigits(555)
exten => 1,1,SayDigits(3)
exten => s,1,SayDigits(42)
exten => s,n,Set(TIMEOUT(digit)=2)
exten => s,n,Set(TIMEOUT(response)=5)
exten => s,n,Background(CCPOC/intro,macro-1237-inter)
exten => s,n,SayDigits(24)
What I’m trying to get to happen is as follows
- I dial 1237
- I hear the goodbye message
- Macro 1237-inter get’s called
- I hear “Four Two”
- I hear the custom intro message
- I press 1 while message is playing
- I hear “Three”
However, what I’m finding is I will hear “Five Five Five” instead and this continues to be the case in all the combinations I can come up with for the Background App.
Some further explanation on why I’m trying to get this in a macro, I am developing a dialplan to essentially take an order over the phone and the caller will have the option to press 3 at any time during the call to end the call so all Playbacks in the dialplan are Backgrounds. The plan is to have multiple of these macros so orders could be taken for different products. If I just let it exit out to the from-internal-custom context I will either have to put a generic goodbye message there or make that go to another macro and set a variable somehow so it knows which macro it came from and give the custom message. I’d like to avoid this by just putting this handler in the macro that is being used.
So the question is, am I doing something wrong? I’m seeing lots of different examples out there on how to use the Background app but not with the context so I can’t see for certain if I am.
The other option I see now at this stage is to have the macro-1237-inter not be a macro at all but another context and just jump to that context from from-internal-custom.
I’m looking for any ideas possible. Thank you in advance.