|
|
@ -2325,42 +2325,49 @@ static struct cfalias {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*--- get_sdp_by_line: Reads one line of SIP message body */
|
|
|
|
/*--- get_sdp_by_line: Reads one line of SIP message body */
|
|
|
|
static char* get_sdp_by_line(char* line, char *name, int nameLen) {
|
|
|
|
static char* get_sdp_by_line(char* line, char *name, int nameLen)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (strncasecmp(line, name, nameLen) == 0 && line[nameLen] == '=') {
|
|
|
|
if (strncasecmp(line, name, nameLen) == 0 && line[nameLen] == '=') {
|
|
|
|
char* r = line + nameLen + 1;
|
|
|
|
char* r = line + nameLen + 1;
|
|
|
|
while (*r && (*r < 33)) ++r;
|
|
|
|
while (*r && (*r < 33))
|
|
|
|
|
|
|
|
++r;
|
|
|
|
return r;
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return "";
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*--- get_sdp: Gets all kind of SIP message bodies, including SDP,
|
|
|
|
/*--- get_sdp: Gets all kind of SIP message bodies, including SDP,
|
|
|
|
but the name wrongly applies _only_ sdp */
|
|
|
|
but the name wrongly applies _only_ sdp */
|
|
|
|
static char *get_sdp(struct sip_request *req, char *name) {
|
|
|
|
static char *get_sdp(struct sip_request *req, char *name)
|
|
|
|
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
int x;
|
|
|
|
int len = strlen(name);
|
|
|
|
int len = strlen(name);
|
|
|
|
char *r;
|
|
|
|
char *r;
|
|
|
|
|
|
|
|
|
|
|
|
for (x=0; x<req->lines; x++) {
|
|
|
|
for (x=0; x<req->lines; x++) {
|
|
|
|
r = get_sdp_by_line(req->line[x], name, len);
|
|
|
|
r = get_sdp_by_line(req->line[x], name, len);
|
|
|
|
if (r[0] != '\0') return r;
|
|
|
|
if (r[0] != '\0')
|
|
|
|
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void sdpLineNum_iterator_init(int* iterator) {
|
|
|
|
static void sdpLineNum_iterator_init(int* iterator)
|
|
|
|
|
|
|
|
{
|
|
|
|
*iterator = 0;
|
|
|
|
*iterator = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static char* get_sdp_iterate(int* iterator,
|
|
|
|
static char* get_sdp_iterate(int* iterator,
|
|
|
|
struct sip_request *req, char *name) {
|
|
|
|
struct sip_request *req, char *name)
|
|
|
|
|
|
|
|
{
|
|
|
|
int len = strlen(name);
|
|
|
|
int len = strlen(name);
|
|
|
|
char *r;
|
|
|
|
char *r;
|
|
|
|
|
|
|
|
|
|
|
|
while (*iterator < req->lines) {
|
|
|
|
while (*iterator < req->lines) {
|
|
|
|
r = get_sdp_by_line(req->line[(*iterator)++], name, len);
|
|
|
|
r = get_sdp_by_line(req->line[(*iterator)++], name, len);
|
|
|
|
if (r[0] != '\0') return r;
|
|
|
|
if (r[0] != '\0')
|
|
|
|
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|