Re: [asterisk-users] Variables for dial plan

2008-12-15 Thread Andrew Thomas
Use setvar=variablename=value

Eg: under [client1]
setvar=dialplan=NZ

Then just reference ${dialplan} in your extensions.conf

Cheers
Andy


--  -Original Message-
--  From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-
--  boun...@lists.digium.com] On Behalf Of Michael
--  Sent: 15 December 2008 04:36
--  To: asterisk-users@lists.digium.com
--  Subject: [asterisk-users] Variables for dial plan
--  
--  I want to have a arbitary named variable within the client's user
--  details in
--  sip.conf
--  
--  [client1]
--  dialplan=NZ
--  ..
--  
--  In extensions.conf (Logic expressed using PHP style)
--  
--  if ($dialplan == NZ) {
--  $NAT = 0;
--  $INT = 00;
--  };
--  
--  and in the [outgoing] section
--  
--  ; Australia
--  exten = _${INT}61[278]NXX.,1,Set(CDR(UserField)=AUSTRALIA)
--  exten =
_${INT}61[278]NXX.,n,Dial(SIP/SIP_PROVIDER/0${EXTEN:4:9})
--  
--  How can I implement this in Asterisk style?
--  
--  Thanks,
--  
--  Michael
--  
--  ___
--  -- Bandwidth and Colocation Provided by http://www.api-digital.com
--
--  
--  asterisk-users mailing list
--  To UNSUBSCRIBE or update options visit:
-- http://lists.digium.com/mailman/listinfo/asterisk-users

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Variables for dial plan

2008-12-15 Thread Michael
On Mon, 15 Dec 2008 21:31:56 you wrote:
 Use setvar=variablename=value

 Eg: under [client1]
 setvar=dialplan=NZ

 Then just reference ${dialplan} in your extensions.conf

 Cheers
 Andy

Thanks, now how do I achieve the following logic?

if ($dialplan == NZ) {
$NAT = 0;
$INT = 00;
};

Michael

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Variables for dial plan

2008-12-15 Thread Steve Johnson
One of these methods will work:

exten = s,n,ExecIf($[${dialplan} = NZ]|Set|NAT=0)
exten = s,n,ExecIf($[${dialplan} = NZ]|Set|INT=00)

-or-

exten = s,n,GotoIf($[${dialplan} != NZ]?not-nz)
exten = s,n,Set(NAT=0)
exten = s,n,Set(INT=00)
exten = s,n(not-nz),more_dialplan_stuff


On Mon, Dec 15, 2008 at 3:26 AM, Michael mich...@networkstuff.co.nz wrote:
 On Mon, 15 Dec 2008 21:31:56 you wrote:
 Use setvar=variablename=value

 Eg: under [client1]
 setvar=dialplan=NZ

 Then just reference ${dialplan} in your extensions.conf

 Cheers
 Andy

 Thanks, now how do I achieve the following logic?

 if ($dialplan == NZ) {
 $NAT = 0;
 $INT = 00;
 };

 Michael

 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


[asterisk-users] Variables for dial plan

2008-12-14 Thread Michael
I want to have a arbitary named variable within the client's user details in 
sip.conf

[client1]
dialplan=NZ
..

In extensions.conf (Logic expressed using PHP style)

if ($dialplan == NZ) {
$NAT = 0;
$INT = 00;
};

and in the [outgoing] section

; Australia
exten = _${INT}61[278]NXX.,1,Set(CDR(UserField)=AUSTRALIA)
exten = _${INT}61[278]NXX.,n,Dial(SIP/SIP_PROVIDER/0${EXTEN:4:9})

How can I implement this in Asterisk style?

Thanks,

Michael

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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