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