Ticket #1560: cellphone-corrupt-fix.patch

File cellphone-corrupt-fix.patch, 1.5 KB (added by jhansen@…, 9 years ago)

Fix chan_cellphone corruption.

  • channels/chan_cellphone.c

    diff --git a/channels/chan_cellphone.c b/channels/chan_cellphone.c
    index 148bc5d..efe82d3 100644
    a b ASTERISK_FILE_VERSION(__FILE__, "$Revision: 19 $") 
    6969 
    7070#define CEL_CONFIG "cellphone.conf" 
    7171 
     72#define TYPE "CELL" 
    7273static int prefformat = AST_FORMAT_SLINEAR; 
    73 static char type[] = "CELL"; 
    7474 
    7575static int discovery_interval = 60;     /* The device discovery interval, default 60 seconds. */ 
    7676static int sco_socket;                  /* This is global so it can be closed on module unload outside of the listener thread */ 
    static int sco_connect(char *bdaddr); 
    204204static int sdp_search(char *addr, int profile); 
    205205 
    206206static const struct ast_channel_tech cel_tech = { 
    207         .type = type, 
     207        .type = TYPE, 
    208208        .description = "Bluetooth Cellphone Driver", 
    209209        .capabilities = AST_FORMAT_SLINEAR, 
    210210        .requester = cel_request, 
    static struct ast_channel *cel_new(int state, struct cel_pvt *pvt, char *cid_num 
    750750                pvt->fr.subclass = AST_FORMAT_SLINEAR; 
    751751                pvt->fr.datalen = 48; 
    752752                pvt->fr.samples = 24; 
    753                 pvt->fr.src = type; 
     753                pvt->fr.src = TYPE; 
    754754                pvt->fr.offset = AST_FRIENDLY_OFFSET; 
    755755                pvt->fr.mallocd = 0; 
    756756                pvt->fr.delivery.tv_sec = 0; 
    static int load_module(void) 
    17311731 
    17321732        /* Make sure we can register our channel type */ 
    17331733        if (ast_channel_register(&cel_tech)) { 
    1734                 ast_log(LOG_ERROR, "Unable to register channel class %s\n", type); 
     1734                ast_log(LOG_ERROR, "Unable to register channel class %s\n", TYPE); 
    17351735                return -1; 
    17361736        } 
    17371737