David Liu
2004-Feb-02 22:11 UTC
[Asterisk-Users] Voicetronix Audio Problems when making two or more simultanoues calls
Hi there, Besides the problem of Voicetronix dialing too early before the carrier gives a dial tone, there also appears to be issues with the audio quality when more than 1 channel is utilized.
Peter Zion
2004-Feb-03 10:21 UTC
[Asterisk-Users] Voicetronix Audio Problems when making two or more simultanoues calls
Hi David, I've been working with an * setup with a VoiceTronix 4-port FXO card and I had similar problems with detecting dialtone. I had to chan_vpb.c to use a VPB driver call progress dial command, and to change the dialtone dectection (I'm in North America) -- please see patch against version 0.7.1 below. I have not submitted this patch upstream because it's a workaround that works for my application but leaves lots of problems unfixed, and possibly creates other problems, so use at your own risk! I have not yet worked with more than one line with this card so I cannot say whether I have the other problem you mentioned. In general, my experience using this card with Asterisk has been negative. I hope that Digium will be releasing a multi-port FXO card soon. Peter Zion --BEGIN PATCH-- diff -rpuN ../.build_orig/asterisk/channels/chan_vpb.c asterisk/channels/chan_vpb.c --- ../.build_orig/asterisk/channels/chan_vpb.c 2004-01-28 12:36:42.000000000 -0500 +++ asterisk/channels/chan_vpb.c 2004-01-28 12:36:35.000000000 -0500 @@ -280,17 +280,21 @@ static inline int monitor_handle_owned(s break; case VPB_CALLEND: - if (e->data == VPB_CALL_CONNECTED) + if (e->data == VPB_CALL_CONNECTED || + e->data == VPB_CALL_NO_RING_BACK) f.subclass = AST_CONTROL_ANSWER; - else if (e->data == VPB_CALL_NO_DIAL_TONE || - e->data == VPB_CALL_NO_RING_BACK) + else if (e->data == VPB_CALL_NO_DIAL_TONE) f.subclass = AST_CONTROL_CONGESTION; else if (e->data == VPB_CALL_NO_ANSWER || e->data == VPB_CALL_BUSY) f.subclass = AST_CONTROL_BUSY; else if (e->data == VPB_CALL_DISCONNECTED) f.subclass = AST_CONTROL_HANGUP; - break; + + if (f.subclass != AST_CONTROL_ANSWER) + vpb_sethook_sync(p->handle, VPB_ONHOOK); + + break; case VPB_STATION_OFFHOOK: f.subclass = AST_CONTROL_ANSWER; @@ -459,8 +463,12 @@ static void *do_monitor(void *unused) ast_mutex_lock(&monlock), ast_mutex_lock(&iflock); { struct vpb_pvt *p = iflist; /* Find the pvt structure */ + int len; vpb_translate_event(&e, str); + len = strlen(str); + if (len > 0 && str[len-1] == '\n') + str[len-1] = '\0'; if (e.type == VPB_NULL_EVENT) goto done; /* Nothing to do, just a wakeup call.*/ @@ -546,7 +554,8 @@ struct vpb_pvt *mkif(int board, int chan { struct vpb_pvt *tmp; - + VPB_DETECT tone; + tmp = (struct vpb_pvt *)calloc(1, sizeof *tmp); if (!tmp) @@ -560,6 +569,13 @@ struct vpb_pvt *mkif(int board, int chan free(tmp); return NULL; } + + vpb_gettonedet(tmp->handle, VPB_DIAL, &tone); + tone.freq1 = 400; + tone.bandwidth1 = 140; + tone.glitch = 100; + tone.stran[1].tfire = 250; + vpb_settonedet(tmp->handle, &tone); if (echocancel) { if (option_verbose > 4) @@ -712,11 +728,15 @@ static int vpb_call(struct ast_channel * vpb_sethook_sync(p->handle,VPB_OFFHOOK); - res = vpb_dial_async(p->handle, s); + res = vpb_call_async(p->handle, s); if (res != VPB_OK) { ast_log(LOG_DEBUG, "Call on %s to %s failed: %s\n", ast->name, dest, vpb_strerror(res)); + + vpb_sethook_sync(p->handle, VPB_ONHOOK); + ast_setstate(ast, AST_STATE_DOWN); + res = -1; } else res = 0; @@ -733,8 +753,6 @@ static int vpb_call(struct ast_channel * vpb_timer_start(p->timer); } p->calling = 1; - ast_setstate(ast, AST_STATE_RINGING); - ast_queue_control(ast,AST_CONTROL_RINGING, 0); } return res; --END PATCH-- On Tue, 2004-02-03 at 00:11, David Liu wrote:> Hi there, > > Besides the problem of Voicetronix dialing too early before the > carrier gives a dial tone, there also appears to be issues with the > audio quality when more than 1 channel is utilized. > > From an experiment, whenever 1 channel is occupied (i.e. outbound call > in progress) then getting a dial tone on an available channel will > take sometime. What this means is, once you get a dial tone after > pressing 9, the channel is bridged with the SIP phone, then you wait > about 4 to 5 seconds and you will hear a dial tone from the carrier. > The dial tone is very choppy and most of the time we can't even dial > out because the quality is so bad that the DTMF is not sent out at > all. > > It is definitely not the individual line as this scenerio can happen > at any channel. > > Anybody had similiar problems? > > David