Re: [Asterisk-Users] Define variable in sip.conf

2005-11-08 Thread James H Thompson


- Original Message - 
From: "Olle E. Johansson" <[EMAIL PROTECTED]>
To: "Asterisk Users Mailing List - Non-Commercial Discussion" 


Sent: Wednesday, October 05, 2005 7:55 PM
Subject: Re: [Asterisk-Users] Define variable in sip.conf



Benjamin Lawetz wrote:

I'm looking for a way to transmit a user specific variable to my dialplan

If we use the example of the hair color, I was thinking of having 
something

like:

[bob]
context=users
host=dynamic
secret=password
type=friend
username=bob
hair=brown

Use
setvar=hair=brown

in 1.2beta or CVS head. Works for both IAX2 and SIP configuration files.

/Olle
___
--Bandwidth and Colocation sponsored by Easynews.com --

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 


___
--Bandwidth and Colocation sponsored by Easynews.com --

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] Define variable in sip.conf

2005-10-05 Thread Olle E. Johansson
Benjamin Lawetz wrote:
> I'm looking for a way to transmit a user specific variable to my dialplan
> 
> If we use the example of the hair color, I was thinking of having something
> like:
> 
> [bob]
> context=users
> host=dynamic
> secret=password
> type=friend
> username=bob
> hair=brown
Use
setvar=hair=brown

in 1.2beta or CVS head. Works for both IAX2 and SIP configuration files.

/Olle
___
--Bandwidth and Colocation sponsored by Easynews.com --

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] Define variable in sip.conf

2005-10-05 Thread steve


On Wed, 5 Oct 2005, Benjamin Lawetz wrote:

> I'm looking for a way to transmit a user specific variable to my dialplan
> 
> If we use the example of the hair color, I was thinking of having something
> like:

Hi,

I do like the idea of stashing variable settings in sip peers, zapata
channels etc.  But in the meantime, I use an extensions.conf "trick" to
make it easy to set variables and other settings that depend on the caller
and not the called number.

Here's an attempt to show the idea:

[macro-callersettings]
; arg1 comes in as the caller's cid number
exten => s,1,Goto(${ARG1},1)
exten => 200,1,Noop(settings for extension 200 go here)
exten => 200,n,Set([EMAIL PROTECTED])
exten => 201,1,Noop(settings for extension 201 go here)
; etc etc
exten => _3XX,1,Noop(can also use patterns to make settings for multiple 
extensions)

[from-exten]
; for any number dialled, first call the callersettings macro
; the pattern matches two digits or more; you might need to
; add other patterns if you use codes starting with *, or
; single digits.
exten => _X.,1,Macro(callersettings,${CALLERIDNUM})
; having called the macro, jump to a more "normal" from-exten-style context
exten => _X.,n,Goto(from-exten-more,${EXTEN},1)

[from-exten-more]
; all the usual stuff you want extensions to be able to dial
; anything here has available the variables setup in macro-callersettings
include => extensions
exten => _XXX,1,Dial(Zap/g1/${EXTEN})
; etc


Regards,
Steve

___
--Bandwidth and Colocation sponsored by Easynews.com --

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