1
votes

its a couple of day I'm working on Asterisk, developing some application to call tracking & monitoring and etc ...(Asterisk.Net lib)

i want to tell my extension(phone) on desk to call some number when i press a button in my application.

well I've done some Googling to get to Originate

Action: Originate
ActionID: 1234
Channel: **??***
CallerId: **??**
Context: from-internal
Exten: [targetPhoneNo]
Priority: 1
Async: true
TimeOut: 30000
Variable: logedInUserId:113

well i don't know how this gonna work. OTL

1st : where is my extension information (phone on the desk)

cahnnel : is this source channel or destination channel how can i get channel state if one them was busy or whatever ?(e.g DAHDI/101 is busy )

callerId : is it optional can i put whatever i want there ?

context : do i have to set this or asterisk itself gonna process it

..............[EDIT]................ thx for ur answer ^_^

in my case Asterisk worked this way :

when i want to make Internal call SIP to SIP call

SIP registered user 551 wants to call SIP user 101 :

Action: Originate
ActionID: 1234
Channel: SIP/551
CallerId: 101
Context: from-internal
Exten: 101
Priority: 1
Async: true
TimeOut: 30000

when i want to make outbound call SIP to Mobile No

SIP registered user 551 wants to call Mobile 0999-1234-1234 :

Action: Originate
ActionID: 1234
Channel: DAHDI/g0/099912341234
CallerId: 099912341234
Context: from-internal
Exten: 551
Priority: 1
Async: true
TimeOut: 30000

channel :

DAHDI -> its channel Protocol
g0 -> trunk 
1
Question is too broad. Read some book, for example "Asterisk the future of telephony"arheops

1 Answers

1
votes

If your extension is SIP then you have to register with sip client in your asterisk server.

SIP SHOW PEERS

Will show you which are the current active extensions mapped into your asterisk server

I assume you have your desk phone(PSTN) and number is 9123456. Channel will be

Channel : DAHDI/g0/9123456

Channel is source channel.

CallerId is What you want to show as display number when call is initiated into your phone.

CallerId : 91123454

You will see call is coming from this number.Yes it is optional. In india you can not put anything(Legal issue). If you are using voip service you can put any number, But again there is legal concern of fraud. You have to own that number.

context is where you dial your destination number. You have to write the context in asterisk config file. Suppose

context: your_context

When you receive the call, It will jump to that context

[your_context]
exten => _X.,1,Dial(DAHDI/g0/your_destination_number)

In case of SIP replace DAHDI with SIP.and here g0 is the logical PRI group through which you want to dial the number