Ignore:
Timestamp:
Mar 15, 2018 3:00:59 AM (7 years ago)
Author:
nanang
Message:

Close #2100:

  • Added new APIs:
    • PJMEDIA: pjmedia_srtp_enum_crypto(), pjmedia_srtp_enum_keying()
    • PJSUA: pjsua_config.srtp_opt, pjsua_acc_config.srtp_opt, pjsua_srtp_opt_default()
    • PJSUA2: AccountMediaConfig::srtpOpt, Endpoint::srtpCryptoEnum()
  • Deprecated PJSUA callback on_create_media_transport_srtp() (not removed yet, just warnings).
  • Slightly refactored SRTP code:
    • Fixed potential issue with on_create_media_transport_srtp(), some PJSUA internal values in pjmedia_srtp_setting may be overridden by app.
    • Fixed few issues in SRTP and keying mechanism, e.g: premature local SDP modification (it should be done after verification).
    • Potential minor backward compatibility issue: default value of pjmedia_srtp_setting.crypto_count is now zero, previously it was initialized with all crypto via pjmedia_srtp_setting_default(), actually zero and all cryptos in this setting semantically are the same.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua2/account.hpp

    r5649 r5755  
    704704 
    705705/** 
     706 * SRTP crypto. 
     707 */ 
     708struct SrtpCrypto 
     709{ 
     710    /** 
     711     * Optional key. If empty, a random key will be autogenerated. 
     712     */ 
     713    string      key; 
     714 
     715    /** 
     716     * Crypto name. 
     717     */ 
     718    string      name; 
     719 
     720    /** 
     721     * Flags, bitmask from #pjmedia_srtp_crypto_option 
     722     */ 
     723    unsigned    flags; 
     724 
     725public: 
     726    /** 
     727     * Convert from pjsip 
     728     */ 
     729    void fromPj(const pjmedia_srtp_crypto &prm); 
     730 
     731    /** 
     732     * Convert to pjsip 
     733     */ 
     734    pjmedia_srtp_crypto toPj() const; 
     735}; 
     736 
     737struct SrtpOpt : public PersistentObject 
     738{ 
     739    /** 
     740     * Specify SRTP cryptos. If empty, all crypto will be enabled. 
     741     * Available crypto can be enumerated using Endpoint::srtpCryptoEnum(). 
     742     * 
     743     * Default: empty. 
     744     */ 
     745    vector<SrtpCrypto>          cryptos; 
     746 
     747    /** 
     748     * Specify SRTP keying methods, valid keying method is defined in 
     749     * pjmedia_srtp_keying_method. If empty, all keying methods will be 
     750     * enabled with priority order: SDES, DTLS-SRTP. 
     751     * 
     752     * Default: empty. 
     753     */ 
     754    IntVector                   keyings; 
     755 
     756public: 
     757    /** 
     758     * Default constructor initializes with default values. 
     759     */ 
     760    SrtpOpt(); 
     761 
     762    /** 
     763     * Convert from pjsip 
     764     */ 
     765    void fromPj(const pjsua_srtp_opt &prm); 
     766 
     767    /** 
     768     * Convert to pjsip 
     769     */ 
     770    pjsua_srtp_opt toPj() const; 
     771 
     772public: 
     773    /** 
     774     * Read this object from a container node. 
     775     * 
     776     * @param node              Container to read values from. 
     777     */ 
     778    virtual void readObject(const ContainerNode &node) throw(Error); 
     779 
     780    /** 
     781     * Write this object to a container node. 
     782     * 
     783     * @param node              Container to write values to. 
     784     */ 
     785    virtual void writeObject(ContainerNode &node) const throw(Error); 
     786}; 
     787 
     788/** 
    706789 * Account media config (applicable for both audio and video). This will be 
    707790 * specified in AccountConfig. 
     
    753836     */ 
    754837    int                 srtpSecureSignaling; 
     838 
     839    /** 
     840     * Specify SRTP settings, like cryptos and keying methods. 
     841     */ 
     842    SrtpOpt             srtpOpt; 
    755843 
    756844    /** 
Note: See TracChangeset for help on using the changeset viewer.