[Serusers] language syntax

Greger V. Teigre greger at teigre.com
Mon Dec 20 09:09:52 CET 2004


http://www.iptel.org/ser/doc/seruser/seruser.html is a good reference.
Read examples, I think it was Matt who recommended (good advise): Start with 
an example, don't try to do a lot of things at once, but add a bit of 
functionality at the time.

Good way to think:
All SIP messages will enter the top of the script (the main route).  From 
there on, you can do a whole lot of things, but each SIP message is handled 
in a discrete fashion, you know nothing about previous messages.
    In order to know if a subscriber is registered, you use the save 
function for REGISTER messages. lookup will retrieve the info. Also, very 
limited info about the subscriber can be stored in the form of flags using 
the setflags function. In CVS ser (0.8.9), there is also support for 
attribute-value pairs that can be loaded/stored on a given subscriber.
    The SIP message will not "leave" ser until you execute a relay function 
(i.e. t_relay).  Use break to stop processing a given message. Replies to 
such SIP message can be handled directly (without going through the main 
route) by using t_on_reply and t_on_failures and creating new sections that 
will be executed on these messages.
    The order of your tests will be very important.  For example, the 
loose_route() call should be exactly where it is in the examples.  Some 
messages with "pre-recorded" routes should just quickly be forwarded 
according to the route in the SIP header.  If not, you will experience calls 
that end after a few seconds, or calls that are not set up at all.

    A last advice: In order to do more than just copy an example, you need 
to understand the SIP message flows. 
http://www.iptel.org/ser/doc/sip_intro/sip_introduction.html is a good 
introduction. http://www.iptel.org/sip/siptutorial.pdf is more in-depth.

Good luck!
g-)

murat inal wrote:
> dear all,
>
> i am an absolute newbie at SER, sorry if this is a more-than-essential
> question :)
>
> what do we basically code in ser.cfg? is it a script language? how can
> i learn the syntax of the language?
>
> and then we program SER with codes with remarks like "routing logic".
> how do we learn about the methods & functions used there?
>
> checked for documentation (like ser_howto) from iptel.org site,
> however they are inadequate?
>
> best,
>
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers 




More information about the sr-users mailing list