This is probably a no-brainer for you guys, however for me, I get confused by the documentation.
I have an Asterisk box, and 2 iax atas connected to cheap drugstore handsets. Their is no external VOIP service at this time. Currently they are able to dial each other and connect just fine.
What I’m wanting to do is ‘trap’ anything dialed from one of the phones to ALWAYS dial the other phone.
Phone A is extension 1000
Phone B is extension 2000
I want phone B to automatically call phone A no matter what numbers are pressed on it’s keypad, or how many are pressed. In other words, as soon as ANY number is pressed, it automatically calls phone A.
But I want phone A to work just as it is now, or in other words, the user actually has to correctly enter a valid extension.
Any advice on this?
Thanks is advance!
Its late here so this may not be too accurate
but give exten B a context of say hotline
then the extensions.conf has
exten => _.,1,Dial(SIP/1000)
or some thing similar
so _. will trap all numbers or what?
The dot character is a wildcard character:
voip-info.org/wiki/index.php … n+Patterns
the devs warn against using ‘_.’ these days, and suggest ‘_X.’ so that the extension doesn’t catch the non-numeric extensions, e.g. s, t, h, o etc
The problem with _X. is that it wont match * # or even A,B,C,D.
and as long as the sets context only has the single entry and no includes it should be fairly safe and catching t and i in this case wouldnt be a bad thing.
true, i had forgotten about the # and *
So this is my iax.conf:
register => 1000:phoneA@192.168.1.1
register => 2000:phoneB@192.168.1.1
And this is my extensions.conf:
exten => 1000,1,Dial(SIP/2000,20)
exten => 2000,1,Dial(SIP/2000,20)
include => from-iax
exten => 1000,1,Dial(IAX2/1000,20)
exten => 2000,1,Dial(IAX2/2000,20)
include => from-sip
This is my sip.conf:
context=from-iax ; Where to start in the dialplan when this phone calls
callerid=phoneA <1> ; Full caller ID, to override the phones config
host=192.168.1.102 ; we have a static but private IP address
;regexten=1000 ; No registration allowed
nat=no ; there is not NAT between phone and Asterisk
canreinvite=no ; allow RTP voice traffic to bypass Asterisk
dtmfmode=inband ; either RFC2833 or INFO for the BudgeTone
regexten=2000 ; When they register, create extension 2
mask=255.255.255.0 ; This device needs to register
nat=no ; X-Lite is behind a NAT router
canreinvite=no ; Typically set to NO if behind NAT
Do I need to make another context or can I just modify the one context in my extensions.conf?
Thanks for the help!
I think you need to think a little ore about your numbering, you seem to have 2 x1000 and 2 x2000, Even though they are in different contexts this will cause problems in the furure. As to the hotdial yes the set would need its own context and use a Goto