Commit 727e857e authored by Pekka Pessi's avatar Pekka Pessi

sip: @deprecate sip_q_value()

parent ddfe1717
......@@ -551,7 +551,7 @@ sip_contact_t *sip_contact_immunize(su_home_t *home, sip_contact_t const *m)
* @retval 1000 if contact is immune to caller preferences
* @retval 0..1000 reflecting @RFC3841 score in 0.000 - 1.000.
*
* @sa sip_q_value(),
* @sa msg_q_value(),
* sip_contact_accept(), sip_contact_reject(), sip_contact_is_immune(),
* sip_contact_immunize(), sip_is_callerpref(), sip_prefs_matching(),
* @RFC3841, @AcceptContact, @RejectContact, @Contact
......@@ -592,7 +592,7 @@ int sip_contact_score(sip_contact_t const *m,
}
if (S > 0 && N > 0)
S_total += sip_q_value(ac->cp_q) * (scale * S / N + (2 * S >= N));
S_total += msg_q_value(ac->cp_q) * (scale * S / N + (2 * S >= N));
}
if (!M)
......
......@@ -451,40 +451,12 @@ url_t *sip_url_dup(su_home_t *home, url_t const *o)
* @param q q-value string <code>("1" | "." 1,3DIGIT)</code>
*
* @return An integer in range 0 .. 1000.
*
* @deprecated Use msg_q_value() instead.
*/
unsigned sip_q_value(char const *q)
{
unsigned value = 0;
if (!q)
return 1000;
if (q[0] != '0' && q[0] != '.' && q[0] != '1')
return 500; /* Garbage... */
while (q[0] == '0')
q++;
if (q[0] >= '1' && q[0] <= '9')
return 1000;
if (q[0] == '\0')
return 0;
if (q[0] != '.')
return 500; /* Garbage... */
if (q[1] >= '0' && q[1] <= '9') {
value = (q[1] - '0') * 100;
if (q[2] >= '0' && q[2] <= '9') {
value += (q[2] - '0') * 10;
if (q[3] >= '0' && q[3] <= '9') {
value += (q[3] - '0');
if (q[4] > '5' && q[4] <= '9')
/* Round upwards */
value += 1;
else if (q[4] == '5')
value += value & 1; /* Round to even */
}
}
}
return value;
return msg_q_value(q);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment