I tried using GROUP(), here's a snippet from the first post.
;Took out the Set(GROUP()) because I moved it elsewhere to try and fix
it added all the phones when Asterisk calls agents on a Queue.
[frombandwidth]
;exten = _+1.,1,Set(GROUP()=SIPGROUP)
exten = _+1.,1,NoOp(FromCount=${GROUP_COUNT(SIPGROUP)})
exten = _+1.,n,Set(DID=${EXTEN:2})
exten = _+1.,n,Set(CALLERID(num)=${CALLERID(num):2})
exten = _+1.,n,Goto(DID_trunk_2,${DID},1)
;What we use to dialout. Try SIP trunks first, then Dahdi trunk as backup.
;This is where it breaks. I tried to make it so there can't be more
than 2 calls on SIP channels at once.
;Since it counts the phone as a channel, and adds it to the group, I
had to use 4.
[internalphones]
exten = _1NXXNXXXXXX,1,Set(GROUP()=SIPGROUP)
exten = _1NXXNXXXXXX,n,GotoIf($[${GROUP_COUNT(SIPGROUP)} >= 4]?100)
;If the group has 2 or more calls, do not dial.
exten = _1NXXNXXXXXX,n,NoOp(1NCount = ${GROUP_COUNT(SIPGROUP)})
exten =
_1NXXNXXXXXX,n,Macro(trunkdial-failover-0.3,${trunk_2}/+${EXTEN:0},${trunk_1}/${EXTEN:0},trunk_1,trunk_2)
exten = _1NXXNXXXXXX,100,Playback(all-circuits-busy-now)
exten = _1NXXNXXXXXX,101,congestion()
exten = _1NXXNXXXXXX,102,busy()
;This is where incoming calls go to if I'm awake.
[DID_trunk_2_timeinterval_Awake]
exten = _NXXNXXXXXX,1,Set(GROUP()=SIPGROUP)
exten = _NXXNXXXXXX,n,NoOp(Open Count=${GROUP_COUNT(SIPGROUP)})
exten = _NXXNXXXXXX,n,Set(CALLERID(num)=1${CALLERID(num)})
exten = _NXXNXXXXXX,n,Goto(voicemenu-custom-1|s|1)
I'll try playing around with incoming/outgoing and see if that makes a
difference. I don't know why it counts the phone as a channel, though.
On Mon, Oct 20, 2008 at 12:14 PM, Jeremy Mann <[EMAIL PROTECTED]> wrote:
>
> Tried using GROUP()?
>
>
>
> When a call comes in or goes out:
>
>
>
> Exten => XXX,1,Set(GROUP(bdwi_out_1)=outgoing/incoming);
>
> Exten => XXX,n,GotoIf($[${GROUP_COUNT(outgoing/[EMAIL PROTECTED])}] > 1?fail)
>
> Exten => XXX,n,Dial(…)
>
> Exten => XXX(fail),1,Congestion();
>
> Exten => XXX(fail),n,Hangup();
>
>
>
> Obviously choose outgoing or incoming, if you want to track both you can just
> use $MATH() to add them together.
>
>
>
> Or some other math logic to check the result.
>
>
>
> On incoming Set(DIALSTATUS=CHANUNAVAIL) and it'll ring busy to bandwidth(or
> out of service, you can tweak this).
>
>
>
>
>
>
>
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kurt Knudsen
> Sent: Monday, October 20, 2008 10:46 AM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] Configuring Bandwidth.com SIP trunks to prevent
> one-way audio
>
>
>
> Any updates? It still seems to happen, though not as often as it used to.
> We're using Polycom 320 phones, if that makes a difference, though we did do
> it with X-Lite as well.
>
> On Sat, Oct 11, 2008 at 3:03 PM, Kurt Knudsen <[EMAIL PROTECTED]> wrote:
>
> Thanks, Steve,
>
> That's what I am unsure of. I don't know how to limit 1 call per trunk. If
> that's an easy thing to setup, I'd love to see it.
>
> On Fri, Oct 10, 2008 at 10:20 PM, Steve Totaro <[EMAIL PROTECTED]> wrote:
>
> Oh, I thought you had logic to count the calls on the trunk. You should
> limit each trunk to one call. This is the primary reason besides the email
> that basically said that customer support structure has been changed and
> anything beyond the Demarc would not be supported, I the Demarc is simply
> their boxen, so unless it is on their side, you will not get any helpful
> support from Bandwidth, plus they CCed over 500 people by address instead of
> setting up a group.
> http://www.bandwidth.com/content/support/?page=standardSupport
>
> I am with Junction and while a trunk is not "unlimited" as far as price for
> usage, the amount of trunks is unlimited (or at least as unlimited as it can
> be since nothing is really unlimited). They asked that I try not to go over
> one call per second for any real duration, and that I not hammer one LATA do
> to limited interconnects.
>
> The other thing was Junctions was very easy to sign up with, great support,
> and configuration was a breeze.
>
> As for Bandwidth, I think they are solid but due to recent changes and the
> fact that you must pay per channel, as well as the setup process, I decided
> they were not for me.
>
> I will take a second look at your sip.conf and extensions.conf later to see
> if something jumps out at me. I suspect since you are setting up two
> separate trunks with Bandwidth, you need to limit each trunk to one call,
> rather than two.
>
> Thanks,
> Steve Totaro
>
>
> On Fri, Oct 10, 2008 at 9:47 PM, Kurt Knudsen <[EMAIL PROTECTED]> wrote:
>
> externip messes up DTMF detection, and by messes up I mean it doesn't detect
> it at all. Setting nat=yes or nat=no didn't make a difference either.
>
> When the trunks are in use, the calls are fine, no dropped audio. It only
> happens when a 3rd call is made and there's no trunk available.
>
> Thanks :)
>
>
>
> On Fri, Oct 10, 2008 at 7:09 PM, Steve Totaro <[EMAIL PROTECTED]> wrote:
>
> You need to configure your box for nat settings, externip and other settings
> in sip.conf and set nat=yes instead of nat=no.
>
> One way audio is almost always a NAT issue and those are two glaring things
> that would cause problems.
>
> Thanks,
> Steve Totaro
>
>
>
> On Fri, Oct 10, 2008 at 6:32 PM, Kurt Knudsen <[EMAIL PROTECTED]> wrote:
>
> Hi Steve,
>
> It's behind a NAT/Firewall but SIP translation is enabled and removing it
> from behind the firewall did nothing, it still dropped calls. The calls
> connect and everything works, but it dies when all trunks are in use and
> someone else tries to call out. It seems like even though both channels are
> in use, it tries to connect to the 2nd trunk and thus kills the audio.
> Nothing strange came up in Wireshark or the firewall logs.
>
> Thanks.
>
> On Fri, Oct 10, 2008 at 5:40 PM, Steve Totaro <[EMAIL PROTECTED]> wrote:
>
>
>
> On Fri, Oct 10, 2008 at 5:17 PM, Kurt Knudsen <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
>
>
> We have 2 SIP trunks from Bandwidth.com and if both are in use and someone
> tries to dial out, they cause another call to get one-way audio (the caller
> hears us, we cannot hear them). This happens 100% of the time and
> Bandwidth.com doesn't offer any support. I don't see any setting that tells
> Asterisk that there are 2 channels available from Bandwidth.com's IP. I'm
> currently using, or attempting to use, groups to solve this problem, but
> sometimes it works, sometimes it doesn't. It breaks when a call goes out on a
> Queue, because it seems to add each phone to the group, which breaks my
> GotoIf() statement. Here's some relevant information:
>
>
>
> Users.conf (added by Asterisk-GUI)
>
> [trunk_2]
>
> provider = Bandwidth (SIP) ; GUI metadata
>
> context = DID_trunk_2
>
> hasexten = no
>
> hasiax = no
>
> hassip = yes
>
> host = 216.82.224.202
>
> registeriax = no
>
> registersip = no
>
> usecallerid = yes
>
> nat = no ;Testing
>
> trunkname = Bandwidth.com (Sip) ; GUI metadata
>
> username =
>
> secret =
>
> disallow = all
>
> allow = ulaw,alaw,g726
>
>
>
> sip.conf
>
> [general]
>
> context = frombandwidth
>
> ;other variables, etc.
>
>
>
> ;Added according to Bandwidth.com's wiki entry. Changed to inband because we
> were having DTMF issues.
>
> [bandwidth.com_inbound]
>
> host=216.82.224.202
>
> port=5060
>
> type=peer
>
> disallow=all
>
> allow=ulaw
>
> dtmfmode=inband
>
> canreinvite=no
>
> reinvite=no
>
> context=frombandwidth
>
> nat=no
>
>
>
> [bandwidth.com_outbound]
>
> host=216.82.224.202
>
> port=5060
>
> type=peer
>
> disallow=all
>
> allow=ulaw
>
> dtmfmode=rfc2833
>
> nat=no
>
> fromuser=11234567890
>
>
>
> extensions.conf
>
> [globals]
>
> ;…irrelevant stuff
>
> trunk_1 = Dahdi/g1
>
> trunk_2 = SIP/trunk_2
>
> OUT_2 = SIP/bandwidth.com_outbound
>
>
>
> ;Took out the Set(GROUP()) because I moved it elsewhere to try and fix it
> added all the phones when Asterisk calls agents on a Queue.
>
> [frombandwidth]
>
> ;exten = _+1.,1,Set(GROUP()=SIPGROUP)
>
> exten = _+1.,1,NoOp(FromCount=${GROUP_COUNT(SIPGROUP)})
>
> exten = _+1.,n,Set(DID=${EXTEN:2})
>
> exten = _+1.,n,Set(CALLERID(num)=${CALLERID(num):2})
>
> exten = _+1.,n,Goto(DID_trunk_2,${DID},1)
>
>
>
> ;What we use to dialout. Try SIP trunks first, then Dahdi trunk as backup.
>
> ;This is where it breaks. I tried to make it so there can't be more than 2
> calls on SIP channels at once.
>
> ;Since it counts the phone as a channel, and adds it to the group, I had to
> use 4.
>
> [internalphones]
>
> exten = _1NXXNXXXXXX,1,Set(GROUP()=SIPGROUP)
>
> exten = _1NXXNXXXXXX,n,GotoIf($[${GROUP_COUNT(SIPGROUP)} >= 4]?100) ;If the
> group has 2 or more calls, do not dial.
>
> exten = _1NXXNXXXXXX,n,NoOp(1NCount = ${GROUP_COUNT(SIPGROUP)})
>
> exten =
> _1NXXNXXXXXX,n,Macro(trunkdial-failover-0.3,${trunk_2}/+${EXTEN:0},${trunk_1}/${EXTEN:0},trunk_1,trunk_2)
>
> exten = _1NXXNXXXXXX,100,Playback(all-circuits-busy-now)
>
> exten = _1NXXNXXXXXX,101,congestion()
>
> exten = _1NXXNXXXXXX,102,busy()
>
>
>
> ;This is where incoming calls go to if I'm awake.
>
> [DID_trunk_2_timeinterval_Awake]
>
> exten = _NXXNXXXXXX,1,Set(GROUP()=SIPGROUP)
>
> exten = _NXXNXXXXXX,n,NoOp(Open Count=${GROUP_COUNT(SIPGROUP)})
>
> exten = _NXXNXXXXXX,n,Set(CALLERID(num)=1${CALLERID(num)})
>
> exten = _NXXNXXXXXX,n,Goto(voicemenu-custom-1|s|1)
>
>
>
> Thanks.
>
>
>
> Is your Asterisk box on a public IP or behind a NAT/Firewall?
>
> --
> Thanks,
> Steve Totaro
> +18887771888 (Toll Free)
> +12409381212 (Cell)
> +12024369784 (Skype)
>
>
>
>
>
>
>
>
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
>
>
> ________________________________
> This e-mail, facsimile, or letter and any files or attachments transmitted
> with it contains information that is confidential and privileged. This
> information is intended only for the use of the individual(s) and entity(ies)
> to whom it is addressed. If you are the intended recipient, further
> disclosures are prohibited without proper authorization. If you are not the
> intended recipient, any disclosure, copying, printing, or use of this
> information is strictly prohibited and possibly a violation of federal or
> state law and regulations. If you have received this information in error,
> please notify Texas Health Management Group immediately at 1-817-310-4999.
> Texas Health Management Group, its subsidiaries, and affiliates hereby claim
> all applicable privileges related to this information.
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users