Browse code

- removed duplicated doxygen comment

Jan Janak authored on 02/02/2008 13:00:09
Showing 1 changed files
... ...
@@ -140,78 +140,6 @@ int set_to_uid(str* uid)
140 140
 }
141 141
 
142 142
 
143
-/** Retrieves the UID of the callee. This function retrieves the UID (unique
144
- * identifier) of the party being called. The function first searches the list
145
- * of available attributes and if it finds an attribute with name "uid" then
146
- * the value of the attribute is returned.  If no such attribute can be found
147
- * then the function retrieves the username from To header field of REGISTER
148
- * requests (because that is the party being registered), or the username from
149
- * the Reqeuest-URI of other requests. The username is then used as the UID
150
- * string identifying the callee. If no attribute with the UID was found and
151
- * the function successfully retrieved the UID from the SIP message then, in
152
- * addition to storing the result in the first parameter, the function will
153
- * also create the attribute named "uid" which will contain the UID. The
154
- * function is not reentrant because it uses an internal static buffer to
155
- * store the result.  
156
- * @param uid A pointer to ::str variable where the result will be stored, the
157
- *            pointer in the variable will be updated to point to a static
158
- *            buffer in the function.
159
- * @param msg The SIP message being processed.
160
- * @return 1 is returned when the attribute with UID exists and it is used, 0
161
- *         is returned when the function retrieved the UID from the SIP
162
- *         message and created the attribute, -1 is returned on error.
163
- */
164
-int get_to_uid(str* uid, struct sip_msg* msg)
165
-{
166
-	static char buf[MAX_URI_SIZE];
167
-	struct to_body* to;
168
-	struct sip_uri puri;
169
-	char* p;
170
-	int_str val, name;
171
-
172
-	name.s = uid_name;
173
-	if (search_first_avp(AVP_CLASS_USER | AVP_TRACK_TO | AVP_NAME_STR, name, &val, 0)) {
174
-		*uid = val.s;
175
-		return 1;
176
-	} else {
177
-		if (msg->first_line.type == METHOD_REGISTER) {
178
-			if ((msg->to==0) && 
179
-				(parse_headers(msg, HDR_TO_F, 0) < 0 || msg->to == 0)) {
180
-				DBG("get_to_uid: Error while parsing To URI: "
181
-					" to header bad or missing\n");
182
-				return -1;
183
-			}
184
-			to = get_to(msg);
185
-			if (parse_uri(to->uri.s, to->uri.len, &puri) == -1) {
186
-				DBG("get_to_uid: Error while parsing To URI\n");
187
-				return -1;
188
-			}
189
-			p = puri.user.s;
190
-			uid->len = puri.user.len;
191
-		} else {
192
-			if (!msg->parsed_uri_ok && (parse_sip_msg_uri(msg) < 0)) {
193
-				DBG("Error while parsing the Request-URI\n");
194
-				return -1;
195
-			}
196
-			p = msg->parsed_uri.user.s;
197
-			uid->len = msg->parsed_uri.user.len;
198
-		}
199
-			
200
-		if (uid->len > MAX_URI_SIZE) {
201
-			DBG("get_to_uid: Username too long\n");
202
-			return -1;
203
-		}
204
-		memcpy(buf, puri.user.s, puri.user.len);
205
-		uid->s = buf;
206
-		strlower(uid);
207
-
208
-		val.s = *uid;
209
-		add_avp(AVP_CLASS_USER | AVP_TRACK_TO | AVP_NAME_STR | AVP_VAL_STR, name, val);
210
-		return 0;
211
-	}
212
-}
213
-
214
-
215 143
 /*
216 144
  * Return current To domain id
217 145
  */