rendered paste body#import "FreeSWITCH.h"
#include <switch.h>
@implementation FreeSWITCH
int running = 0;
- (IBAction)start:(id)sender
{
char *ppath = NULL;
const char *err = NULL;
if (!running && (switch_core_init_and_modload(ppath, &err) != SWITCH_STATUS_SUCCESS)) {
[textField setStringValue:@"FreeSWITCH Error"];
running = 0;
} else {
[textField setStringValue:@"FreeSWITCH Started"];
running = 1;
}
}
- (IBAction)stop:(id)sender
{
if (running) {
switch_core_destroy();
running = 0;
[textField setStringValue:@"FreeSWITCH Stopped"];
} else {
[textField setStringValue:@"FreeSWITCH Not Running"];
}
}
- (void)awakeFromNib
{
[textField setStringValue:@"Click Start"];
}
@end