by Smart Network Solutions on Tuesday 12 of December, 2006 [12:05:45 UTC]
PLEASE DONT DO DAMAGE TO OTHERS
|
Today's Deals Free Tool:
What does VOIP actually cost? Free 90 Page IP Telephony Pocket Guide Free VON Magazine Subscription Search with Google Search this site with Google. Results may not include recent changes.
Last Changes Shoutbox
Server Stats
|
STS Template EngineUsing 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. OverviewMethods provided
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, _systemLanguageExample 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 DetailsFor a more detailed description please visit http://www.sunrise-tel.com/STSTemplateEngine.htmlSee also
|