map SIP (name@domain) to extension

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

map SIP (name@domain) to extension

Postby nicklv » Sat Sep 10, 2005 8:19 am

Hi,

I can't seem to find this.... suppose I need to map sip address e.g., sip:username@domain to an extension, is this possible? Any pointers on how this can be done?

Thanks!
nicklv
Newsterisk
 
Posts: 17
Joined: Mon Aug 29, 2005 10:12 am

Postby WillKemp » Sat Sep 10, 2005 3:41 pm

You'll have to explain more about what you're trying to do than that!

You don't map SIP user names to extensions exactly. How to do what you want to do depends on whether you're talking about incoming calls or outgoing calls - or what...

Have a read through documentation at http://www.voip-info.org/tiki-index.php?page=Asterisk
WillKemp
Astmaster
 
Posts: 608
Joined: Thu Dec 21, 2006 10:56 pm

Postby nicklv » Sun Sep 11, 2005 10:17 pm

Sorry if it wasnt clear.

I was referring to incoming calls to asterisk. That is, suppose if someone calls user@mydomain and the call gets to my asterisk server. If this user@mydomain is a legitimate user in my network, how would asterisk route the call to the user in my network.

Thanks
nicklv
Newsterisk
 
Posts: 17
Joined: Mon Aug 29, 2005 10:12 am

Postby WillKemp » Mon Sep 12, 2005 2:25 am

nicklv wrote:I was referring to incoming calls to asterisk. That is, suppose if someone calls user@mydomain and the call gets to my asterisk server. If this user@mydomain is a legitimate user in my network, how would asterisk route the call to the user in my network.

In sip.conf there should be the following statement

context=default ; Default context for incoming calls

when a sip call comes in that's not from a service that asterisk has registered with (as defined in sip.conf), asterisk will pass the call to the extension specified by the caller in (in the above case) the [default] context in extensions.conf .

In the [default] context extensions.conf, you would have to have defined an extension called "user" (in your example), which would map to a real phone somewhere. For example:

exten => user,1,Dial(SIP/somephone,20,r)
exten => user,2,Voicemail(uuser)
exten => user,3,Hangup

or something like that. If, say, "user" already had an extension number 4426 defined in extensions.conf, you could do something like:

exten => user,1,Goto(4426,1)

which more or less has the effect of making "user" an alias for extension 4426.
WillKemp
Astmaster
 
Posts: 608
Joined: Thu Dec 21, 2006 10:56 pm

Postby nicklv » Mon Sep 12, 2005 3:00 am

Thanks WillKemp.

1 more clarification before I go try this out.....

The incoming SIP call will be a fully qualified address e.g., john@domain.tld.

in the extensions.conf, should I specify the fully qualified address or just the user name only. e.g.,


exten => john,1,Dial(SIP/1234,20,r)

or

exten => john@domain.tld, 1,Dial(SIP/1234,20,r)
nicklv
Newsterisk
 
Posts: 17
Joined: Mon Aug 29, 2005 10:12 am

Postby WillKemp » Mon Sep 12, 2005 3:23 am

nicklv wrote:The incoming SIP call will be a fully qualified address e.g., john@domain.tld.

Yes, the domain part must be mapped to the IP address of the asterisk server in the DNS.

in the extensions.conf, should I specify the fully qualified address or just the user name only. e.g.,

exten => john,1,Dial(SIP/1234,20,r)

or

exten => john@domain.tld, 1,Dial(SIP/1234,20,r)

Just the name only. The domain part of the address is completely irrelevant once the connection has arrived at the host.

Of course, one day it may not be so irrelevant - when the protocol has developed to allow virtual hosts to be catered for, like http did.
WillKemp
Astmaster
 
Posts: 608
Joined: Thu Dec 21, 2006 10:56 pm


Return to Asterisk Support

Who is online

Users browsing this forum: No registered users and 1 guest