VoiceMac/Classes/VoiceBase/SIP/MGMSIPAccount.h

124 lines
3.7 KiB
C
Raw Normal View History

2010-09-20 19:44:17 -05:00
//
// MGMSIPAccount.h
// VoiceBase
//
// Created by Mr. Gecko on 9/10/10.
// Copyright (c) 2010 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
//
#if MGMSIPENABLED
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
2010-09-20 19:44:17 -05:00
#import <Cocoa/Cocoa.h>
#endif
#import <pjsua-lib/pjsua.h>
2010-09-20 19:44:17 -05:00
extern NSString * const MGMSIPAccountFullName;
extern NSString * const MGMSIPAccountUserName;
extern NSString * const MGMSIPAccountDomain;
extern NSString * const MGMSIPAccountRegistrar;
extern NSString * const MGMSIPAccountSIPAddress;
extern NSString * const MGMSIPAccountProxy;
extern NSString * const MGMSIPAccountProxyPort;
extern NSString * const MGMSIPAccountRegisterTimeout;
extern NSString * const MGMSIPAccountTransport;
extern NSString * const MGMSIPAccountDTMFToneType;
2010-09-20 19:44:17 -05:00
extern const int MGMSIPAccountDefaultProxyPort;
@class MGMSIPCall, MGMSIPURL;
@protocol MGMSIPAccountDelegate <NSObject>
- (NSString *)password;
- (void)loggedIn;
- (void)loginErrored;
- (void)loggedOut;
- (void)logoutErrored;
- (void)registrationChanged;
- (void)receivedNewCall:(MGMSIPCall *)theCall;
- (void)startingNewCall:(MGMSIPCall *)theCall;
- (void)gotNewCall:(MGMSIPCall *)theCall;
@end
@interface MGMSIPAccount : NSObject {
id<MGMSIPAccountDelegate> delegate;
NSString *fullName;
NSString *userName;
NSString *domain;
NSString *registrar;
NSString *SIPAddress;
NSString *proxy;
int proxyPort;
int reregisterTimeout;
NSTimer *reregisterTimer;
int transport;
int dtmfToneType;
2010-09-20 19:44:17 -05:00
pjsua_acc_id identifier;
BOOL registered;
2010-09-20 19:44:17 -05:00
NSMutableArray *calls;
NSString *lastError;
}
- (id)initWithSettings:(NSDictionary *)theSettings;
- (id)initWithFullName:(NSString *)theFullName userName:(NSString *)theUserName domain:(NSString *)theDomain;
- (id)initWithFullName:(NSString *)theFullName userName:(NSString *)theUserName domain:(NSString *)theDomain SIPAddress:(NSString *)theSIPAddress;
- (id)initWithFullName:(NSString *)theFullName userName:(NSString *)theUserName domain:(NSString *)theDomain SIPAddress:(NSString *)theSIPAddress registrar:(NSString *)theRegistrar;
- (BOOL)informationComplete;
- (id<MGMSIPAccountDelegate>)delegate;
- (void)setDelegate:(id)theDelegate;
- (NSString *)fullName;
- (void)setFullName:(NSString *)theFullName;
- (NSString *)userName;
- (void)setUserName:(NSString *)theUserName;
- (NSString *)domain;
- (void)setDomain:(NSString *)theDomain;
- (NSString *)registrar;
- (void)setRegistrar:(NSString *)theRegistrar;
- (NSString *)SIPAddress;
- (void)setSIPAddress:(NSString *)theSIPAddress;
- (NSString *)proxy;
- (void)setProxy:(NSString *)theProxy;
- (int)proxyPort;
- (void)setProxyPort:(int)theProxyPort;
- (int)reregisterTimeout;
- (void)setReregisterTimeout:(int)theReregisterTimeout;
- (int)transport;
- (void)setTransport:(int)theTransport;
- (int)dtmfToneType;
- (void)setDTMFToneType:(int)theType;
- (pjsua_acc_id)identifier;
- (void)setIdentifier:(pjsua_acc_id)theIdentifier;
2010-09-20 19:44:17 -05:00
- (NSString *)password;
- (NSDictionary *)settings;
- (void)setLastError:(NSString *)theError;
- (NSString *)lastError;
- (BOOL)isLoggedIn;
- (void)login;
- (void)loginErrored;
- (void)logout;
- (void)logoutErrored;
- (void)registrationStateChanged;
2010-09-20 19:44:17 -05:00
- (BOOL)isRegistered;
- (void)reregister;
- (void)setRegistered:(BOOL)isRegistered;
- (int)registrationStatus;
- (NSString *)registrationStatusText;
- (int)registrationExpireTime;
- (BOOL)isOnline;
- (void)setOnline:(BOOL)isOnline;
- (NSString *)onlineStatusText;
- (MGMSIPCall *)addCallWithIdentifier:(int)theIndentifier;
- (MGMSIPCall *)makeCallToNumber:(NSString *)theNumber;
- (MGMSIPCall *)makeCallToSIPURL:(MGMSIPURL *)theURL;
- (NSArray *)calls;
- (MGMSIPCall *)callWithIdentifier:(int)theIdentifier;
- (void)removeCall:(MGMSIPCall *)theCall;
@end
#endif