Passing channel variables to SIP extensions, when Originating from ring group

Hey everyone.

I have a slight issue with FreePBX ring groups. I’m using a Node.JS server on my FreePBX (13.0.105) box, connected to Asterisk 13 through AMI, and to the front-end of my software, to pass events and actions between them.

I’ve successfully managed to make Node.JS Originate a call from a FreePBX Ring Group, by setting the Channel to: Local/[email protected], with the Exten being the target outbound number. That all works great.

Problem is, I’m trying to pass a variable through the Originate action, so that it can be read from he channel belonging to whichever extension picks up the call. So far I can see the variable on the Ring Group channel, but it doesn’t get passed to the SIP extension channel.

I’ve tried modifying the [ext-group] in extensions_addition.conf to set the variable to SHARED, but that failed. I was going to simply query to channel status after the Originate action, and manually SetVar on the channels belonging to the Ring Group extensions, but that’s a very crude solution that I’d rather avoid. (It might even interfere with extensions that are active during the Originate call, and I’m not sure how to avoid that without a lot of coding to record extension activity.)

Any suggestions would be appreciated.

Thanks

If I understand what you are asking (dubious assumption), are you aware of the underscore / double underscore prefix for channel variables? By prefixing variables when setting, they are inherited by channels down the line. You do not use the prefix when checking the value:

set(__atilla=Hun)    
noop(Atilla the ${atilla})
2 Likes

Hey @lgaetz .

Thank you, that solves the problem.

By using a single underscore for the variable name on the Originate action, it does become available to the SIP channel that answers the call. The AMI library I use (Nami) doesn’t seem to recognize it as a channel variable, but I can still fetch it using the GetVar action.

And all possible through AMI, without messing with the FreePBX generated dialplan, which is perfect :slight_smile:

1 Like