changed long to int (64 bit system's compatibilty)
[lcr.git] / chan_lcr.c
index 5c68e47..ab9c76a 100644 (file)
@@ -169,7 +169,7 @@ void chan_lcr_log(int type, const char *file, int line, const char *function, st
        va_end(args);
 
        if (call)
-               sprintf(call_text, "%ld", call->ref);
+               sprintf(call_text, "%d", call->ref);
        if (ast)
                strncpy(ast_text, ast->name, sizeof(ast_text)-1);
        ast_text[sizeof(ast_text)-1] = '\0';
@@ -184,7 +184,7 @@ void chan_lcr_log(int type, const char *file, int line, const char *function, st
  */
 struct chan_call *call_first;
 
-struct chan_call *find_call_ref(unsigned long ref)
+struct chan_call *find_call_ref(unsigned int ref)
 {
        struct chan_call *call = call_first;
 
@@ -211,7 +211,7 @@ struct chan_call *find_call_ast(struct ast_channel *ast)
        return(call);
 }
 
-struct chan_call *find_call_handle(unsigned long handle)
+struct chan_call *find_call_handle(unsigned int handle)
 {
        struct chan_call *call = call_first;
 
@@ -305,7 +305,7 @@ unsigned short new_bridge_id(void)
 /*
  * enque message to LCR
  */
-int send_message(int message_type, unsigned long ref, union parameter *param)
+int send_message(int message_type, unsigned int ref, union parameter *param)
 {
        struct admin_list *admin, **adminp;
 
@@ -1023,7 +1023,7 @@ static void lcr_in_facility(struct chan_call *call, int message_type, union para
 }
 
 /*
- * got dtmf from bchannel
+ * got dtmf from bchannel (locked state)
  */
 void lcr_in_dtmf(struct chan_call *call, int val)
 {
@@ -1035,7 +1035,7 @@ void lcr_in_dtmf(struct chan_call *call, int val)
        if (!call->pbx_started)
                return;
 
-       CDEBUG(call, call->ast, "Frowarding DTMF digit '%c' to Asterisk.\n", val);
+       CDEBUG(call, call->ast, "Forwarding DTMF digit '%c' to Asterisk.\n", val);
 
        /* send digit to asterisk */
        memset(&fr, 0, sizeof(fr));
@@ -1048,7 +1048,7 @@ void lcr_in_dtmf(struct chan_call *call, int val)
 /*
  * message received from LCR
  */
-int receive_message(int message_type, unsigned long ref, union parameter *param)
+int receive_message(int message_type, unsigned int ref, union parameter *param)
 {
        struct bchannel *bchannel;
        struct chan_call *call;
@@ -1400,7 +1400,7 @@ int open_socket(void)
        char *socket_name = SOCKET_NAME;
        int conn;
        struct sockaddr_un sock_address;
-       unsigned long on = 1;
+       unsigned int on = 1;
        union parameter param;
 
        /* open socket */
@@ -1610,13 +1610,6 @@ struct ast_channel *lcr_request(const char *type, int format, void *data, int *c
        strncpy(call->dialstring, dial, sizeof(call->dialstring)-1);
        apply_opt(call, (char *)opt);
 
-       /* if hdlc is forced by option, we change transcap to data */
-       if (call->hdlc
-        && ast->transfercapability != INFO_BC_DATAUNRESTRICTED
-        && ast->transfercapability != INFO_BC_DATARESTRICTED
-        && ast->transfercapability != INFO_BC_VIDEO)
-               ast->transfercapability = INFO_BC_DATAUNRESTRICTED;
-
        ast_mutex_unlock(&chan_lock);
        return ast;
 }
@@ -1651,7 +1644,13 @@ static int lcr_call(struct ast_channel *ast, char *dest, int timeout)
         || ast->transfercapability == INFO_BC_DATARESTRICTED
         || ast->transfercapability == INFO_BC_VIDEO)
                call->hdlc = 1;
-               
+       /* if hdlc is forced by option, we change transcap to data */
+       if (call->hdlc
+        && ast->transfercapability != INFO_BC_DATAUNRESTRICTED
+        && ast->transfercapability != INFO_BC_DATARESTRICTED
+        && ast->transfercapability != INFO_BC_VIDEO)
+               ast->transfercapability = INFO_BC_DATAUNRESTRICTED;
+
        ast_mutex_unlock(&chan_lock);
        return 0; 
 }