[Asterisk-Users] Thousands of contexts?

Kevin Walsh kevin at cursor.biz
Fri Jun 18 11:19:50 MST 2004

Manuel Wenger [manuel.wenger at ticinocom.com] wrote:
> By reading the Wiki's I found out that an Asterisk server with many
> (>10000) extensions and/or SIP users can become slow when reloading. But
> what happens when you also have many contexts in extensions.conf? More
> precisely, one context for each SIP user?  
> I need this because I will have users with random usernames that they can
> choose, but I obviously cannot set that username as the outgoing caller
> ID when passing the call to our PSTN gateway. I need to change the CLI
> before dialling out. Now, every SIP user has his CLI, so I thought of
> creating a context for every user, where I would SetCallerID() before
> issuing the Dial() command. Obviously I would use some sort of script
> reading from a database to re-create the extensions.conf and sip.conf
> after making changes.   
> Do you see any issues which could arise? Is Asterisk going to crash, or
> is it just going to be slow when reloading? 
I don't quite understand your Caller*ID dilemma.

In your sip.conf, you'd have a block for each user, say [abc123].
That's your random username, yes?  The same block would also define
the password and other directives.  Why can't you simply include the
"callerid" directive to set the Caller*ID name and number?

The following should do the trick:

    callerid = "Kevin Walsh" <1234567890>

I don't know whether Asterisk would slow down when reloading thousands
of contexts, but it sounds reasonable to me - I wouldn't expect it to
get any quicker. :-)

   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/

More information about the asterisk-users mailing list