Dialplan architecture question

Hi,

I am just learning how the dial plans work and are built up. I understand that
exten => 123,1,application()

if the caller dialed extension 123 then application() is run. Can I just replace 123 with one of my four inbound numbers and asterisk will automatically carry out the application associated with it? Such as:

exten => _6135227xxxx,n,System(registerCall(1,$CALLERID(num)))
exten => _6135227xxxx,n,System(registerCall(2,$CALLERID(num)))
exten => _6135227xxxx,n,System(registerCall(3,$CALLERID(num)))
exten => _6135227xxxx,n,System(registerCall(4,$CALLERID(num)))

where I define registerCall() and its parameters. (613 is my country and region codes)

Thanks,

Keith

I guess my real question is how do I know/identify which phone number a client has called?

I want to use asterisk to help me register votes made by people calling particular telephone numbers.

If the call comes from a voip (SIP, IAX, H323) trunk or from a digital trunk (ISDN PRI or BRI) you know the called number so the call will go to the extension “equal” to the called number, this extension has to be in the context of the voip peer or the isdn board; if the call comes from an analog line you need a separate analog line for each number, you then define a different context for each zap channell, in each of this contexts you then use the extension “s” (because you don’t have the called number).

Hope this helps.

Cheers.

Marco Bruni

Hey mbruni Thanks for that.

If the call comes from a voip (SIP, IAX, H323) trunk or from a digital trunk
(ISDN PRI or BRI) you know the called number so the call will go to the
extension “equal” to the called number, this extension has to be in the
context of the voip peer or the isdn board;

Yes all of my calls will be connected from a SIP proxy so I know all the phone numbers that will be called. So to be pedantic… the code I wrote above then should work if I put all the fullphone number in place of the x’s ? By “equal” you mean the:
exten =>_

I need to look up what the voip peer is…

Keith