Asterisk Variables


#1

I asked this question before. I figured I’d ask again and pose it a different way.

Is there a way to set a variable in a context, when that context is entered? Asterisk only allows you to set variables with VAR=VAL in the global context.

MuppetMaster suggested I use the s extension, like this:

[user_context]
exten => s,1,SetVar(…)

I don’t think that will work because the s extension only gets called when there are NO OTHER valid extensions. This will not be the case. There will be valid matching extensions in this user context. We want to be able to set the caller id variables for each user, when they dial an outside number.

What a dumb name… 'start extension. I don’t see the connection between the name ‘start’ and something that gets executed when no valid extensions exist. Huh???


#2

what other extensions are you going to have in a context then ? i have lots of extensions in my dialplan that only contain ‘s’ and they work OK. and all do things with variables.

when you compiled did you do a make samples ? or do you have another system you can install A@H on to give yourself a headstart ?


#3

Asterisk at home? Not using it. Don’t follow what your talking about.

The context could have lots of extensions. I don’t know what/how many yet. All I can tell you is that example doesn’t work because ‘s’ isn’t a wild card, and it only used when no other valid extensions exist. That’s what the docs say.


#4

i give up. you’re right, the Asterisk docs make it impossible to get even the most basic system to work. if i were you i would give up, get a refund and spend a heap more budget on a traditional PBX.

A@H takes a few minutes to install on a spare “test” machine, and gives you the chance to look at a whole heap of functionality. even if you’re not going to use it, the conf files it generates will help you get started, as would the samples if you generated those at build time.

it seems to me like you really want someone to come install this for you.

oh, and that call-blocking functionality you were going around in circles to do, wrote that in < 60 mins, including extra pages in AMP !


#5

Strewth! You don’t half whinge! Are you a pom or something? :wink:


#6

cough :smiley: good job i saw that wink !!

if he was a pom, and within 25 miles of me, i would happily drive to him just to stop the posts ! not convinced it would work though.


#7

cough :smiley: good job i saw that wink !![/quote]
Yeah, well, i hate to admit it, but i’m a pom too! :wink:

What would you do when you got there? And why only 25 miles???

:wink:


#8

'cos that would be a gallon of diesel, and that’s i’m prepared to donate to his cause, given the cost of fuel these days !


#9

We could take up a collection. :wink: