diff -r channels/chan_sip.c ../asterisk-1.8.3/channels/chan_sip.c 9926,9951d9925 < /*! \brief Respond with minimum sec-agree negotiotion */ < static int transmit_response_with_sec_agree(struct sip_pvt *p, const char *msg, const struct sip_request *req, const char *randdata, enum xmittype reliable, const char *header, int stale) < { < struct sip_request resp; < char tmp[512]; < int seqno = 0; < < if (reliable && (sscanf(get_header(req, "CSeq"), "%30d ", &seqno) != 1)) { < ast_log(LOG_WARNING, "Unable to determine sequence number from '%s'\n", get_header(req, "CSeq")); < return -1; < } < /* Choose Realm */ < get_realm(p, req); < < /* < Digest algorithm and security server are hardcoded to be compatible with Nokia SIP client default parameters. < According to RFC3329 they must be dinamically negotiated. < */ < snprintf(tmp, sizeof(tmp), "Digest algorithm=MD5, realm=\"%s\", nonce=\"%s\"%s", p->realm, randdata, stale ? ", stale=true" : ""); < respprep(&resp, p, msg, req); < add_header(&resp, header, tmp); < add_header(&resp, "Security-Server", "digest"); < append_history(p, "AuthChal", "Auth challenge sent for %s - nc %d", p->username, p->noncecount); < return send_response(p, &resp, reliable, seqno); < } < 13426,13433d13399 < if(!strcmp(get_header(req, "Require"), sip_options[18].text)){//18 corresponds to sec-agree in sip.h < /* Here comes the RFC3329 negotiation in the case where the client initates the security agreement*/ < /* We have no auth, so issue challenge and request authentication */ < set_nonce_randdata(p, 1); /* Create nonce for challenge */ < transmit_response_with_sec_agree(p, "494 Security Agreement Required", req, p->randdata, reliable, respheader, 0); < sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); < return AUTH_CHALLENGE_SENT; < } diff -r channels/sip/include/sip.h ../asterisk-1.8.3/channels/sip/include/sip.h 1758c1758 < { SIP_OPT_SEC_AGREE, SUPPORTED, "sec-agree" }, --- > { SIP_OPT_SEC_AGREE, NOT_SUPPORTED, "sec_agree" },