~ubuntu-branches/debian/sid/sflphone/sid

« back to all changes in this revision

Viewing changes to daemon/src/sip/sipaccount.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-06-02 18:04:11 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130602180411-3rcpy8c1zdlo8y0s
Tags: 1.2.2-1
* New upstream release
* changeset_rb68857a4b485b7d43f92714cd5792595ff895f82.diff - fix QTest
* pjproject ./configure --disable-sound --disable-video

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
 
2
 *  Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
3
3
 *
4
4
 *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
5
5
 *  Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
18
18
 *
19
19
 *  You should have received a copy of the GNU General Public License
20
20
 *  along with this program; if not, write to the Free Software
21
 
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
21
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
22
22
 *
23
23
 *  Additional permission under GNU GPL version 3 section 7:
24
24
 *
56
56
    const char *const SAME_AS_LOCAL_KEY = "sameasLocal";
57
57
    const char *const DTMF_TYPE_KEY = "dtmfType";
58
58
    const char *const SERVICE_ROUTE_KEY = "serviceRoute";
59
 
    const char *const UPDATE_CONTACT_HEADER_KEY = "updateContact";
60
59
    const char *const KEEP_ALIVE_ENABLED = "keepAlive";
61
60
 
62
61
    // TODO: write an object to store credential which implement serializable
134
133
         * Populate the internal state for this account based on info stored in the configuration file
135
134
         * @param The configuration node for this account
136
135
         */
137
 
        virtual void unserialize(const Conf::MappingNode &map);
 
136
        virtual void unserialize(const Conf::YamlNode &map);
138
137
 
139
138
        /**
140
139
         * Set the internal state for this account, mainly used to manage account details from the client application.
249
248
                registrationExpire_ = 0;
250
249
        }
251
250
 
252
 
        bool fullMatch(const std::string& username, const std::string& hostname) const;
253
 
        bool userMatch(const std::string& username) const;
254
 
        bool hostnameMatch(const std::string& hostname) const;
255
 
        bool proxyMatch(const std::string& hostname) const;
256
 
 
257
251
        /**
258
252
         * Registration flag
259
253
         */
373
367
        std::string getServerUri() const;
374
368
 
375
369
        /**
376
 
         * Set the contact header
377
 
         * @param port Optional port. Otherwise set to the port defined for that account.
378
 
         * @param hostname Optional local address. Otherwise set to the hostname defined for that account.
379
 
         */
380
 
        void setContactHeader(std::string address, std::string port);
381
 
 
382
 
        /**
383
370
         * Get the contact header for
384
371
         * @return pj_str_t The contact header based on account information
385
372
         */
386
 
        std::string getContactHeader(void) const;
387
 
 
388
 
        /**
389
 
         * The contact header can be rewritten based on the contact provided by the registrar in 200 OK
390
 
         */
391
 
        void enableContactUpdate(void) {
392
 
            contactUpdateEnabled_ = true;
393
 
        }
394
 
 
395
 
        /**
396
 
         * The contact header is not updated even if the registrar
397
 
         */
398
 
        void disableContactUpdate(void) {
399
 
            contactUpdateEnabled_ = false;
400
 
        }
401
 
 
402
 
        bool isContactUpdateEnabled(void) {
403
 
            return contactUpdateEnabled_;
404
 
        }
 
373
        std::string getContactHeader() const;
405
374
 
406
375
        /**
407
376
         * Get the local interface name on which this account is bound.
472
441
            return publishedIpAddress_;
473
442
        }
474
443
 
475
 
        /**
476
 
         * Set the public IP address to be used in Contact header.
477
 
         * @param The public IPV4 address in the standard dot notation.
478
 
         * @return void
479
 
         */
480
 
        void setPublishedAddress(const std::string &publishedIpAddress) {
481
 
            publishedIpAddress_ = publishedIpAddress;
482
 
        }
483
 
 
484
444
        std::string getServiceRoute() const {
485
445
            return serviceRoute_;
486
446
        }
487
447
 
 
448
        bool hasServiceRoute() const { return not serviceRoute_.empty(); }
 
449
 
488
450
        std::string getDtmfType() const {
489
451
            return dtmfType_;
490
452
        }
537
499
         */
538
500
        pjsip_transport* transport_;
539
501
 
 
502
        /* Returns true if the username and/or hostname match this account */
 
503
        bool matches(const std::string &username, const std::string &hostname, pjsip_endpoint *endpt, pj_pool_t *pool) const;
 
504
 
540
505
    private:
541
506
        NON_COPYABLE(SIPAccount);
542
507
 
 
508
        bool fullMatch(const std::string &username, const std::string &hostname, pjsip_endpoint *endpt, pj_pool_t *pool) const;
 
509
        bool userMatch(const std::string &username) const;
 
510
        bool hostnameMatch(const std::string &hostname, pjsip_endpoint *endpt, pj_pool_t *pool) const;
 
511
        bool proxyMatch(const std::string &hostname, pjsip_endpoint *endpt, pj_pool_t *pool) const;
 
512
 
543
513
        /**
544
514
         * Map of credential for this account
545
515
         */
559
529
        void initTlsConfiguration();
560
530
 
561
531
        /**
 
532
         * Display the list of ciphers currently supported on the
 
533
         */
 
534
        void displayCipherSuite();
 
535
 
 
536
        /**
562
537
         * Initializes STUN config from the config file
563
538
         */
564
539
        void initStunConfiguration();
647
622
        CipherArray ciphers;
648
623
 
649
624
        /**
650
 
         * The CONTACT header used for registration as provided by the registrar, this value could differ
651
 
         * from the host name in case the registrar is inside a subnetwork (such as a VPN).
652
 
         * The header will be stored
653
 
         */
654
 
        std::string contactHeader_;
655
 
 
656
 
        /**
657
 
         * Enble the contact header based on the header received from the registrar in 200 OK
658
 
         */
659
 
        bool contactUpdateEnabled_;
660
 
 
661
 
        /**
662
625
         * The STUN server name (hostname)
663
626
         */
664
627
        pj_str_t stunServerName_;