Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 320171) +++ channels/chan_sip.c (working copy) @@ -17123,6 +17123,7 @@ ast_cli(fd, " Parkinglot : %s\n", peer->parkinglot); ast_cli(fd, " Use Reason : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[1], SIP_PAGE2_Q850_REASON))); ast_cli(fd, " Encryption : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[1], SIP_PAGE2_USE_SRTP))); + ast_cli(fd, " Ign.Lifetime : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[2], SIP_PAGE3_IGNORE_CRYPTO_LIFETIME))); ast_cli(fd, "\n"); peer = unref_peer(peer, "sip_show_peer: unref_peer: done with peer ptr"); } else if (peer && type == 1) { /* manager listing */ @@ -17179,6 +17180,7 @@ astman_append(s, "SIP-Sess-Min: %d\r\n", peer->stimer.st_min_se); astman_append(s, "SIP-RTP-Engine: %s\r\n", peer->engine); astman_append(s, "SIP-Encryption: %s\r\n", ast_test_flag(&peer->flags[1], SIP_PAGE2_USE_SRTP) ? "Y" : "N"); + astman_append(s, "SRTP-Ignore-Lifetime: %s\r\n", ast_test_flag(&peer->flags[2], SIP_PAGE3_IGNORE_CRYPTO_LIFETIME) ? "Y" : "N"); /* - is enumerated */ astman_append(s, "SIP-DTMFmode: %s\r\n", dtmfmode2str(ast_test_flag(&peer->flags[0], SIP_DTMF))); @@ -26903,6 +26905,8 @@ ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_USE_SRTP); } else if (!strcasecmp(v->name, "snom_aoc_enabled")) { ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_SNOM_AOC); + } else if (!strcasecmp(v->name, "ignorecryptolifetime")) { + ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_IGNORE_CRYPTO_LIFETIME); } } @@ -28826,7 +28830,7 @@ return FALSE; } - if (sdp_crypto_process((*srtp)->crypto, a, rtp) < 0) { + if (sdp_crypto_process((*srtp)->crypto, a, rtp, ast_test_flag(&p->flags[2], SIP_PAGE3_IGNORE_CRYPTO_LIFETIME)) < 0) { return FALSE; } Index: channels/sip/include/sip.h =================================================================== --- channels/sip/include/sip.h (revision 320171) +++ channels/sip/include/sip.h (working copy) @@ -350,9 +350,10 @@ #define SIP_PAGE3_SNOM_AOC (1 << 0) /*!< DPG: Allow snom aoc messages */ +#define SIP_PAGE3_IGNORE_CRYPTO_LIFETIME (1 << 1) /*!< DP: Ignore the optional crypto 'lifetime' SRTP key component if offered? */ #define SIP_PAGE3_FLAGS_TO_COPY \ - (SIP_PAGE3_SNOM_AOC) + (SIP_PAGE3_SNOM_AOC | SIP_PAGE3_IGNORE_CRYPTO_LIFETIME) /*@}*/ Index: channels/sip/include/sdp_crypto.h =================================================================== --- channels/sip/include/sdp_crypto.h (revision 320171) +++ channels/sip/include/sdp_crypto.h (working copy) @@ -51,11 +51,12 @@ * \param p A valid sdp_crypto struct * \param attr the a:crypto line from SDP * \param rtp The rtp instance associated with the SDP being parsed + * \param ignore_lifetime * * \retval 0 success * \retval nonzero failure */ -int sdp_crypto_process(struct sdp_crypto *p, const char *attr, struct ast_rtp_instance *rtp); +int sdp_crypto_process(struct sdp_crypto *p, const char *attr, struct ast_rtp_instance *rtp, int ignore_lifetime); /*! \brief Generate an SRTP a=crypto offer Index: channels/sip/sdp_crypto.c =================================================================== --- channels/sip/sdp_crypto.c (revision 320171) +++ channels/sip/sdp_crypto.c (working copy) @@ -188,7 +188,7 @@ return res; } -int sdp_crypto_process(struct sdp_crypto *p, const char *attr, struct ast_rtp_instance *rtp) +int sdp_crypto_process(struct sdp_crypto *p, const char *attr, struct ast_rtp_instance *rtp, int ignore_lifetime) { char *str = NULL; char *tag = NULL; @@ -246,7 +246,7 @@ key_salt = strsep(&info, "|"); lifetime = strsep(&info, "|"); - if (lifetime) { + if (lifetime && !ignore_lifetime){ ast_log(LOG_NOTICE, "Crypto life time unsupported: %s\n", attr); continue; } Index: configs/sip.conf.sample =================================================================== --- configs/sip.conf.sample (revision 320171) +++ configs/sip.conf.sample (working copy) @@ -887,6 +887,11 @@ ; on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if ; the peer does not support SRTP. Defaults to no. +;ignorecryptolifetime=yes ; Ignore the optional 'lifetime' SRTP Key component if it is specified + ; Asterisk does not currently support crypto lifetime and will reject + ; a crypto key if the optional master key lifetime component is specified. + ; By default this option is off. + ;----------------------------------------- REALTIME SUPPORT ------------------------ ; For additional information on ARA, the Asterisk Realtime Architecture, ; please read https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration