Direct incoming sip calls to my extension, but


#1

Hi,

First, I repeat again all my first configuration was done with AMP/asterisk@home.

I’ll try to explain what I want to do. You’ll tell me if it is possible or not please.

With all my incoming calls routed to Digital Receptionist, is it possible, when the call is for EXTEN@MYACCOUNT.homedns.org to forward it directly to EXTEN without having the DR message ?

In other words :
[ul] * call from sipphone trunk => DR (works)

I have no Incoming route defined.
All works fine, except this forward.

I thought that :

[from-pstn-reghours-nofax] exten => s,1,SetVar(intype=${INCOMING}) exten => s,2,Cut(intype=intype,-,1) exten => s,3,GotoIf($[${intype} = EXT]?4:5) ; If INCOMING starts with EXT, then assume its an extension exten => s,4,Goto(ext-local,${INCOMING:4},1) [...]
could do it automaticaly, but it doesn’t.

What is exactly thi “EXT” ?

Where am I wrong ?

Sorry if all is from asterisk@home, but it’s difficult for me to explain differently.
Thanks


#2

No idea or bad explain ?


#3

Probably a bad explanation…

I don’t understand what you’re trying to do with the code. It looks like you are trying to figure out what the type of call it is rather than putting the channel (existing extension) into a separate context. I don’t understand why you are doing this.

If you’ve got a specific channel that you want to send to a specific extension rather than into an IVR, then send it there by putting it into a different context in sip.conf or iax.conf and then handle it by adding a context of the same name in extensions.conf that dials your extension.

For example:

sip.conf

[1234]
context=direct_to_me
type=friend
username=1234
secret=5678
host=dynamic
mailbox=1234
callerid=“John Doe” <1234>

extensions.conf

[direct_to_me]
exten => s,1,Dial(SIP/MyExt)
exten => s,2,Hangup

Really, you can use contexts or groups to do what you want.

On the other hand, I could be completely misunderstanding what you are trying to accomplish.


#4

Or even simpler, just put an entry in extensions.conf:

exten => 1234,Dial(SIP/MyExt)

The former example works better if you want to do this with multiple extensions.


#5

In fact, that’s very difficult for me to explain because of several things :

  • my very bad english
  • my newbie status with asterisk
  • the fact that my configuration was create by asterisk@home, and I’d like not to broke it.

Finaly, after reading, readind, and reading again your answers, I got it working.
I just added :
include => ext-local

at the begining of my [from-pstn] context which is now :

[from-pstn] include => ext-local include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations include => ext-did include => from-pstn-timecheck ; this has to be included otherwise it overrides ext-did exten => fax,1,Goto(ext-fax,in_fax,1)

All seem working fine now.
If I call (from outside, with @mydomain) an existing extension, it rings. And if it doesn’t exist, I have the message from Digital Receptionist.

I hope I haven’t broken anything important.

Thanks for your help.