code analysis, clean up asserts related to switch_core_session_get_channel.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7402 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2008-01-28 07:26:10 +00:00
1 parent c8dd27cdd1
commit 482badffca
44 files changed
+506 -1661

No files matched your search

@@ -52,13 +52,8 @@ SWITCH_STANDARD_APP(dial_function)
int argc;
char *argv[4] = { 0 };
char *mydata;
switch_channel_t *channel;
switch_channel_t *channel = switch_core_session_get_channel(session);
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
if (data && (mydata = switch_core_session_strdup(session, data))) {
if ((argc = switch_separate_string(mydata, '|', argv, (sizeof(argv) / sizeof(argv[0])))) < 2) {
goto error;
@@ -89,11 +84,7 @@ SWITCH_STANDARD_APP(avoid_function)
{
void *y = NULL;
int x = 0;
switch_channel_t *channel;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
switch_channel_t *channel = switch_core_session_get_channel(session);
for (x = 0; x < 5; x++) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Avoiding initial deadlock on channel %s.\n", switch_channel_get_name(channel));
@@ -109,11 +100,7 @@ SWITCH_STANDARD_APP(goto_function)
int argc;
char *argv[3] = { 0 };
char *mydata;
switch_channel_t *channel;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
if (data && (mydata = switch_core_session_strdup(session, data))) {
if ((argc = switch_separate_string(mydata, '|', argv, (sizeof(argv) / sizeof(argv[0])))) < 1) {
goto error;
@@ -134,7 +121,7 @@ SWITCH_STANDARD_APP(goto_function)
SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
{
switch_caller_extension_t *extension = NULL;
switch_channel_t *channel;
switch_channel_t *channel = switch_core_session_get_channel(session);
char *cf = "extensions.conf";
switch_config_t cfg;
char *var, *val;
@@ -144,9 +131,6 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
cf = arg;
}
channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL);
if (!caller_profile) {
caller_profile = switch_channel_get_caller_profile(channel);
}
@@ -86,16 +86,13 @@ static void load_config(void)
SWITCH_STANDARD_DIALPLAN(directory_dialplan_hunt)
{
switch_caller_extension_t *extension = NULL;
switch_channel_t *channel;
switch_channel_t *channel = switch_core_session_get_channel(session);
char *var, *val;
char filter[256];
switch_directory_handle_t dh;
char app[512];
char *data;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
if (!caller_profile) {
caller_profile = switch_channel_get_caller_profile(channel);
}
@@ -103,7 +100,6 @@ SWITCH_STANDARD_DIALPLAN(directory_dialplan_hunt)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Hello %s You Dialed %s!\n", caller_profile->caller_id_name,
caller_profile->destination_number);
if (!(globals.directory_name && globals.host && globals.dn && globals.base && globals.pass)) {
return NULL;
}
@@ -47,14 +47,11 @@ typedef enum {
static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *caller_profile, switch_xml_t xexten, switch_caller_extension_t **extension)
{
switch_xml_t xcond, xaction;
switch_channel_t *channel;
switch_channel_t *channel = switch_core_session_get_channel(session);
char *exten_name = (char *) switch_xml_attr_soft(xexten, "name");
int proceed = 0;
char *expression_expanded = NULL, *field_expanded = NULL;
channel = switch_core_session_get_channel(session);
for (xcond = switch_xml_child(xexten, "condition"); xcond; xcond = xcond->next) {
char *field = NULL;
char *do_break_a = NULL;
@@ -186,11 +183,10 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *
static switch_status_t dialplan_xml_locate(switch_core_session_t *session, switch_caller_profile_t *caller_profile, switch_xml_t * root,
switch_xml_t * node)
{
switch_channel_t *channel;
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_status_t status = SWITCH_STATUS_GENERR;
switch_event_t *params = NULL;
channel = switch_core_session_get_channel(session);
switch_event_create(&params, SWITCH_EVENT_MESSAGE);
switch_assert(params);
@@ -204,11 +200,9 @@ static switch_status_t dialplan_xml_locate(switch_core_session_t *session, switc
SWITCH_STANDARD_DIALPLAN(dialplan_hunt)
{
switch_caller_extension_t *extension = NULL;
switch_channel_t *channel;
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_xml_t alt_root = NULL, cfg, xml = NULL, xcontext, xexten;
char *alt_path = (char *) arg;
channel = switch_core_session_get_channel(session);
if (!caller_profile) {
if (!(caller_profile = switch_channel_get_caller_profile(channel))) {