diff options
author | Sean Bright <sean.bright@gmail.com> | 2017-12-22 09:23:22 -0500 |
---|---|---|
committer | Sean Bright <sean.bright@gmail.com> | 2017-12-22 09:23:22 -0500 |
commit | fd0ca1c3f9b972a52d48a82b492fd6bac772dc78 (patch) | |
tree | 42d2a87726d196f4db1c68489007520a4c597062 /channels/chan_vpb.cc | |
parent | 9ef97b5a9191e51f1edc66bb17728fd9fe552c35 (diff) |
Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
Diffstat (limited to 'channels/chan_vpb.cc')
-rw-r--r-- | channels/chan_vpb.cc | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/channels/chan_vpb.cc b/channels/chan_vpb.cc index 6e77dc272..1736cc6b2 100644 --- a/channels/chan_vpb.cc +++ b/channels/chan_vpb.cc @@ -6,7 +6,7 @@ * Copyright (C) 2004 - 2005, Ben Kramer * Ben Kramer <ben@voicetronix.com.au> * - * Daniel Bichara <daniel@bichara.com.br> - Brazilian CallerID detection (c)2004 + * Daniel Bichara <daniel@bichara.com.br> - Brazilian CallerID detection (c)2004 * * Welber Silveira - welberms@magiclink.com.br - (c)2004 * Copying CLID string to propper structure after detection @@ -25,7 +25,7 @@ /*! \file * * \brief VoiceTronix Interface driver - * + * * \ingroup channel_drivers */ @@ -87,8 +87,8 @@ extern "C" { #define DEFAULT_GAIN 0 #define DEFAULT_ECHO_CANCEL 1 - -#define VPB_SAMPLES 160 + +#define VPB_SAMPLES 160 #define VPB_MAX_BUF VPB_SAMPLES*4 + AST_FRIENDLY_OFFSET #define VPB_NULL_EVENT 200 @@ -98,7 +98,7 @@ extern "C" { #define MAX_VPB_GAIN 12.0 #define MIN_VPB_GAIN -12.0 -#define DTMF_CALLERID +#define DTMF_CALLERID #define DTMF_CID_START 'D' #define DTMF_CID_STOP 'C' @@ -136,9 +136,9 @@ static int mthreadactive = -1; /* Flag for monitoring monitorthread.*/ static int restart_monitor(void); -/* The private structures of the VPB channels are +/* The private structures of the VPB channels are linked for selecting outgoing channels */ - + #define MODE_DIALTONE 1 #define MODE_IMMEDIATE 2 #define MODE_FXO 3 @@ -198,7 +198,7 @@ static int dtmf_idd = 3000; #define TIMER_PERIOD_BUSY 700 #define TIMER_PERIOD_RING 4000 static int timer_period_ring = TIMER_PERIOD_RING; - + #define VPB_EVENTS_ALL (VPB_MRING|VPB_MDIGIT|VPB_MDTMF|VPB_MTONEDETECT|VPB_MTIMEREXP \ |VPB_MSTATION_OFFHOOK|VPB_MSTATION_ONHOOK \ |VPB_MRING_OFF|VPB_MDROP|VPB_MSTATION_FLASH) @@ -260,7 +260,7 @@ static int max_bridges = MAX_BRIDGES_V4PCI; AST_MUTEX_DEFINE_STATIC(bridge_lock); typedef enum { - vpb_model_unknown = 0, + vpb_model_unknown = 0, vpb_model_v4pci, vpb_model_v12pci } vpb_model_t; @@ -428,7 +428,7 @@ static struct ast_channel_tech vpb_tech_indicate = { }; #if defined(VPB_NATIVE_BRIDGING) -/* Can't get ast_vpb_bridge() working on v4pci without either a horrible +/* Can't get ast_vpb_bridge() working on v4pci without either a horrible * high pitched feedback noise or bad hiss noise depending on gain settings * Get asterisk to do the bridging */ @@ -469,7 +469,7 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_ /* Bridge channels, check if we can. I believe we always can, so find a slot.*/ ast_mutex_lock(&bridge_lock); - for (i = 0; i < max_bridges; i++) + for (i = 0; i < max_bridges; i++) if (!bridges[i].inuse) break; if (i < max_bridges) { @@ -480,8 +480,8 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_ bridges[i].fo = fo; bridges[i].c0 = c0; bridges[i].c1 = c1; - } - ast_mutex_unlock(&bridge_lock); + } + ast_mutex_unlock(&bridge_lock); if (i == max_bridges) { ast_log(LOG_WARNING, "%s: vpb_bridge: Failed to bridge %s and %s!\n", p0->dev, ast_channel_name(c0), ast_channel_name(c1)); @@ -562,18 +562,18 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_ } f = ast_read(who); if (!f || ((f->frametype == AST_FRAME_DTMF) && - (((who == c0) && (flags & AST_BRIDGE_DTMF_CHANNEL_0)) || + (((who == c0) && (flags & AST_BRIDGE_DTMF_CHANNEL_0)) || ((who == c1) && (flags & AST_BRIDGE_DTMF_CHANNEL_1))))) { *fo = f; *rc = who; ast_debug(1, "%s: vpb_bridge: Got a [%s]\n", p0->dev, f ? "digit" : "hangup"); #if 0 if ((c0->tech_pvt == pvt0) && (!ast_check_hangup(c0))) { - if (pr0->set_rtp_peer(c0, NULL, NULL, 0)) + if (pr0->set_rtp_peer(c0, NULL, NULL, 0)) ast_log(LOG_WARNING, "Channel '%s' failed to revert\n", c0->name); } if ((c1->tech_pvt == pvt1) && (!ast_check_hangup(c1))) { - if (pr1->set_rtp_peer(c1, NULL, NULL, 0)) + if (pr1->set_rtp_peer(c1, NULL, NULL, 0)) ast_log(LOG_WARNING, "Channel '%s' failed to revert back\n", c1->name); } /* That's all we needed */ @@ -586,9 +586,9 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_ break; } } else { - if ((f->frametype == AST_FRAME_DTMF) || - (f->frametype == AST_FRAME_VOICE) || - (f->frametype == AST_FRAME_VIDEO)) + if ((f->frametype == AST_FRAME_DTMF) || + (f->frametype == AST_FRAME_VOICE) || + (f->frametype == AST_FRAME_VIDEO)) { /* Forward voice or DTMF frames if they happen upon us */ /* Actually I dont think we want to forward on any frames! @@ -606,14 +606,14 @@ static enum ast_bridge_result ast_vpb_bridge(struct ast_channel *c0, struct ast_ cs[0] = cs[1]; cs[1] = cs[2]; }; - vpb_bridge(p0->handle, p1->handle, VPB_BRIDGE_OFF); + vpb_bridge(p0->handle, p1->handle, VPB_BRIDGE_OFF); } #endif ast_mutex_lock(&bridge_lock); bridges[i].inuse = 0; - ast_mutex_unlock(&bridge_lock); + ast_mutex_unlock(&bridge_lock); p0->bridge = NULL; p1->bridge = NULL; @@ -644,7 +644,7 @@ static void get_callerid(struct vpb_pvt *p) int rc; struct ast_channel *owner = p->owner; /* - char callerid[AST_MAX_EXTENSION] = ""; + char callerid[AST_MAX_EXTENSION] = ""; */ #ifdef ANALYSE_CID void * ws; @@ -699,7 +699,7 @@ static void get_callerid(struct vpb_pvt *p) ast_free(owner->cid.cid_name); owner->cid.cid_name=NULL; */ - + if (cli_struct->ra_cldn[0] == '\0') { /* owner->cid.cid_num = ast_strdup(cli_struct->cldn); @@ -725,7 +725,7 @@ static void get_callerid(struct vpb_pvt *p) } delete cli_struct; - } else + } else ast_log(LOG_ERROR, "CID record - Failed to set record mode for caller id on %s\n", p->dev); } @@ -767,9 +767,9 @@ static void get_callerid_ast(struct vpb_pvt *p) cs = callerid_new(which_cid); if (cs) { #ifdef ANALYSE_CID - vpb_wave_open_write(&ws, file, VPB_MULAW); - vpb_record_set_gain(p->handle, 3.0); - vpb_record_set_hw_gain(p->handle, 12.0); + vpb_wave_open_write(&ws, file, VPB_MULAW); + vpb_record_set_gain(p->handle, 3.0); + vpb_record_set_hw_gain(p->handle, 12.0); #endif vpb_record_buf_start(p->handle, VPB_MULAW); while ((rc == 0) && (sam_count < 8000 * 3)) { @@ -778,7 +778,7 @@ static void get_callerid_ast(struct vpb_pvt *p) ast_log(LOG_ERROR, "%s: Caller ID couldn't read audio buffer!\n", p->dev); rc = callerid_feed(cs, (unsigned char *)buf, sizeof(buf), ast_format_ulaw); #ifdef ANALYSE_CID - vpb_wave_write(ws, (char *)buf, sizeof(buf)); + vpb_wave_write(ws, (char *)buf, sizeof(buf)); #endif sam_count += sizeof(buf); ast_verb(4, "Collecting Caller ID samples [%d][%d]...\n", sam_count, rc); @@ -886,7 +886,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e) vpb_timer_stop(p->ring_timer); f.frametype = AST_FRAME_NULL; } - + } else { f.frametype = AST_FRAME_NULL; /* Ignore. */ } @@ -938,7 +938,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e) /* Nothing heard on line for a very long time * Timeout connection */ ast_verb(3, "grunt timeout\n"); - ast_log(LOG_NOTICE, "%s: Line hangup due of lack of conversation\n", p->dev); + ast_log(LOG_NOTICE, "%s: Line hangup due of lack of conversation\n", p->dev); f.subclass.integer = AST_CONTROL_HANGUP; } else { p->lastgrunt = ast_tvnow(); @@ -961,7 +961,7 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e) f.subclass.integer = AST_CONTROL_HANGUP; } #else - ast_log(LOG_NOTICE, "%s: Got call progress callback but blind dialing \n", p->dev); + ast_log(LOG_NOTICE, "%s: Got call progress callback but blind dialing \n", p->dev); f.frametype = AST_FRAME_NULL; #endif break; @@ -1023,15 +1023,15 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e) /* ast_verb(4, "%s: LOCKING in handle_owned [%d]\n", p->dev,res); - res = ast_mutex_lock(&p->lock); + res = ast_mutex_lock(&p->lock); ast_verb(4, "%s: LOCKING count[%d] owner[%d] \n", p->dev, p->lock.__m_count,p->lock.__m_owner); */ if (p->bridge) { /* Check what happened, see if we need to report it. */ switch (f.frametype) { case AST_FRAME_DTMF: - if ( !(p->bridge->c0 == p->owner && + if ( !(p->bridge->c0 == p->owner && (p->bridge->flags & AST_BRIDGE_DTMF_CHANNEL_0) ) && - !(p->bridge->c1 == p->owner && + !(p->bridge->c1 == p->owner && (p->bridge->flags & AST_BRIDGE_DTMF_CHANNEL_1) )) { /* Kill bridge, this is interesting. */ endbridge = 1; @@ -1058,8 +1058,8 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e) ast_mutex_lock(&p->bridge->lock); p->bridge->endbridge = 1; ast_cond_signal(&p->bridge->cond); - ast_mutex_unlock(&p->bridge->lock); - } + ast_mutex_unlock(&p->bridge->lock); + } } if (endbridge) { @@ -1170,7 +1170,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e) else if (p->state == VPB_STATE_PLAYBUSY) { playtone(p->handle, &Busytone); p->wantdtmf = 1; - p->ext[0] = 0; + p->ext[0] = 0; } else if (p->state == VPB_STATE_PLAYRING) { playtone(p->handle, &Ringbacktone); p->wantdtmf = 1; @@ -1206,7 +1206,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e) /* No owner any more, Assume caller has hung up */ vpb_timer_stop(p->ring_timer); } - } + } break; case VPB_DTMF: @@ -1259,7 +1259,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e) if (ast_pickup_call(c)) { /* Call pickup wasnt possible */ } - } else + } else #endif if (ast_exists_extension(NULL, p->context, p->ext, 1, p->callerid)) { if (ast_canmatch_extension(NULL, p->context, p->ext, 1, p->callerid)) { @@ -1354,15 +1354,15 @@ static void *do_monitor(void *unused) } } - ast_mutex_unlock(&monlock); + ast_mutex_unlock(&monlock); if (!p) { if (e.type != VPB_NULL_EVENT) { - ast_log(LOG_WARNING, "Got event [%s][%d], no matching iface!\n", str, e.type); + ast_log(LOG_WARNING, "Got event [%s][%d], no matching iface!\n", str, e.type); ast_verb(4, "vpb/ERR: No interface for Event [%d=>%s] \n", e.type, str); } continue; - } + } /* flush the event from the channel event Q */ vpb_get_event_ch_async(e.handle, &je); @@ -1432,7 +1432,7 @@ static int restart_monitor(void) vpb_put_event(&e); } else { /* Start a new monitor */ - int pid = ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL); + int pid = ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL); ast_verb(4, "Created new monitor thread %d\n", pid); if (pid < 0) { ast_log(LOG_ERROR, "Unable to start monitor thread.\n"); @@ -1502,13 +1502,13 @@ static struct vpb_pvt *mkif(int board, int channel, int mode, int gains, float t tmp->handle = vpb_open(board, channel); - if (tmp->handle < 0) { - ast_log(LOG_WARNING, "Unable to create channel vpb/%d-%d: %s\n", + if (tmp->handle < 0) { + ast_log(LOG_WARNING, "Unable to create channel vpb/%d-%d: %s\n", board, channel, strerror(errno)); ast_free(tmp); return NULL; } - + snprintf(tmp->dev, sizeof(tmp->dev), "vpb/%d-%d", board, channel); tmp->mode = mode; @@ -1524,7 +1524,7 @@ static struct vpb_pvt *mkif(int board, int channel, int mode, int gains, float t ast_copy_string(tmp->context, context, sizeof(tmp->context)); tmp->callerid_type = 0; - if (callerid) { + if (callerid) { if (strcasecmp(callerid, "on") == 0) { tmp->callerid_type = 1; ast_copy_string(tmp->callerid, "unknown", sizeof(tmp->callerid)); @@ -1561,7 +1561,7 @@ static struct vpb_pvt *mkif(int board, int channel, int mode, int gains, float t } else { tmp->txgain = txgain; } - + ast_log(LOG_NOTICE, "VPB setting Tx Hw gain to [%f]\n", tmp->txgain); vpb_play_set_hw_gain(tmp->handle, tmp->txgain); } @@ -1607,7 +1607,7 @@ static struct vpb_pvt *mkif(int board, int channel, int mode, int gains, float t /* set default read state */ tmp->read_state = 0; - + tmp->golock = 0; tmp->busy_timer_id = vpb_timer_get_unique_timer_id(); @@ -1618,10 +1618,10 @@ static struct vpb_pvt *mkif(int board, int channel, int mode, int gains, float t tmp->ring_timer_id = vpb_timer_get_unique_timer_id(); vpb_timer_open(&tmp->ring_timer, tmp->handle, tmp->ring_timer_id, timer_period_ring); - + tmp->dtmfidd_timer_id = vpb_timer_get_unique_timer_id(); vpb_timer_open(&tmp->dtmfidd_timer, tmp->handle, tmp->dtmfidd_timer_id, dtmf_idd); - + if (mode == MODE_FXO){ if (use_ast_dtmfdet) vpb_set_event_mask(tmp->handle, VPB_EVENTS_NODTMF); @@ -1689,8 +1689,8 @@ static int vpb_indicate(struct ast_channel *ast, int condition, const void *data if (ast_channel_state(ast) == AST_STATE_UP) { playtone(p->handle, &Busytone); p->state = VPB_STATE_PLAYBUSY; - vpb_timer_stop(p->busy_timer); - vpb_timer_start(p->busy_timer); + vpb_timer_stop(p->busy_timer); + vpb_timer_start(p->busy_timer); } break; case AST_CONTROL_RINGING: @@ -1702,7 +1702,7 @@ static int vpb_indicate(struct ast_channel *ast, int condition, const void *data vpb_timer_stop(p->ringback_timer); vpb_timer_start(p->ringback_timer); } - break; + break; case AST_CONTROL_ANSWER: case -1: /* -1 means stop playing? */ vpb_timer_stop(p->ringback_timer); @@ -1860,7 +1860,7 @@ static int vpb_call(struct ast_channel *ast, const char *dest, int timeout) call.answer_timeout); for (j = 0; !call.tone_map[j].terminate; j++) { ast_verb(2, "%s: Dial parms for %s tone %d->%d\n", p->dev, - ast_channel_name(ast), call.tone_map[j].tone_id, call.tone_map[j].call_id); + ast_channel_name(ast), call.tone_map[j].tone_id, call.tone_map[j].call_id); } ast_verb(4, "%s: Disabling Loop Drop detection\n", p->dev); @@ -1930,7 +1930,7 @@ static int vpb_hangup(struct ast_channel *ast) /* Stop record */ p->stopreads = 1; if (p->readthread) { - pthread_join(p->readthread, NULL); + pthread_join(p->readthread, NULL); ast_verb(4, "%s: stopped record thread \n", ast_channel_name(ast)); } @@ -1959,7 +1959,7 @@ static int vpb_hangup(struct ast_channel *ast) vpb_ring_station_async(p->handle, 0); if (p->state != VPB_STATE_ONHOOK) { /* This is causing a "dial end" "play tone" loop - playtone(p->handle, &Busytone); + playtone(p->handle, &Busytone); p->state = VPB_STATE_PLAYBUSY; ast_verb(5, "%s: Station offhook[%d], playing busy tone\n", ast->name,p->state); @@ -2064,8 +2064,8 @@ static int vpb_answer(struct ast_channel *ast) static struct ast_frame *vpb_read(struct ast_channel *ast) { - struct vpb_pvt *p = (struct vpb_pvt *)ast_channel_tech_pvt(ast); - static struct ast_frame f = { AST_FRAME_NULL }; + struct vpb_pvt *p = (struct vpb_pvt *)ast_channel_tech_pvt(ast); + static struct ast_frame f = { AST_FRAME_NULL }; f.src = "vpb"; ast_log(LOG_NOTICE, "%s: vpb_read: should never be called!\n", p->dev); @@ -2115,7 +2115,7 @@ static inline int astformatbits(struct ast_format *format) } } -int a_gain_vector(float g, short *v, int n) +int a_gain_vector(float g, short *v, int n) { int i; float tmp; @@ -2125,15 +2125,15 @@ int a_gain_vector(float g, short *v, int n) tmp = 32767.0; if (tmp < -32768.0) tmp = -32768.0; - v[i] = (short)tmp; - } + v[i] = (short)tmp; + } return i; } /* Writes a frame of voice data to a VPB channel */ static int vpb_write(struct ast_channel *ast, struct ast_frame *frame) { - struct vpb_pvt *p = (struct vpb_pvt *)ast_channel_tech_pvt(ast); + struct vpb_pvt *p = (struct vpb_pvt *)ast_channel_tech_pvt(ast); int res = 0; AudioCompress fmt = VPB_RAW; struct timeval play_buf_time_start; @@ -2164,20 +2164,20 @@ static int vpb_write(struct ast_channel *ast, struct ast_frame *frame) } tdiff = ast_tvdiff_ms(ast_tvnow(), p->lastplay); - ast_debug(1, "%s: vpb_write: time since last play(%d) \n", p->dev, tdiff); + ast_debug(1, "%s: vpb_write: time since last play(%d) \n", p->dev, tdiff); if (tdiff < (VPB_SAMPLES / 8 - 1)) { - ast_debug(1, "%s: vpb_write: Asked to play too often (%d) (%d)\n", p->dev, tdiff, frame->datalen); + ast_debug(1, "%s: vpb_write: Asked to play too often (%d) (%d)\n", p->dev, tdiff, frame->datalen); /* return 0; */ } p->lastplay = ast_tvnow(); /* - ast_debug(1, "%s: vpb_write: Checked frame format..\n", p->dev); + ast_debug(1, "%s: vpb_write: Checked frame format..\n", p->dev); */ ast_mutex_lock(&p->play_lock); /* - ast_debug(1, "%s: vpb_write: Got play lock..\n", p->dev); + ast_debug(1, "%s: vpb_write: Got play lock..\n", p->dev); */ /* Check if we have set up the play_buf */ @@ -2251,7 +2251,7 @@ static void *do_chanreads(void *pvt) ast_verb(3, "%s: chanreads: starting thread\n", p->dev); ast_mutex_lock(&p->record_lock); - p->stopreads = 0; + p->stopreads = 0; p->read_state = 1; while (!p->stopreads && p->owner) { @@ -2291,7 +2291,7 @@ static void *do_chanreads(void *pvt) } p->last_ignore_dtmf = ignore_dtmf; - /* Play DTMF digits here to avoid problem you get if playing a digit during + /* Play DTMF digits here to avoid problem you get if playing a digit during * a record operation */ ast_verb(6, "%s: chanreads: Checking dtmf's \n", p->dev); @@ -2311,7 +2311,7 @@ static void *do_chanreads(void *pvt) p->play_dtmf[0] = '\0'; ast_mutex_unlock(&p->play_dtmf_lock); vpb_sleep(700); /* Long enough to miss echo and DTMF event */ - if( !ignore_dtmf) + if( !ignore_dtmf) vpb_set_event_mask(p->handle, VPB_EVENTS_ALL); continue; } @@ -2423,13 +2423,13 @@ static void *do_chanreads(void *pvt) ast_mutex_unlock(&p->record_lock); ast_verb(2, "%s: Ending record mode (%d/%s)\n", - p->dev, p->stopreads, p->owner ? "yes" : "no"); + p->dev, p->stopreads, p->owner ? "yes" : "no"); return NULL; } static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state state, const char *context, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor) { - struct ast_channel *tmp; + struct ast_channel *tmp; char cid_num[256]; char cid_name[256]; @@ -2449,7 +2449,7 @@ static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state st ast_channel_callgroup_set(tmp, me->callgroup); ast_channel_pickupgroup_set(tmp, me->pickupgroup); - + /* Linear is the preferred format. Although Voicetronix supports other formats * they are all converted to/from linear in the vpb code. Best for us to use * linear since we can then adjust volume in this modules. @@ -2465,7 +2465,7 @@ static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state st ast_set_callerid(tmp, cid_num, cid_name, cid_num); } ast_channel_tech_pvt_set(tmp, me); - + ast_channel_context_set(tmp, context); if (!ast_strlen_zero(me->ext)) ast_channel_exten_set(tmp, me->ext); @@ -2484,7 +2484,7 @@ static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state st me->readthread = 0; me->play_dtmf[0] = '\0'; me->faxhandled = 0; - + me->lastgrunt = ast_tvnow(); /* Assume at least one grunt tone seen now. */ me->lastplay = ast_tvnow(); /* Assume at least one grunt tone seen now. */ @@ -2503,7 +2503,7 @@ static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state st return tmp; } -static struct ast_channel *vpb_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause) +static struct ast_channel *vpb_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause) { struct vpb_pvt *p; struct ast_channel *tmp = NULL; @@ -2612,7 +2612,7 @@ static int unload_module(void) /* Destroy all the interfaces and free their memory */ while (iflist) { - p = iflist; + p = iflist; ast_mutex_destroy(&p->lock); pthread_cancel(p->readthread); ast_mutex_destroy(&p->owner_lock); @@ -2654,8 +2654,8 @@ static int unload_module(void) * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails - * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the - * configuration file or other non-critical problem return + * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the + * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static enum ast_module_load_result load_module() @@ -2668,14 +2668,14 @@ static enum ast_module_load_result load_module() ast_group_t callgroup = 0; ast_group_t pickupgroup = 0; int mode = MODE_IMMEDIATE; - float txgain = DEFAULT_GAIN, rxgain = DEFAULT_GAIN; - float txswgain = 0, rxswgain = 0; + float txgain = DEFAULT_GAIN, rxgain = DEFAULT_GAIN; + float txswgain = 0, rxswgain = 0; int got_gain=0; int first_channel = 1; int echo_cancel = DEFAULT_ECHO_CANCEL; enum ast_module_load_result error = AST_MODULE_LOAD_SUCCESS; /* Error flag */ int bal1 = -1; /* Special value - means do not set */ - int bal2 = -1; + int bal2 = -1; int bal3 = -1; char * callerid = NULL; int num_cards = 0; @@ -2707,7 +2707,7 @@ static enum ast_module_load_result load_module() if (!cfg || cfg == CONFIG_STATUS_FILEINVALID) { ast_log(LOG_ERROR, "Unable to load config %s\n", config); return AST_MODULE_LOAD_DECLINE; - } + } ast_mutex_lock(&iflock); v = ast_variable_browse(cfg, "general"); @@ -2743,7 +2743,7 @@ static enum ast_module_load_result load_module() } v = v->next; } - + v = ast_variable_browse(cfg, "interfaces"); while (v) { /* Create the interface list */ @@ -2864,7 +2864,7 @@ static enum ast_module_load_result load_module() if (error != AST_MODULE_LOAD_SUCCESS) unload_module(); - else + else restart_monitor(); /* And start the monitor for the first time */ return error; |