[asterisk-users] "IF" command

Spiro Harvey spiro at knossos.net.nz
Thu Mar 19 19:49:35 CDT 2009


On Thu, 19 Mar 2009 19:20:42 -0500
"Cary Fitch" <caryf at usawide.net> wrote:
> The only conditional command I know of in Asterisk is "GotoIF".

There is also GosubIf and ExecIf..

full list here:

http://www.voip-info.org/wiki-Asterisk+-+documentation+of+application+commands#Alphabeticallist

> Is there a simple "IF" that doesn't have to goto anywhere?
> It is the "IF" construct I am looking for, don't worry about the rest
> of the syntax, or what A or B is.

Now please take note, I'm very new to this and have never written a
dialplan, but based on my understanding you could fudge the logic:

exten _713NXXXXXX,GosubIf($A = $B?labelc:nextpriority)
exten _512NXXXXXX,GosubIf($A = $B?labeld:nextpriority)

labelc: 
Set($C="Houston Call")
Return()

labeld:
Set($C="Austin Call")
Return()


etc...



-- 
Spiro Harvey                  Knossos Networks Ltd
021-295-1923                    www.knossos.net.nz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20090320/285f18eb/attachment.pgp 


More information about the asterisk-users mailing list