[asterisk-users] UA - number assignment

Brian Candler B.Candler at pobox.com
Tue Oct 24 05:06:56 MST 2006


On Tue, Oct 24, 2006 at 10:22:33AM +0300, Paul Ianas wrote:
>    My problem is simple and I've issued it about 3 weeks ago. I want the
>    UAs to authenticate with a number to the SIP server. Is this possible?
> 
>    For example, I configured an AT-RG613TX (Allied Telesyn Residential
>    Gateway). In its configuration it is not possible for me to skip
>    specifying a number (ex. 102) along with the username. I've looked
>    into the source code (SIP implementation) of Asterisk and, as I
>    figured out, it is not possible to tell Asterisk the number the user
>    has.
> 
>    The question is: how can I assign a number to a user in Asterisk? One
>    solution would be to define two rules in extensions.conf :
> 
>    exten => 102,1,SetCallerId,${FWDCIDNAME}
> 
>    exten => 102,2,Dial(SIP/pianas)
> 
> 
>    these would tell Asterisk that user pianas has the number 102.
> 
>    Is there any other solution for my problem? (a database for example).

I'm probably misunderstanding the problem. Firstly, you can always use a
number as the SIP username if you like:

---- sip.conf ----
[102]
... parameters for phone "102"

---- extensions.conf ----
exten => 102,1,Dial(SIP/102)

But this is generally frowned upon, because it's harder to manage in the
long term, particularly when people move offices, or you need to change your
numbering plan. Many people recommend using the MAC address of the phone as
its SIP username, as that is unique and stays with the phone forever.

Secondly, when you say "you must specify a number along with the username",
you'll have to check how this maps to actual SIP parameters. There is no
agreed terminology for this, and many ATAs are really confusing in this
regard.

For example, I have a Speedtouch 716g router/ATA, and its VoIP parameters
are displayed as:

         Phone Number      Caller Name     User Name       Password
Line 1   ____________      ______________  ____________    ___________
Line 2   ____________      ______________  ____________    ___________

By experimentation, I determined that by "Phone Number" it means "SIP ID",
the username part of the phone's SIP URI. "Caller Name" is the comment
string, and "User Name" is the authentication username.

So if I configured it as:

Line 1   foo               bar             baz             bap

Then I would get:

  From: "bar" <sip:foo at proxy.com>
  Contact: <sip:foo at 192.168.0.1>

and it would authenticate as username 'baz', password 'bap'.

Most SIP implementations assume the SIP ID and the auth username are the
same, so I have to put the same in columns 1 and 3. (This is true for
Asterisk by default; I expect you can change the auth username for a peer
but I don't know how)

Maybe you're just suffering a similar terminology problem with this ATA.

So, if the SIP channel is defined as [pianas] then I'd try entering 'pianas'
into both the "phone number" and "user name" fields. If there is a "Caller
Name" or "Caller ID" field then you can enter whatever you like there; you
could enter 102, or enter Fred Bloggs. Many SIP phones will display the
value given by the far end when an incoming call arrives.

HTH,

Brian.


More information about the asterisk-users mailing list