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