Changes between Version 5 and Version 6 of pjsip-doc/account
- Timestamp:
- Feb 6, 2014 12:23:13 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
pjsip-doc/account
v5 v6 4 4 Accounts 5 5 ========= 6 Accounts provide identity (or identities) of the user who is currently using the application. An account has one SIP Uniform Resource Identifier (URI) associated with it. In SIP terms, th e identityis used as the From header in outgoing requests.6 Accounts provide identity (or identities) of the user who is currently using the application. An account has one SIP Uniform Resource Identifier (URI) associated with it. In SIP terms, this URI acts as Address of Record (AOR) of the person and is used as the From header in outgoing requests. 7 7 8 Account may or may not have client registration associated with it. An account is also associated with route set and some authentication credentials, which are used when sending SIP request messages using the account. An account also has presence onlinestatus, which will be reported to remote peer when they subscribe to the account's presence, or which is published to a presence server if presence publication is enabled for the account.8 Account may or may not have client registration associated with it. An account is also associated with route set and some authentication credentials, which are used when sending SIP request messages using the account. An account also has presence status, which will be reported to remote peer when they subscribe to the account's presence, or which is published to a presence server if presence publication is enabled for the account. 9 9 10 10 At least one account MUST be created in the application, since any outgoing requests require an account context. If no user association is required, application can create a userless account by calling Account.create(). A userless account identifies local endpoint instead of a particular user, and it corresponds to a particular transport ID. 11 11 12 Also one account must be set as the default account, which will be used as the account identity when pjsua fails to match therequest with any accounts using the stricter matching rules.12 Also one account must be set as the default account, which will be used as the account identity when pjsua fails to match incoming request with any accounts using the stricter matching rules. 13 13 14 14 Subclassing the Account class 15 15 --------------------------------- 16 To use the Account class, normally application SHOULD create its own subclass, such as:: 16 To use the Account class, normally application SHOULD create its own subclass, in order to receive notifications for the account. For example: 17 18 .. code-block:: c++ 17 19 18 20 class MyAccount : public Account … … 32 34 { 33 35 Call *call = new MyCall(*this, iprm.callId); 34 // Delete the call, which will also hangup the call 36 37 // Just hangup for now 38 CallOpParam op; 39 op.statusCode = PJSIP_SC_DECLINE; 40 call->hangup(op); 41 42 // And delete the call 35 43 delete call; 36 44 } … … 56 64 A userless account identifies a particular SIP endpoint rather than a particular user. Some other SIP softphones may call this peer-to-peer mode, which means that we are calling another computer via its address rather than calling a particular user ID. 57 65 58 So for example, we might identify ourselves as "sip:192.168.0.15" (a userless account) rather than, say, "sip: bennylp@pjsip.org".66 So for example, we might identify ourselves as "sip:192.168.0.15" (a userless account) rather than, say, "sip:alice@pjsip.org". 59 67 60 68 In pjsua, a userless account corresponds to a particular transport. Creating userless account is very simple, all we need is the transport ID which is returned by Endpoint.transportCreate() method as explained in previous chapter.