login | register
Wed 01 of Aug, 2007 [09:23 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.

Web www.voip-info.org
Shoutbox
  • Aykut, Wed 01 of Aug, 2007 [07:53 UTC]: Hi all, does anybody know about Thomson ST2030 SIP phone. I have upgraded it to latest version (1.56) but "Hold" and "Conf" features are not working after the upgrade ?? Do you know any solution or do you have Ver. 1.52 ?? Where can I find it?
  • Edward J Brown, Tue 31 of Jul, 2007 [23:33 UTC]: Has anybody experienced Choppy voice quality when using a Linksys SPA942 in an Asterisk Conference bridge? It works fine with my polycom and Cisco, but sucks with my Linksys.
  • www.astawerks.com, Fri 27 of Jul, 2007 [18:00 UTC]: does anyone use asterisk on top of clark connect? does it work good?
  • simon, Fri 27 of Jul, 2007 [14:16 UTC]: Hi All, Has anyone here managed to get the Cisco79x1 to successfully fail over to the backup proxy. I have 2 asterisk servers , handsets all register and function, except that backup proxy function doesn't work. Any working example would be very apprecia
  • Matthew Richmond, Thu 26 of Jul, 2007 [03:40 UTC]: using the page() application to page across our building...often the meetme conferences don't disconnect after the caller hangs up. Anyone else having this problem. (using Polycom phones)
  • Matthew Richmond, Wed 25 of Jul, 2007 [02:58 UTC]: thanks Nicholas Blasgen! I haven't worked with AGI before, but there's always a first! Thanks again!
  • Nicholas Blasgen, Tue 24 of Jul, 2007 [19:18 UTC]: Matthew Richmond, AGI will handle all that for you.
  • sam, Mon 23 of Jul, 2007 [16:39 UTC]: need help - certain voicemail extension will stop working and recording voicemail on asterisk - anyone know why and how to fix it? Thanks
  • john haji, Mon 23 of Jul, 2007 [14:55 UTC]: free calls to pakistan
  • bong, Sat 21 of Jul, 2007 [19:09 UTC]: hi good day to all can anyone help me how to configured the nortel sip to the signaling server and how to activate in mobile w/ sip compatible without mcs
Server Stats
  • Execution time: 0.63s
  • Memory usage: 2.19MB
  • Database queries: 29
  • GZIP: Disabled
  • Server load: 3.26

STS Template Engine

Using the STS Template Engine to generate Asterisk configuration files

The STS Template Engine, developed by Sunrise Telephone Systems is a universal template engine for Cocoa featuring its own macro language for conditional template expansion. Although it can be used for any kind of template expansion requirement, it was developed for the purpose of generating Asterisk configuration files from templates.

The STS Template Engine is released under the GPL version 2 as Objective-C source code for embedding into Cocoa or GNUstep applications. A download link and detailed documentation is at http://www.sunrise-tel.com/STSTemplateEngine.html.

Overview


Methods provided

  • stringByExpandingTemplate:usingDictionary:errorsReturned:
  • stringByExpandingTemplate:withStartTag:andEndTag:usingDictionary:errorsReturned:
  • stringByExpandingTemplateAtPath:usingDictionary:encoding:errorsReturned:
  • stringByExpandingTemplateAtPath:withStartTag:andEndTag:usingDictionary:encoding:errorsReturned:

Macros supported

%IF, %IFNOT, %IFEQ, %IFNEQ, %IFDEF, %IFNDEF, %ELSIF, %ELSIFNOT, %ELSIFEQ, %ELSIFNEQ, %ELSIFDEF, %ELSIFNDEF, %ELSE, %ENDIF, %DEFINE, %UNDEF, %LOG, %ECHO and %DEBUG.

Predefined Placeholder Variables

_timestamp, _uniqueID, _hostname, _userCountryCode, _userLanguage, _systemCountryCode, _systemLanguage

Example template

%% Configuration template to generate X-Lite SIP profile for Asterisk
%% created 06-JUL-2005 by Sunrise Telephone Systems Ltd.
%% version 1.00
%%
%% The generated configlet must be included in /etc/asterisk/sip.conf
%%
%%
; THIS FILE HAS BEEN AUTOGENERATED %«_timestamp»
; DO NOT EDIT THIS FILE - MODIFICATIONS MAY BE OVERRIDDEN
;
;
[xlite] ; SIP profile for local X-Lite on %«_hostname»
port=5061
host=127.0.0.1
type=friend
qualify=no
reinvite=no
canreinvite=no
disallow=all
%IF allowUlaw
allow=ulaw
%ENDIF
%IF allowAlaw
allow=alaw
%ENDIF
%IF allowGSM
allow=gsm
%ENDIF
%IF allowILBC
allow=ilbc
%ENDIF
context=autocontext
callerid="%«username»"<%«callerid»>
;
%% END OF TEMPLATE

Example code

- (IBAction)createConfiglet:(id)sender {
       NSString *configlet;
       NSDictionary *userInput;
       NSArray *errorLog = [[NSArray alloc] init];
       
       // initialise the dicitionary with the user input
       userInput = [NSDictionary dictionaryWithObjectsAndKeys:
               [usernameField stringValue], @"username",
               [cidnumberField stringValue], @"callerid",
               [ringtimerField stringValue], @"ringtimer",
               [ulawCheckbox stringValue], @"allowUlaw",
               [alawCheckbox stringValue], @"allowAlaw",
               [gsmCheckbox stringValue], @"allowGSM",
               [ilbcCheckbox stringValue], @"allowILBC",
               nil];

       // expand the template to create the configlet
       configlet = [NSString stringByExpandingTemplateAtPath:
               @"/Library/Application Support/Asterisk/templates/xlite.template"
               usingDictionary:userInput
               encoding:NSUTF8StringEncoding
               errorsReturned:&errorLog];
       
       // etc

More Details

For a more detailed description please visit http://www.sunrise-tel.com/STSTemplateEngine.html


See also


Created by STS, Last modification by STS on Tue 12 of Dec, 2006 [12:21 UTC]

Comments Filter

by Smart Network Solutions on Tuesday 12 of December, 2006 [12:05:45 UTC]
PLEASE DONT DO DAMAGE TO OTHERS

by Smart Network Solutions on Tuesday 12 of December, 2006 [12:02:10 UTC]
dear sir STS corporation we will appreciate if you can leave the name of Smart Network Solutions clean there is not proper behave to damage a corporation name just for the strong mistake but please do respect others trying to do proper business in the market if you need to write anyting to us our email is sales@smartisvoip.com we will be happy to talk also please do not place nazi things on our site we are serious people trying to do serious business

Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2007 Arte Marketing, Inc.

Powered by bitweaver