[asterisk-users] Realtime dialplan application versus REALTIME dialplan function

JR Richardson jmr.richardson at gmail.com
Fri Mar 13 17:41:42 CDT 2009


Hi All,

 

I'm upgrading some PBX's from 1.2 to 1.4 and having a bit of trouble with
converting the Realtime application to the REALTIME function.  I have the
method down and understand simplistically what is going on, at least enough
to get my old 1.2 apps to run in 1.4 functions.  I do not understand why
change from the app to the func?  What the benefits?

 

To me, the app seemed so elegant with appending a variable name to each
extracted data field within a row.  Really convenient and easy, one priority
in the dialplan and all data is extracted and easily used further down the
line.

 

Initial take on the function is increased priorities in the dialplan to
extract the data then cut it up into specified variable, then cut the
resulting variable into further bits to get the usable data into another
variable so it can be used for the real work.

 

For example here is the 1.2 dialplan:

 

exten => 326,1,Realtime(cfwd|exten|${EXTEN}|cf_)

exten => 326,n,GotoIf($["${cf_active}" = "yes" ]?:326|20)

exten => 326,n,Goto(cfaccess,${cf_cfnum},1)

 

Here is the 1.4 dialplan to accomplish the same thing:

 

exten => 326,1,Set(row="${REALTIME(cfwd,exten,${EXTEN})}")

exten => 326,n,Set(column3=${CUT(row,"|",3)})

exten => 326,n,Set(column4=${CUT(row,"|",4)})

exten => 326,n,Set(cf_cfnum=${CUT(column3,"=",2)})

exten => 326,n,Set(cf_active=${CUT(column4,"=",2)})

exten => 326,n,GotoIf($["${cf_active}" = "no" ]?:326|20)

exten => 326,n,Goto(cfaccess,${cf_cfnum},1)

 

So I have in mind that maybe the function is a bit more versatile than the
old app, but I don't really see it just yet.

 

Can anyone shed some light on this and expound on the benefits or reasoning
behind the switch in the application usage?

 

Thanks.

 

JR

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090313/acd7367a/attachment.htm 


More information about the asterisk-users mailing list