I looked into select_core.h and found quite a lot of possible vars for the core....<br><br>Samuel.<br><br><div><span class="gmail_quote">2006/7/12, Greger V. Teigre &lt;<a href="mailto:greger@teigre.com">greger@teigre.com</a>
&gt;:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
AFAIK, there is no single place to find all the @vars. It's still on the<br>to-do...<br>Jan: Could you provide some quick pointers?<br>g-)<br><br>Luis Silva wrote:<br>&gt;<br>&gt; Hi Greger, where can I find the complete list of all the @vars?
<br>&gt;<br>&gt; @from, @from.uri, @to, @to.uri, @from.tag, @<a href="http://from.name">from.name</a>, @to.tag.<br>&gt;&nbsp;&nbsp;@<a href="http://to.name">to.name</a>, @from.params, @to.params, @contact, @contact.uri,<br>&gt;&nbsp;&nbsp;@contact.params
, @contact.expires, @contact.q, @via, and so on.&nbsp;&nbsp;&lt;---<br>&gt;<br>&gt; Regards,Luis Silva<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;&gt; From: &quot;Greger V. Teigre&quot; &lt;<a href="mailto:greger@teigre.com">greger@teigre.com
</a>&gt;<br>&gt;&gt; To: sip &lt;<a href="mailto:sip@arcdiv.com">sip@arcdiv.com</a>&gt;<br>&gt;&gt; CC: <a href="mailto:serusers@lists.iptel.org">serusers@lists.iptel.org</a><br>&gt;&gt; Subject: Re: SER CVS head, new select identifiers info - was - Re:
<br>&gt;&gt; [Serusers]Textops with AVPs?<br>&gt;&gt; Date: Wed, 12 Jul 2006 08:47:11 +0200<br>&gt;&gt;<br>&gt;&gt; It's in head only (0.10.x track)<br>&gt;&gt; g-)<br>&gt;&gt;<br>&gt;&gt; sip wrote:<br>&gt;&gt;&gt; Greger,
<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Sounds incredibly handy. Is this available only in SER head or is it<br>&gt;&gt;&gt; something<br>&gt;&gt;&gt; that's been around for a little while (i.e. do I have any hope of<br>&gt;&gt;&gt; using it in
<br>&gt;&gt;&gt; ser 0.9.6) ?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; N.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; On Tue, 11 Jul 2006 21:18:38 +0200, Greger V. Teigre wrote<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; I repost Jan's original description of the &quot;select identifier&quot;
<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt; functionality. Since then, more select identifiers have been added,<br>&gt;&gt;&gt; both from<br>&gt;&gt;&gt; core and modules.<br>&gt;&gt;&gt; g-)<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; SER core can parse select identifiers using the configuration parser.
<br>&gt;&gt;&gt;&nbsp;&nbsp;A select identifiers begins with @ characters and contains several<br>&gt;&gt;&gt;&nbsp;&nbsp;components/tokens delimited by . (unless it is integer component).<br>&gt;&gt;&gt;&nbsp;&nbsp;Integer components are enclosed in [], for example:
<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; @contact[1].uri<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; This identifier is converted into binary structure which contains the<br>&gt;&gt;&gt;&nbsp;&nbsp;array of components. After that the parser tries to lookup function
<br>&gt;&gt;&gt;&nbsp;&nbsp;that matches the identifier.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Available functions are arranged in a tree-like structure. When<br>&gt;&gt;&gt;&nbsp;&nbsp;looking up a function the tree is traversed (starting at the root)
<br>&gt;&gt;&gt;&nbsp;&nbsp;until the parser finds corresponding function. The part of the tree<br>&gt;&gt;&gt;&nbsp;&nbsp;containing TLS functions looks like:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; &quot;tls&quot;-+-&quot;peer&quot;-+-&quot;subj&quot;-+-&quot;name&quot; (select_peer_name())
<br>&gt;&gt;&gt;&nbsp;&nbsp;| \<br>&gt;&gt;&gt;&nbsp;&nbsp;| &quot;state&quot; (select_peer_state())<br>&gt;&gt;&gt;&nbsp;&nbsp;|<br>&gt;&gt;&gt;&nbsp;&nbsp;+-&quot;issuer&quot;-+-&quot;name&quot; (select_peer_issuer_name())<br>&gt;&gt;&gt;&nbsp;&nbsp;\<br>&gt;&gt;&gt;&nbsp;&nbsp;&quot;state&quot; (select_peer_issuer_state())
<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Thus when you write @tls.peer.subj.state in the configuration file<br>&gt;&gt;&gt;&nbsp;&nbsp;then the parser will traverse the tree until it reaches<br>&gt;&gt;&gt;&nbsp;&nbsp;select_peer_state() function and then it would remember that this
<br>&gt;&gt;&gt;&nbsp;&nbsp;function should be called.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; The tree of identifiers and functions is built dynamically at runtime.<br>&gt;&gt;&gt;&nbsp;&nbsp;This is a nice feature becase this way modules can register their own
<br>&gt;&gt;&gt;&nbsp;&nbsp;functions or whole subtrees and make their functions available in the<br>&gt;&gt;&gt;&nbsp;&nbsp;configuration file.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Thus if you load TLS module then all @tls.* selects become avaiable,
<br>&gt;&gt;&gt;&nbsp;&nbsp;if you do not load the module they are not available. Only a couple of<br>&gt;&gt;&gt;&nbsp;&nbsp;core functions and the framework is built in the core, the rest can be<br>&gt;&gt;&gt;&nbsp;&nbsp;in modules.<br>&gt;&gt;&gt;
<br>&gt;&gt;&gt; This framework is currently used in tls and xmlrpc modules. XMLRPC<br>&gt;&gt;&gt;&nbsp;&nbsp;module exports the name of the XML-RPC method to the script. TLS<br>&gt;&gt;&gt;&nbsp;&nbsp;module exports information from TLS layer.
<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; The SER core itself contains a couple of functions that can retrieve<br>&gt;&gt;&gt;&nbsp;&nbsp;various parts of a SIP message:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; @from, @from.uri, @to, @to.uri, @from.tag
, @<a href="http://from.name">from.name</a>, @to.tag.<br>&gt;&gt;&gt;&nbsp;&nbsp;@<a href="http://to.name">to.name</a>, @from.params, @to.params, @contact, @contact.uri,<br>&gt;&gt;&gt;&nbsp;&nbsp;@contact.params, @contact.expires, @contact.q
, @via, and so on.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; TLS related functions are described in a separate email.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; sip wrote: Sounds like something I might look more into. Thanks,<br>&gt;&gt;&gt;&gt; Greger. Is
<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt; there<br>&gt;&gt;&gt; anything written more about @var constructs? I checked the admin<br>&gt;&gt;&gt; guide (I<br>&gt;&gt;&gt; know... that was kind of silly considering how out of date it is ;)
<br>&gt;&gt;&gt; ), and<br>&gt;&gt;&gt; tried to do a search in Google (it seems to ignore the @, so @var<br>&gt;&gt;&gt; just gives<br>&gt;&gt;&gt; me every message with the word 'var' in it) and didn't see anything.<br>
&gt;&gt;&gt; Is there<br>&gt;&gt;&gt; anything over at OnSIP discussing it?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; N.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; On Tue, 11 Jul 2006 08:35:11 +0200, Greger V. Teigre wrote<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;If this functionality was added in later openser versions than 
0.9,<br>&gt;&gt;&gt;&nbsp;&nbsp;it will most likely not be in SER. What you are describing is hard<br>&gt;&gt;&gt; to do with the avpops version in 0.9. The avpops module was generic<br>&gt;&gt;&gt; enough to do more than it was designed for; making some code
<br>&gt;&gt;&gt; operations quite dirty in 0.9 (using the ruri as a temporary storage<br>&gt;&gt;&gt; while manipulating a variable). SER head uses @var to more directly<br>&gt;&gt;&gt; access data instead of going through a module. You may want to have
<br>&gt;&gt;&gt; a look at it! g-)<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; sip wrote:<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;Is there a version of textops that can do substs with AVPs that<br>&gt;&gt;&gt; will work on<br>&gt;&gt;&gt; SER 0.9.6 or is that an openSER-only modification of the code?
<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I'm curious because we're ALSO running into the issues of charging the<br>&gt;&gt;&gt; call-forwarding user for forwarding a call to the PSTN instead of<br>&gt;&gt;&gt; charging the<br>&gt;&gt;&gt; calling party. Ideally, I'd like to rewrite the from address solely
<br>&gt;&gt;&gt; for the<br>&gt;&gt;&gt; purpose of authenticating the user who's doing the forwarding and<br>&gt;&gt;&gt; charging him<br>&gt;&gt;&gt; for the call, but that would likely break things as there'd be no<br>
&gt;&gt;&gt; way to get<br>&gt;&gt;&gt; back to the original user if I just rewrote the from username.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; SO, I thought, why not let the b2bua handle the details and just<br>&gt;&gt;&gt; forward a uri
<br>&gt;&gt;&gt; with a prefix string that includes the user who's forwarding the<br>&gt;&gt;&gt; call (the<br>&gt;&gt;&gt; original RURI instead of just the rewritten one).<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; And there's the trick. How do I craft a RURI out of bits and pieces
<br>&gt;&gt;&gt; of things<br>&gt;&gt;&gt; into one long RURI?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; If it were all the same number, I could use prefix, but it's dynamic<br>&gt;&gt;&gt; (as is<br>&gt;&gt;&gt; the nature of most things), so prefix won't work.
<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; How do I take<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; RURI=1105<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; And add to it:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; The rewritten RURI from the call forwarding info: 18005551212
<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; AND the prefix for the b2bua auth: 9999<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; To make:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; new ruri: 9999110518005551212<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; N.<br>&gt;&gt;&gt; _______________________________________________
<br>&gt;&gt;&gt; Serusers mailing list<br>&gt;&gt;&gt; Serusers@lists.iptel.orghttp://lists.iptel.org/mailman/listinfo/serusers<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;<br>&gt;<br>&gt;&gt; _______________________________________________
<br>&gt;&gt; Serusers mailing list<br>&gt;&gt; <a href="mailto:Serusers@lists.iptel.org">Serusers@lists.iptel.org</a><br>&gt;&gt; <a href="http://lists.iptel.org/mailman/listinfo/serusers">http://lists.iptel.org/mailman/listinfo/serusers
</a><br>&gt;<br>&gt;<br>&gt;<br>_______________________________________________<br>Serusers mailing list<br><a href="mailto:Serusers@lists.iptel.org">Serusers@lists.iptel.org</a><br><a href="http://lists.iptel.org/mailman/listinfo/serusers">
http://lists.iptel.org/mailman/listinfo/serusers</a><br></blockquote></div><br>