cleanups: duplicate declarations, shadowed global names, extra paramaters, and constifications.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4252 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
258e28dd11
commit
2cf3ad1c6f
|
@ -424,8 +424,6 @@ static void *SWITCH_THREAD_FUNC profile_thread_run(switch_thread_t *thread, void
|
||||||
|
|
||||||
static void launch_profile_thread(sofia_profile_t *profile);
|
static void launch_profile_thread(sofia_profile_t *profile);
|
||||||
|
|
||||||
static switch_status_t config_sofia(int reload);
|
|
||||||
|
|
||||||
static switch_status_t chat_send(char *proto, char *from, char *to, char *subject, char *body, char *hint);
|
static switch_status_t chat_send(char *proto, char *from, char *to, char *subject, char *body, char *hint);
|
||||||
|
|
||||||
/* BODY OF THE MODULE */
|
/* BODY OF THE MODULE */
|
||||||
|
@ -438,14 +436,13 @@ typedef enum {
|
||||||
} auth_res_t;
|
} auth_res_t;
|
||||||
|
|
||||||
|
|
||||||
static char *get_url_from_contact(char *buf, uint8_t dup)
|
static char *get_url_from_contact(char *buf, uint8_t to_dup)
|
||||||
{
|
{
|
||||||
char *url = NULL, *e;
|
char *url = NULL, *e;
|
||||||
|
|
||||||
|
|
||||||
if ((url = strchr(buf, '<')) && (e = strchr(url, '>'))) {
|
if ((url = strchr(buf, '<')) && (e = strchr(url, '>'))) {
|
||||||
url++;
|
url++;
|
||||||
if (dup) {
|
if (to_dup) {
|
||||||
url = strdup(url);
|
url = strdup(url);
|
||||||
e = strchr(url, '>');
|
e = strchr(url, '>');
|
||||||
}
|
}
|
||||||
|
@ -459,8 +456,8 @@ static char *get_url_from_contact(char *buf, uint8_t dup)
|
||||||
|
|
||||||
static auth_res_t parse_auth(sofia_profile_t *profile, sip_authorization_t const *authorization, char *regstr, char *np, size_t nplen)
|
static auth_res_t parse_auth(sofia_profile_t *profile, sip_authorization_t const *authorization, char *regstr, char *np, size_t nplen)
|
||||||
{
|
{
|
||||||
int index;
|
int indexnum;
|
||||||
char *cur;
|
const char *cur;
|
||||||
su_md5_t ctx;
|
su_md5_t ctx;
|
||||||
char uridigest[2 * SU_MD5_DIGEST_SIZE + 1];
|
char uridigest[2 * SU_MD5_DIGEST_SIZE + 1];
|
||||||
char bigdigest[2 * SU_MD5_DIGEST_SIZE + 1];
|
char bigdigest[2 * SU_MD5_DIGEST_SIZE + 1];
|
||||||
|
@ -471,7 +468,7 @@ static auth_res_t parse_auth(sofia_profile_t *profile, sip_authorization_t const
|
||||||
nonce = uri = qop = cnonce = nc = response = NULL;
|
nonce = uri = qop = cnonce = nc = response = NULL;
|
||||||
|
|
||||||
if (authorization->au_params) {
|
if (authorization->au_params) {
|
||||||
for(index = 0; (cur=(char*)authorization->au_params[index]); index++) {
|
for(indexnum = 0; (cur=authorization->au_params[indexnum]); indexnum++) {
|
||||||
char *var, *val, *p, *work;
|
char *var, *val, *p, *work;
|
||||||
var = val = work = NULL;
|
var = val = work = NULL;
|
||||||
if ((work = strdup(cur))) {
|
if ((work = strdup(cur))) {
|
||||||
|
@ -1325,7 +1322,7 @@ static switch_status_t sofia_on_hangup(switch_core_session_t *session)
|
||||||
deactivate_rtp(tech_pvt);
|
deactivate_rtp(tech_pvt);
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s hanging up, cause: %s\n",
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s hanging up, cause: %s\n",
|
||||||
switch_channel_get_name(channel), switch_channel_cause2str(cause), sip_cause);
|
switch_channel_get_name(channel), switch_channel_cause2str(cause));
|
||||||
|
|
||||||
if (tech_pvt->hash_key) {
|
if (tech_pvt->hash_key) {
|
||||||
switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->hash_key);
|
switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->hash_key);
|
||||||
|
@ -4573,7 +4570,7 @@ static void sip_r_challenge(int status,
|
||||||
char const *realm = NULL;
|
char const *realm = NULL;
|
||||||
char *p = NULL, *duprealm = NULL, *qrealm = NULL;
|
char *p = NULL, *duprealm = NULL, *qrealm = NULL;
|
||||||
char const *scheme = NULL;
|
char const *scheme = NULL;
|
||||||
int index;
|
int indexnum;
|
||||||
char *cur;
|
char *cur;
|
||||||
char authentication[256] = "";
|
char authentication[256] = "";
|
||||||
int ss_state;
|
int ss_state;
|
||||||
|
@ -4597,7 +4594,7 @@ static void sip_r_challenge(int status,
|
||||||
}
|
}
|
||||||
scheme = (char const *) authenticate->au_scheme;
|
scheme = (char const *) authenticate->au_scheme;
|
||||||
if (authenticate->au_params) {
|
if (authenticate->au_params) {
|
||||||
for(index = 0; (cur=(char*)authenticate->au_params[index]); index++) {
|
for(indexnum = 0; (cur=(char*)authenticate->au_params[indexnum]); indexnum++) {
|
||||||
if ((realm = strstr(cur, "realm="))) {
|
if ((realm = strstr(cur, "realm="))) {
|
||||||
realm += 6;
|
realm += 6;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue