[asterisk-gui] Context names in the new GUI

David Kerr David at Kerr.net
Tue Oct 7 19:50:20 CDT 2008


Brandon,  Agree with you entirely that context should be able to be named
whatever you like, and that VoIP providers should not assume nor require a
specific context name.  Sadly that is not the case, so we have to
accommodate what is implemented/assumed by providers.

The current implementation works fine if you assume that a username at a
VoIP provider equals a DID number... it is extremely unlikely (impossible?)
that you would have the same DID associated with multiple providers.  But
some providers let you pick your own username, and associate DID's (could be
multiple) with that within their own systems... passing the DID number in
the SIP messages when a incoming call arrives, which can be matched in the
inbound context.

I've been experimenting myself inside trunks_voip.html and pbx.js to see if
I can add a user option to the Add SIP/IAX Trunk dialog asking the user
whether context should be assigned by asterisk (getnextavailabletrunk) or
based on the provider name or the user name. Don't have it working yet, but
as I've been looking at it and thinking, perhaps it is best not to mess with
things and just resort to manually editing users.conf and extensions.conf.
 Provided I follow the same conventions used by the GUI (DID_etc for inbound
context names) then I think I can name the context anything I like and the
GUI will show it and let me edit it... the issue is only on ADDING a new
trunk, not on EDITING an existing one (providing I adhere to the naming
conventions in the .conf files).

Thanks for your thoughts.

David



On Mon, Oct 6, 2008 at 5:40 PM, bkruse <bkruse at digium.com> wrote:

>
> It's ok David, I do not point fingers, just saying my plate is very full.
>
> The problem is that, you _should_ be able to set a username for the
> provider.
>
> This has been a problem for a long time (even in the 1.0 version of the
> GUI).
>
> The problem is, simply that (and this may be an Asterisk problem),
> providers should
> be matched on the username = field, and NOT the context. The context should
> be able
> to be whatever. For example if you have the DID 123456 you can have
>
> [trunk_3]
> username = 123456, and it would work on registration of the provider.
>
> Now, the problem with THAT is that:
>
> A) Some providers (like voicepulse IAX) always have the username
> "Asterisk", which can only be configured for 1 (one) line.
>
> B) Asterisk does not seem to always use the username = field (the trunkname
> field is just a GUI field).
>
> I am not sure if changing that line (to use the old style trunknames) would
> fix all the problems.
>
> The context should be able to be named whatever it wants to be named, and
> the username field
> should be what really matters (then you have a static IP address, or
> multiple DID's that you can
> match in the context, no problem).
>
> -bk
>
> David Kerr wrote:
>
>> Brandon,
>>  Sorry it took over a week to respond to the other request to test a
>> patch.
>>
>> In this specific case I don't understand why you just closed 13497 with no
>> fix. It is a real problem... If I have VoIP provider A (let say I use them
>> for domestic calls) and VoIP provider B (which I may use for international
>> calls) and if both are set up with the same username, then it is impossible
>> to configure both these service providers.... you can't have two contexts
>> with the exact same name.  Using "username" for the context name is not the
>> right thing to do. A quick fix is to use "trunkname" as I suggested in
>> 13497. This would return to the behavior of GUI v1.  As for Voicepulse, if
>> it requires the username as the context, then why not just enter the
>> username into the trunkname field as well?
>>
>> David
>>
>>
>>
>> On Mon, Oct 6, 2008 at 4:36 PM, bkruse <bkruse at digium.com <mailto:
>> bkruse at digium.com>> wrote:
>>
>>
>>    David, I appreciate the help in reporting bugs, however, these
>>    things need time.
>>
>>    I have many higher priority issues in house that I am dealing
>>    with, and I am the
>>    only developer currently working on the GUI. I would be happy to
>>    review/accept/commit
>>    a patch, but until then you will just have to be patient.
>>
>>    After all these emails it is still unclear the exact thing that is
>>    happening. I believe I know
>>    what it is, and we do this for voicepulse, where we statically
>>    link a name to it, however, this
>>    is makes it hard to do incremental numbering on providers
>>    (trunk_x), besides, you can use
>>    the username = field to have the channel driver (sip/iax/w/e)
>>    match based on that name instead
>>    of the contextual name you are citing.
>>
>>    Besides, you created another issue that took you over a week to
>>    provide feedback to, this doesn't
>>    help development as far as "time" is concerned. I appreciate all
>>    the help, however, just making you aware.
>>
>>    -Brandon
>>
>>    David Kerr wrote:
>>
>>        I opened bug 13497 for this issue several weeks ago. It is
>>        still sitting in assigned state.  Any estimate on when it
>>        might get fixed?  Its a real problem that the gui forces a
>>        certain inflexible naming convention for context that is
>>        clearly broken when you have multiple VoIP providers.
>>
>>        Thanks
>>        David
>>
>>        On Tue, Sep 16, 2008 at 11:10 PM, David Kerr <David at kerr.net
>>        <mailto:David at kerr.net> <mailto:David at kerr.net
>>        <mailto:David at kerr.net>>> wrote:
>>
>>           Pari,
>>             I changed the pbx.js file as you recommended.  This does not
>>           revert back to the "version 1" GUI behavior as I had hoped,
>>        rather
>>           it behaves as documented in the bug you cited.... "trunk_1"
>>        etc.    This breaks service providers that requre asterisk to
>>        match the
>>           incoming call with the context name.  In the case of the
>>        first bug
>>           report that needed to be the username. In the case of my
>>        service
>>           provider, it needs to be the trunkname ("vitel-inbound" for
>>           vitelity.net <http://vitelity.net> <http://vitelity.net>).
>>
>>
>>           Bottom line, you need to revert to GUI version 1 behavior
>>        (using
>>           the trunkname) or add a new field for the user to enter a
>>        context
>>           name.  Generating one automatically isn't going to work
>>        with some
>>           service providers.
>>
>>           David
>>
>>
>>           On Tue, Sep 16, 2008 at 5:01 PM, David Kerr <David at kerr.net
>>        <mailto:David at kerr.net>
>>           <mailto:David at kerr.net <mailto:David at kerr.net>>> wrote:
>>
>>               I have opened bug 0013497 at the Digium bug tracker web
>>        site
>>               to track this problem.
>>
>>               Thank you.
>>
>>
>>               On Tue, Sep 16, 2008 at 9:09 AM, David Kerr
>>        <David at kerr.net <mailto:David at kerr.net>
>>               <mailto:David at kerr.net <mailto:David at kerr.net>>> wrote:
>>
>>                   For some reason I "replied" only to Pari and not
>>        the list.
>>                   Ooops.
>>
>>
>>                   ---------- Forwarded message ----------
>>                   From: *David Kerr* <David at kerr.net
>>        <mailto:David at kerr.net> <mailto:David at kerr.net
>>        <mailto:David at kerr.net>>>
>>                   Date: Tue, Sep 16, 2008 at 9:08 AM
>>                   Subject: Re: [asterisk-gui] Context names in the
>>        new GUI
>>                   To: Pari Nannapaneni <pari at digium.com
>>        <mailto:pari at digium.com>
>>                   <mailto:pari at digium.com <mailto:pari at digium.com>>>
>>
>>
>>                   Pari,
>>                     Thanks for the quick reply... A classic case of
>>        fixing
>>                   one bug creating another!
>>
>>                   In my opinion the original bug report isn't even a
>>        bug, it
>>                   is the way that Asterisk is supposed to work. If
>>        you need
>>                   the username as the context name for incoming
>>        calls, then
>>                   set the trunkname in the GUI to be the same as the
>>                   username.  I don't believe that the trunkname was
>>        used for
>>                   anything other than the context naming anyway (in the
>>                   extensions.conf file the "trunkname" was set to
>>        "Custom -
>>                   whatever-the-user-entered" anyway so not exactly as
>>                   entered, the only place it appears as entered is for
>>                   Contexts. So the right way to address the problem in
>>                   AA50-2113 is to tell the user to enter exactly the same
>>                   thing (their username) into both the trunkname and
>>                   username fields in the GUI.
>>
>>                   As implemented today, it is broken.... multiple trunks
>>                   from different service providers using the same
>>        username
>>                   cannot be configured.  If we must be able to use
>>        username
>>                   as context names, then it should be an option, not
>>                   hardcoded. But why make it an option? why not just
>>        add a
>>                   field in the GUI for "Context name".... humm, but then
>>                   again, how would that be any different from "Trunk
>>        name" ?
>>
>>                   I can edit the source as you suggest, which will get me
>>                   going again, but I recommend you consider how to
>>        implement
>>                   a permanent fix.
>>
>>                   Thanks again for the super fast reply.
>>                   David.
>>
>>
>>
>>                   On Mon, Sep 15, 2008 at 11:39 PM, Pari Nannapaneni
>>                   <pari at digium.com <mailto:pari at digium.com>
>>        <mailto:pari at digium.com <mailto:pari at digium.com>>> wrote:
>>
>>
>>                       > Can you explain why this change was made?
>>
>>                       Hi David,
>>
>>                       The change in behavior was because of an issue
>>        on our
>>                       internal bug tracker.
>>
>>                          AA50-2113 - Creation of Trunks uses name
>>        that won't
>>                       match on inbound calls
>>
>>                          Description : The convention used to create
>>        a new
>>                       trunk entry in users.conf, i.e. trunk_1, trunk_2,
>>                       trunk_3, etc.,
>>                                        works okay for outbound calls
>>        placed
>>                       via that trunk. However, inbound calls fail. When a
>>                       call is received,
>>                                        Asterisk tries to match the
>>        inbound
>>                       user as "trunk_1" instead of the real username,
>>        i.e.
>>                       bobjones.
>>                                        Please modify the creation of new
>>                       trunks and the expression of those trunks in
>>                       users.conf and extensions.conf
>>                                        so that they are what the user
>>        inputs
>>                       into the "username" field when adding or editing a
>>                       voip trunk.
>>                                        So, if I input mdavenport_soft
>>        as my
>>                       username, then the entry in users.conf would be
>>                       [mdavenport_soft] instead of trunk_1,
>>                                        and everything in the dialplan
>>        that
>>                       would have said trunk_1 should say
>>        "mdavenport_soft"
>>                       instead.
>>
>>                       You can  easily switch to the old style by
>>                       uncommenting a couple of lines in pbx.js,
>>                       look for functions  addIAXTrunk() and addSIPTrunk()
>>                       and change
>>
>>                       --
>>                        //var trunk =
>>                       astgui_managetrunks.misc.nextAvailableTrunk_x();
>>                         var trunk = tr.username ;
>>
>>                       -- TO --
>>
>>                         var trunk =
>>                       astgui_managetrunks.misc.nextAvailableTrunk_x();
>>                         // var trunk = tr.username ;
>>                       --
>>
>>                       May be one day we migh have an option in the gui to
>>                       switch between these modes.
>>
>>                       thanks
>>                       -Pari
>>
>>
>>
>>                       ----- Original Message -----
>>                       From: "David Kerr" <David at Kerr.net>
>>                       To: asterisk-gui at lists.digium.com
>>        <mailto:asterisk-gui at lists.digium.com>
>>                       <mailto:asterisk-gui at lists.digium.com
>>        <mailto:asterisk-gui at lists.digium.com>>
>>                       Sent: Monday, September 15, 2008 9:29:39 PM GMT
>>        -06:00
>>                       US/Canada Central
>>                       Subject: [asterisk-gui] Context names in the
>>        new GUI
>>
>>
>>
>>                       I just started using the new version of the GUI
>>        and am
>>                       trying to migrate settings from a box that had
>>        the old
>>                       GUI. I have found that the new GUI uses the
>>        username
>>                       of a VOIP trunk as the basis for the context
>>        names in
>>                       users.conf and extensions.conf (any maybe elsewhere
>>                       too?). The old GUI used the name of the service
>>                       provider as the basis (or whatever you entered
>>        as the
>>                       name).
>>
>>                       This breaks me... I have multiple VOIP service
>>                       providers with the same username, which
>>        obvously won't
>>                       work. In one case ( vitelity.net
>>        <http://vitelity.net> <http://vitelity.net>
>>
>>
>>                       ) they require two contexts be setup in
>>        asterisk with
>>                       specific naming, one for vitel-inbound, one for
>>                       vitel-outbound... both with the same username, but
>>                       with different host addresses. In the new GUI I
>>        cannot
>>                       set this up. If I manually change the context
>>        names by
>>                       editing users.conf and extensions.conf, then I
>>        can no
>>                       longer edit the trunk in the GUI.
>>
>>                       Can you explain why this change was made?
>>
>>                       Is there anyway I can change it back to using the
>>                       trunk name as the basis for Context naming?
>>
>>                       Thanks
>>                       David
>>
>>                       _______________________________________________
>>                       --Bandwidth and Colocation Provided by
>>                       http://www.api-digital.com--
>>
>>                       asterisk-gui mailing list
>>                       To UNSUBSCRIBE or update options visit:
>>
>> http://lists.digium.com/mailman/listinfo/asterisk-gui
>>
>>
>>
>>
>>
>>
>>
>>  ------------------------------------------------------------------------
>>
>>
>>
>>        _______________________________________________
>>        --Bandwidth and Colocation Provided by
>>        http://www.api-digital.com--
>>
>>        asterisk-gui mailing list
>>        To UNSUBSCRIBE or update options visit:
>>          http://lists.digium.com/mailman/listinfo/asterisk-gui
>>
>>
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-gui/attachments/20081007/40989c73/attachment.htm 


More information about the asterisk-gui mailing list