<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial size=2>Is it possible to 
write a function in Asterisk, that returns a value?&nbsp; Sort of like any 
programming language allows?</FONT></SPAN></DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial size=2>For example, I`d 
like function ReturnSipReg to return the right SipRegistration to dial, based on 
some value so that I could use it in my dial plan:</FONT></SPAN></DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2>i.e:</FONT></SPAN></DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial size=2>exten =&gt; 
1234,1,Dial(SIP/ReturnSipReg(John)) </FONT></SPAN></DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial size=2>; would dial John's 
extension, which I don't know at this point to which Sip Registration it's 
associated.&nbsp;ReturnSipReg would find that out for me.</FONT></SPAN></DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial size=2>Unfortunately, doing 
it in two steps (by setting a variable and using it after) can't be done, I need 
it to all be done in the same Asterisk priority. See my previous email for 
background ("Buddy watch and the hint priority - brain 
teaser").</FONT></SPAN></DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial size=2>Any help is 
extremely appreciated.</FONT></SPAN></DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=687122015-08082007><FONT face=Arial 
size=2>Mike</FONT></SPAN></DIV></BODY></HTML>