Hi All,
I will again tell what I am trying to do.
I have around 1000 DID's and I have to setup context for each of it's
extension
and I want to do that dynamically and I do not want to change extensions.conf
all the time manually whenever I want to add new context instead I will do it
in Mysql DB but without mentioning that in extensions.conf asterisk is not
taking it. Asterisk complains that extension is invalid as it is unable
to find
context in Mysql DB. It works only when I give context name and under
it switch
to real time.
Please tell me what can I do for this? I have been searching and trying but
could not get near to that :(
Thanks,
Manoj.
Quoting [EMAIL PROTECTED]:
Hi All,
Thanks for your replies.
I need many contexts because I have around 1000 DID's each with 5-10
Extensions.
These DID numbers are changed or added very frequently and whenever
there is a
change I have to change Extensions.conf manually. So please tell me how can I
do this dynamically without changing Extensions.conf and help me configure
Asterisk.
Thanks once again for your help and time,
Manoj.
Quoting Benchev <[EMAIL PROTECTED]>:
> > > I was able to install Asterisk and Asterisk-addons and use them
> > > successfully. But I have a problem now, I have many contexts and it
> > > looks like Asterisk is unable to find the context given directly in
> > > Mysql DB unless I specify it in Extensions.conf to switch it to
> > > RealTime. If I add a new context in Mysql then I have to add it in
> > > Extensions.conf and reload extensions whenever I need a new context.
> > > Please tell me if there is a way to avoid all this and make Asterisk
> > > take contexts directly from Mysql without mentioning that context in
> > > Extensions.conf. If this is possible then I can make my Asterisk
> > > RealTime actually and modify contexts directly in Mysql.
>
> Idea from the wiki:
> ; If regcontext is specified, Asterisk will dynamically create and
> destroy a ; NoOp priority 1 extension for a given peer who registers or
> unregisters with ; us. The actual extension is the 'regexten' parameter
> of the registering ; peer or its name if 'regexten' is not provided.
> More than one regexten may ; be supplied if they are separated by '&'.
> Patterns may be used in regexten. ;
> ;regcontext=sipregistrations
> That means that you should creat a "mother" context in extensions.conf:
> [sipregistrations]
>
> But first I would try to add a field "regcontext" along with
> "regexten"(which already there) in sip_users table since for the trick to
> work ... read http://www.voip-info.org/wiki-Asterisk+sip+regcontext
>
OK, that will enable the auto generation of a context but as the new
context won't have a switch statement it doesn't help with this
problem... I may try writing a "default switch if no matching context
found" type patch.
Well, it wont generate a context, it would rather "register" the
extension of
the new user under [sipregistrations]
And, maybe now is the time to warn that regexten was created to facilitate
a sip-user extensions' "propagation" within an * network; there is a
discussion "Clustering" going on the list, see for details.
As for the switch, since "context is optional:
(switch => Realtime/@realtime_ext) and if left off, RealTime will use the
current context, in this case "sipregistrations"."
Means:
[sipregistrations]
switch => Realtime/@realtime_ext ;realtime_ext or whatever the table name is
Ok i'am guessing "sans voir" here since I don't understand why so many
contexts are needed?
Hope it helps,
Benchev
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users