remove debug
[asterisk/asterisk.git] / channels / h323 / chan_h323.c
index 6e29330..24f9ed9 100755 (executable)
@@ -70,7 +70,6 @@ static char default_context[AST_MAX_EXTENSION];
 static char gatekeeper[100];
 static int     gatekeeper_disable = 1;
 static int     gatekeeper_discover = 0;
-static int  manual = 0;
 static int  usingGk;
 static int     port = 1720;
 static int     jitter;
@@ -383,9 +382,6 @@ static int oh323_call(struct ast_channel *c, char *dest, int timeout)
                ast_log(LOG_WARNING, "Line is already in use (%s)\n", c->name);
                return -1;
        }
-
-       /* set the connect port */
-       p->call_opt.port = port;
        
        /* outgoing call */
        p->outgoing = 1;
@@ -652,6 +648,10 @@ static struct ast_channel *oh323_new(struct oh323_pvt *i, int state, const char
                tmp->priority = 1;
                if (strlen(i->callerid))
                        tmp->callerid = strdup(i->callerid);
+               if (strlen(i->accountcode))
+                       strncpy(tmp->accountcode, i->accountcode, sizeof(tmp->accountcode)-1);
+               if (i->amaflags)
+                       tmp->amaflags = i->amaflags;
                if (state != AST_STATE_DOWN) {
                        if (ast_pbx_start(tmp)) {
                                ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
@@ -749,7 +749,7 @@ static struct ast_channel *oh323_request(char *type, int format, void *data)
                host = tmp;
                ext = NULL;
        }
-       
+
        p = oh323_alloc(0);
 
        if (!p) {
@@ -962,7 +962,7 @@ int setup_incoming_call(call_details_t cd)
                        if (user->host) {
                                if (strcasecmp(cd.sourceIp, inet_ntoa(user->addr.sin_addr))){
                                        ast_log(LOG_ERROR, "Call from user '%s' rejected due to non-matching IP address of '%s'\n", user->name, cd.sourceIp);
-                                       return 0;
+                       return 0;
                                }
                        }
                        if (user->incominglimit > 0) {
@@ -987,8 +987,8 @@ int setup_incoming_call(call_details_t cd)
 
                        if (strlen(user->accountcode)) {
                                strncpy(p->accountcode, user->accountcode, sizeof(p->accountcode)-1);
-                       }
-       
+                       } 
+
                        /* Increment the usage counter */
                        user->inUse++;
                } 
@@ -1245,7 +1245,7 @@ static int h323_gk_cycle(int fd, int argc, char *argv[])
        h323_gk_urq();
        
        /* Possibly register with a GK */
-       if (!gatekeeper_disable) {
+       if (gatekeeper_disable == 0) {
                if (h323_set_gk(gatekeeper_discover, gatekeeper, secret)) {
                        ast_log(LOG_ERROR, "Gatekeeper registration failed.\n");
                        h323_end_process();
@@ -1387,8 +1387,6 @@ int reload_config()
                } else if (!strcasecmp(v->name, "context")) {
                        strncpy(default_context, v->value, sizeof(default_context)-1);
                        printf("  == Setting default context to %s\n", default_context);        
-               } else if (!strcasecmp(v->name, "manual")) {
-                               manual = ast_true(v->value);
                } else if (!strcasecmp(v->name, "dtmfmode")) {
                        if (!strcasecmp(v->value, "inband"))
                                dtmfmode=H323_DTMF_INBAND;
@@ -1534,7 +1532,7 @@ int reload(void)
        reload_config();
 
        /* Possibly register with a GK */
-       if (!gatekeeper_disable) {
+       if (gatekeeper_disable == 0) {
                if (h323_set_gk(gatekeeper_discover, gatekeeper, secret)) {
                        ast_log(LOG_ERROR, "Gatekeeper registration failed.\n");
                        h323_end_process();
@@ -1637,7 +1635,7 @@ int load_module()
                }
 
                /* Possibly register with a GK */
-               if (!gatekeeper_disable) {
+               if (gatekeeper_disable == 0) {
                        if (h323_set_gk(gatekeeper_discover, gatekeeper, secret)) {
                                ast_log(LOG_ERROR, "Gatekeeper registration failed.\n");
                                h323_end_process();