static void sip_destroy_peer(struct sip_peer *peer);
static void sip_destroy_user(struct sip_user *user);
static void parse_request(struct sip_request *req);
-static const char *get_header(struct sip_request *req, const char *name);
+static const char *get_header(const struct sip_request *req, const char *name);
static void copy_request(struct sip_request *dst,struct sip_request *src);
static int transmit_response_reliable(struct sip_pvt *p, char *msg, struct sip_request *req);
static int transmit_register(struct sip_registry *r, int sipmethod, char *auth, char *authheader);
}
/*! \brief Reads one line of SIP message body */
-static char* get_sdp_by_line(char* line, char *name, int nameLen)
+static const char* get_sdp_by_line(const char* line, const char *name, int nameLen)
{
- if (strncasecmp(line, name, nameLen) == 0 && line[nameLen] == '=') {
+ if (strncasecmp(line, name, nameLen) == 0 && line[nameLen] == '=')
return ast_skip_blanks(line + nameLen + 1);
- }
return "";
}
/*! \brief Gets all kind of SIP message bodies, including SDP,
but the name wrongly applies _only_ sdp */
-static char *get_sdp(struct sip_request *req, char *name)
+static const char *get_sdp(struct sip_request *req, char *name)
{
int x;
int len = strlen(name);
for (x = 0; x < req->lines; x++) {
- char *r = get_sdp_by_line(req->line[x], name, len);
+ const char *r = get_sdp_by_line(req->line[x], name, len);
if (r[0] != '\0')
return r;
}
*iterator = 0;
}
-static char* get_sdp_iterate(int* iterator,
+static const char* get_sdp_iterate(int* iterator,
struct sip_request *req, char *name)
{
int len = strlen(name);
while (*iterator < req->lines) {
- char *r = get_sdp_by_line(req->line[(*iterator)++], name, len);
+ const char *r = get_sdp_by_line(req->line[(*iterator)++], name, len);
if (r[0] != '\0')
return r;
}
return _default;
}
-static const char *__get_header(struct sip_request *req, const char *name, int *start)
+static const char *__get_header(const struct sip_request *req, const char *name, int *start)
{
int pass;
}
/*! \brief Get header from SIP request */
-static const char *get_header(struct sip_request *req, const char *name)
+static const char *get_header(const struct sip_request *req, const char *name)
{
int start = 0;
return __get_header(req, name, &start);
/*! \brief Process SIP SDP and activate RTP channels*/
static int process_sdp(struct sip_pvt *p, struct sip_request *req)
{
- char *m;
- char *c;
- char *a;
+ const char *m;
+ const char *c;
+ const char *a;
char host[258];
char iabuf[INET_ADDRSTRLEN];
int len = -1;
int peercapability, peernoncodeccapability;
int vpeercapability=0, vpeernoncodeccapability=0;
struct sockaddr_in sin;
- char *codecs;
+ const char *codecs;
struct hostent *hp;
struct ast_hostent ahp;
int codec;