Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-09 Thread trixter http://www.0xdecafbad.com
On Mon, 2005-05-09 at 14:04 +0200, Mark Wormgoor wrote:
> Hi,
> 
> The problem is, that once I use:
> exten => _.,1,SetGlobalVar(RING=r2)
> it will never get to the extension anymore.  The following line is never
> reached, because now all extensions need to be _.

perhaps a goto(${EXTEN}) after that?

exten => _.,1,SetGlobalVar(RING=r2)
exten => _.,2,Goto(${EXTEN})

just a thought

-- 
Trixter http://www.0xdecafbad.com
UK +44 870 340 4605   Germany +49 801 777 555 3402
US +1 360 207 0479 or +1 516 687 5200
FreeWorldDialup: 635378


signature.asc
Description: This is a digitally signed message part
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-09 Thread Mark Wormgoor
Hi,

>> >> Is it possible to set a variable for a context for all extensions?  I
>> >> haven't been able to find it.
>> >
>> > Try looking up the application "SetVar":
> ... snip  ...
>> > [Description]:
>> >Setvar(#n=value): Sets channel specific variable n to value
>>
>> But how do I link SetVar() to all extensions in a config?
>> If I use exten => _.,1,SetVar() it will never continue on exten =>
>> 1234,1,Dial or exten => 1234,2,Dial.
>
> Not certain about this but couldn't this work:
> exten => _.,1,SetVar()
> exten => _.,2,Goto(${EXTEN},1)
>
> exten => 1234,1,Dial()

That's what I wanted... Should have thought of that myself.
Thanks!

Mark
-- 
***
* |\/|  |  /|  /   Mark Wormgoor  *
* | \  / |  | / | /mailto:[EMAIL PROTECTED]   *
* |  \/  |ark   |/  |/ormgoor  http://www.wormgoor.com/mark/  *
***
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-09 Thread Walt Reed
On Mon, May 09, 2005 at 03:28:22PM +0200, Mark Wormgoor said:
> Hi,
> 
> >> Is it possible to set a variable for a context for all extensions?  I
> >> haven't been able to find it.
> >
> > Try looking up the application "SetVar":
> >
> > demo*CLI> show application SetVar
> > demo*CLI>
> >-= Info about application 'SetVar' =-
> >
> > [Synopsis]:
> > Set variable to value
> >
> > [Description]:
> >Setvar(#n=value): Sets channel specific variable n to value
> 
> But how do I link SetVar() to all extensions in a config?
> If I use exten => _.,1,SetVar() it will never continue on exten =>
> 1234,1,Dial or exten => 1234,2,Dial.

Use dbput/dbget.
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-09 Thread Markus Hakansson
mån 2005-05-09 klockan 15.28 skrev Mark Wormgoor:
> Hi,
> 
> >> Is it possible to set a variable for a context for all extensions?  I
> >> haven't been able to find it.
> >
> > Try looking up the application "SetVar":
... snip  ...
> > [Description]:
> >Setvar(#n=value): Sets channel specific variable n to value
> 
> But how do I link SetVar() to all extensions in a config?
> If I use exten => _.,1,SetVar() it will never continue on exten =>
> 1234,1,Dial or exten => 1234,2,Dial.

Not certain about this but couldn't this work:
exten => _.,1,SetVar()
exten => _.,2,Goto(${EXTEN},1)

exten => 1234,1,Dial()


Sincerely,
Markus Hakansson


___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-09 Thread Mark Wormgoor
Hi,

>> Is it possible to set a variable for a context for all extensions?  I
>> haven't been able to find it.
>
> Try looking up the application "SetVar":
>
> demo*CLI> show application SetVar
> demo*CLI>
>-= Info about application 'SetVar' =-
>
> [Synopsis]:
> Set variable to value
>
> [Description]:
>Setvar(#n=value): Sets channel specific variable n to value

But how do I link SetVar() to all extensions in a config?
If I use exten => _.,1,SetVar() it will never continue on exten =>
1234,1,Dial or exten => 1234,2,Dial.

Kind regards,

Mark
-- 
***
* |\/|  |  /|  /   Mark Wormgoor  *
* | \  / |  | / | /mailto:[EMAIL PROTECTED]   *
* |  \/  |ark   |/  |/ormgoor  http://www.wormgoor.com/mark/  *
***
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-09 Thread Mark Wormgoor
Hi,

Yes, I know I can set the RING variable for each extension, but I would
really like to set it based on the initial context for the call.

Now I need to check for every extension that gets called if the call
originated inside or outside and set the ring accordingly.

Kind regards,

Mark

Rich Adamson said:
> The following works well with a Sipura spa3k:
>
> exten => 3022,1,SetVar(_ALERT_INFO=bellcore-r3) ; selects Ringer
> exten => 3022,2,Dial(SIP/3022,25,r)  ; Sipura spa-3000 fxs port
>
> 
>
>> Hi,
>>
>> Yes, I tried that, but it didn't work.  I've tried this:
>> [contextname]
>> RING = r2
>> _RING = r2
>> __RING = r2
>> but nothing worked...
>>
>> I did find that if I didn't set
>> RING =
>> under globals, the variable would actually never get reset between
>> calls!
>>
>> Kind regards,
>>
>> Mark
>>
>> trixter http://www.0xdecafbad.com said:
>> > have you tried setting the variable at the begining of the context?
>> >
>> > [contextname]
>> > varname=value
>> >
>> >
>> > On Sun, 2005-05-08 at 08:48 +0200, Mark Wormgoor wrote:
>> >> Hi,
>> >>
>> >> Is it possible to set a variable for a context for all extensions?  I
>> >> haven't been able to find it.  I want something like this in
>> >> extensions.conf:
>> >>
>> >> [from-iaxfwd]
>> >> exten => .,1,RING=r3
>> >> exten => 123456,1,Goto(from-pstn,s,1)
>> >>
>> >> [from-internal]
>> >> exten => .,1,RING=r2
>> >> include => ext-local
>> >>
>> >> [ext-local]
>> >> exten => 1,1,Dial(Zap/1,${LONGTIMEOUT})
>> >> exten => 2,1,Dial(SIP/2,${LONGTIMEOUT})
>> >>
>> >> But how do I do this?  I want to change the ring depending on the
>> >> starting context.  The above doesn't work.
>> >>
>> >> Kind regards,
>> >>
>> >> Mark
>
>
> ___
> Asterisk-Users mailing list
> Asterisk-Users@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
>


-- 
***
* |\/|  |  /|  /   Mark Wormgoor  *
* | \  / |  | / | /mailto:[EMAIL PROTECTED]   *
* |  \/  |ark   |/  |/ormgoor  http://www.wormgoor.com/mark/  *
***
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-09 Thread Rich Adamson
The following works well with a Sipura spa3k:

exten => 3022,1,SetVar(_ALERT_INFO=bellcore-r3) ; selects Ringer
exten => 3022,2,Dial(SIP/3022,25,r)  ; Sipura spa-3000 fxs port



> Hi,
> 
> Yes, I tried that, but it didn't work.  I've tried this:
> [contextname]
> RING = r2
> _RING = r2
> __RING = r2
> but nothing worked...
> 
> I did find that if I didn't set
> RING =
> under globals, the variable would actually never get reset between calls!
> 
> Kind regards,
> 
> Mark
> 
> trixter http://www.0xdecafbad.com said:
> > have you tried setting the variable at the begining of the context?
> >
> > [contextname]
> > varname=value
> >
> >
> > On Sun, 2005-05-08 at 08:48 +0200, Mark Wormgoor wrote:
> >> Hi,
> >>
> >> Is it possible to set a variable for a context for all extensions?  I
> >> haven't been able to find it.  I want something like this in
> >> extensions.conf:
> >>
> >> [from-iaxfwd]
> >> exten => .,1,RING=r3
> >> exten => 123456,1,Goto(from-pstn,s,1)
> >>
> >> [from-internal]
> >> exten => .,1,RING=r2
> >> include => ext-local
> >>
> >> [ext-local]
> >> exten => 1,1,Dial(Zap/1,${LONGTIMEOUT})
> >> exten => 2,1,Dial(SIP/2,${LONGTIMEOUT})
> >>
> >> But how do I do this?  I want to change the ring depending on the
> >> starting context.  The above doesn't work.
> >>
> >> Kind regards,
> >>
> >> Mark


___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-09 Thread Mark Wormgoor
Hi,

The problem is, that once I use:
exten => _.,1,SetGlobalVar(RING=r2)
it will never get to the extension anymore.  The following line is never
reached, because now all extensions need to be _.

[ext-local]
exten => 1,1,dial(Zap/1R{RING})

The only workaround I can find is to set the RING for every single
extension, which seems a bit ugly to me.

Kind regards,

Mark

Daniel Salama said:
> Not entirely sure, but, I wonder what would happen if you define RING
> in the [globals] section first, and the use SetVar or SetGlobalVar in
> the other contexts to override its value.
>
> - Daniel
>
> On May 8, 2005, at 2:48 AM, Mark Wormgoor wrote:
>
>> Hi,
>>
>> Is it possible to set a variable for a context for all extensions?
>> I haven't been able to find it.  I want something like this in
>> extensions.conf:
>>
>> [from-iaxfwd]
>> exten => .,1,RING=r3
>> exten => 123456,1,Goto(from-pstn,s,1)
>>
>> [from-internal]
>> exten => .,1,RING=r2
>> include => ext-local
>>
>> [ext-local]
>> exten => 1,1,Dial(Zap/1,${LONGTIMEOUT})
>> exten => 2,1,Dial(SIP/2,${LONGTIMEOUT})
>>
>> But how do I do this?  I want to change the ring depending on the
>> starting context.  The above doesn't work.
>>
>> Kind regards,
>>
>> Mark
>> ___
>> Asterisk-Users mailing list
>> Asterisk-Users@lists.digium.com
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>
> ___
> Asterisk-Users mailing list
> Asterisk-Users@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
>


-- 
***
* |\/|  |  /|  /   Mark Wormgoor  *
* | \  / |  | / | /mailto:[EMAIL PROTECTED]   *
* |  \/  |ark   |/  |/ormgoor  http://www.wormgoor.com/mark/  *
***
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-09 Thread Mark Wormgoor
Hi,

Yes, I tried that, but it didn't work.  I've tried this:
[contextname]
RING = r2
_RING = r2
__RING = r2
but nothing worked...

I did find that if I didn't set
RING =
under globals, the variable would actually never get reset between calls!

Kind regards,

Mark

trixter http://www.0xdecafbad.com said:
> have you tried setting the variable at the begining of the context?
>
> [contextname]
> varname=value
>
>
> On Sun, 2005-05-08 at 08:48 +0200, Mark Wormgoor wrote:
>> Hi,
>>
>> Is it possible to set a variable for a context for all extensions?  I
>> haven't been able to find it.  I want something like this in
>> extensions.conf:
>>
>> [from-iaxfwd]
>> exten => .,1,RING=r3
>> exten => 123456,1,Goto(from-pstn,s,1)
>>
>> [from-internal]
>> exten => .,1,RING=r2
>> include => ext-local
>>
>> [ext-local]
>> exten => 1,1,Dial(Zap/1,${LONGTIMEOUT})
>> exten => 2,1,Dial(SIP/2,${LONGTIMEOUT})
>>
>> But how do I do this?  I want to change the ring depending on the
>> starting context.  The above doesn't work.
>>
>> Kind regards,
>>
>> Mark
>> ___
>> Asterisk-Users mailing list
>> Asterisk-Users@lists.digium.com
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>> To UNSUBSCRIBE or update options visit:
>>http://lists.digium.com/mailman/listinfo/asterisk-users
> --
> Trixter http://www.0xdecafbad.com
> UK +44 870 340 4605   Germany +49 801 777 555 3402
> US +1 360 207 0479 or +1 516 687 5200
> FreeWorldDialup: 635378
> ___
> Asterisk-Users mailing list
> Asterisk-Users@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users


-- 
***
* |\/|  |  /|  /   Mark Wormgoor  *
* | \  / |  | / | /mailto:[EMAIL PROTECTED]   *
* |  \/  |ark   |/  |/ormgoor  http://www.wormgoor.com/mark/  *
***
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-08 Thread El Flynn
Mark Wormgoor wrote:
Hi,
Is it possible to set a variable for a context for all extensions?  I 
haven't been able to find it.  
Try looking up the application "SetVar":
demo*CLI> show application SetVar
demo*CLI>
  -= Info about application 'SetVar' =-
[Synopsis]:
Set variable to value
[Description]:
  Setvar(#n=value): Sets channel specific variable n to value
Flynn
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-08 Thread Time Bandit
> Not entirely sure, but, I wonder what would happen if you define RING
> in the [globals] section first, and the use SetVar or SetGlobalVar in
> the other contexts to override its value.
Be aware that each call as his independant variable space. So if you
"SetVar" for a call, it doesn't affect a variable with the same name
in other call. "SetGlobalVar" is, like its name says, setting a global
variable available to all calls.

Also, when a call is hangup, the first thing asterisk does is
destroying all local variables that belong to this call.

hth
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-08 Thread Daniel Salama
Not entirely sure, but, I wonder what would happen if you define RING  
in the [globals] section first, and the use SetVar or SetGlobalVar in  
the other contexts to override its value.

- Daniel
On May 8, 2005, at 2:48 AM, Mark Wormgoor wrote:
Hi,
Is it possible to set a variable for a context for all extensions?   
I haven't been able to find it.  I want something like this in  
extensions.conf:

[from-iaxfwd]
exten => .,1,RING=r3
exten => 123456,1,Goto(from-pstn,s,1)
[from-internal]
exten => .,1,RING=r2
include => ext-local
[ext-local]
exten => 1,1,Dial(Zap/1,${LONGTIMEOUT})
exten => 2,1,Dial(SIP/2,${LONGTIMEOUT})
But how do I do this?  I want to change the ring depending on the  
starting context.  The above doesn't work.

Kind regards,
Mark
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Setting variable for a context for all extensions?

2005-05-08 Thread trixter http://www.0xdecafbad.com
have you tried setting the variable at the begining of the context?

[contextname]
varname=value


On Sun, 2005-05-08 at 08:48 +0200, Mark Wormgoor wrote:
> Hi,
> 
> Is it possible to set a variable for a context for all extensions?  I 
> haven't been able to find it.  I want something like this in 
> extensions.conf:
> 
> [from-iaxfwd]
> exten => .,1,RING=r3
> exten => 123456,1,Goto(from-pstn,s,1)
> 
> [from-internal]
> exten => .,1,RING=r2
> include => ext-local
> 
> [ext-local]
> exten => 1,1,Dial(Zap/1,${LONGTIMEOUT})
> exten => 2,1,Dial(SIP/2,${LONGTIMEOUT})
> 
> But how do I do this?  I want to change the ring depending on the 
> starting context.  The above doesn't work.
> 
> Kind regards,
> 
> Mark
> ___
> Asterisk-Users mailing list
> Asterisk-Users@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
Trixter http://www.0xdecafbad.com
UK +44 870 340 4605   Germany +49 801 777 555 3402
US +1 360 207 0479 or +1 516 687 5200
FreeWorldDialup: 635378


signature.asc
Description: This is a digitally signed message part
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users