Hi, I just got a freepbx box after having used a custom server that I installed asterisk on. I’ve been trying to copy over the functionality of the old asterisk server using the freepbx style (And I have to say I really like the style of freepbx).
I have a more complex dialplan but essentially, to get things going, I have an incoming route currently going to an announcement that goes to a ring group (or Misc Destination that goes to an extensions_custom.conf extention)
In my old system, I had an incoming context that would dial global variable like:
exten => s,1(calloffice),Dial(${GLOBAL(CALLOFFICE)},30,trm(bluebird)d);
exten => s,n,VoiceMail(101@device,us);
exten => s,n,Playback(vm-goodbye);
exten => s,n,Wait(2);
exten => s,n,Hangup();
Then I had extensions that would change the CALLOFFICE variable like:
exten => 402,1,Set(GLOBAL(CALLOFFICE)=${GLOBAL(PAMCELL)});
exten => 402,n,PlayBack(bluebird/admin/number-has-been-forwarded-2pamcell);
exten => 402,n,PlayBack(goodbye);
exten => 402,n,Hangup();
By the way, in the old asterisk system I had the variables in [globals] like
OFFICE=PJSIP/101&PJSIP/102
PAMCELL=DAHDI/g1/1XXXXXXXXXX
Where I think the new way for cellphones (I’m not sure if this is correct and perhaps it’s better to set up virtual extensions) would be:
PAMCELL=Local/1XXXXXXXXXX@Outbound-US
But in the logfiles when I try dialing 402 for example, it says
Set(“IAX2/106-7397”, “GLOBAL(CALLOFFICE)=”)
I assume it’s because there’s already a globals context, so my variables aren’t properly being seen. So my first question is if there’s a better way to get those variables into a globals context.
But more importantly, is there a better implementation of this sort of custom destination? I thought about Call Flow Control, but it seems I’d have to nest them to get multiple destinations to work correctly. Would that be correct? Is there another better way?
Thank you.