Robert Mann
2003-Dec-30 17:08 UTC
[Asterisk-Users] Re: +AFs-Asterisk-Users+AF0- RE: +AFs-Asterisk-Users+AF0- Multi-line, multi-registration phones
Here is an example of a couple of macros that help me where I have a SOHO with a home phone line and a work phone line. If I pick up line 2 my work line I would prefer the call I make to go out my office phone line same with if I pick up line 1 my home phone line I would prefer it go out my home line but want it to roll if needed. So with this little macro it is possible for that to happen. +AFs-macro-normal-dial+AF0- exten +AD0APg- s,1,ChanIsAvail(+ACQAew-ARG1+AH0-) +ADs- Determine what line is available in order it was sent. exten +AD0APg- s,2,Dial(+ACQAew-AVAILCHAN+AH0-/+ACQAew-MACRO+AF8-EXTEN+AH0-) +ADs- AVAILCHAN gets set from ChanIsAvail and you use MACRO+AF8-EXTEN instead of EXTEN. +AFs-line-1-outbound+AF0- +ADs- Local call here in California +AF8-NXXXXXX exten +AD0APg- +AF8-NXXXXXX,1,macro(normal-dial,Zap/1+ACY-Zap/2) +ADs- Notice for line 1 I put Zap/1 before Zap/2 +AFs-line-2-outbound+AF0- +ADs- Local call here in California +AF8-NXXXXXX exten +AD0APg- +AF8-NXXXXXX,1,macro(normal-dial,Zap/2+ACY-Zap/1) +ADs- Notice for line 2 I put Zap/2 before Zap/1 Now without it looking way to complicated I shortened my macro to make it easy to read here but I have it do a lot more under my setup. So if you add more to your macro then the single line still runs all of the things in the macro. Here is another example of how I use macro's for my extensions. That way I can setup voicemail and anything else I need with a 1 line entry after I have built my macro which will make your extensions.conf file smaller and also allow you to make 1 change instead of many. +AFs-macro-extensions-out+AF0- exten +AD0APg- s,1,Answer +ADs- Answers the call exten +AD0APg- s,2,AGI(MisterHouse.agi,+ACI-DTMF: +ACQAew-MACRO+AF8-EXTEN+AH0AIg-) +ADs- Outbound call logging to MisterHouse home automation software exten +AD0APg- s,3,Dial(+ACQAew-ARG1+AH0-,+ACQAew-ARG2+AH0-) +ADs- Dial for ?? seconds. exten +AD0APg- s,4,Voicemail2(u+ACQAew-ARG3+AH0-) +ADs- If on phone or channel OUTOFORDER go to busy voicemail exten +AD0APg- s,5,Hangup +ADs- Hangup the line after the voicemail. exten +AD0APg- s,104,Voicemail2(b+ACQAew-ARG3+AH0-) +ADs- If not available then go to unavailable voicemail. exten +AD0APg- s,105,Hangup +ADs- Hangup the line after the voicemail. exten +AD0APg- 2000,1,macro(extensions-out,Sip/2000,20,2000) +ADs- Extension with voicemail rings for 20 seconds before going to vm 2000. exten +AD0APg- 2001,1,macro(extensions-out,Sip/2001,180,0000) +ADs- Extension with a answer machine rings for 180 seconds with invalid vm box. etc... So you see you can save a great amount of time with macros and after you get the hang of them they will cut down on your extensions.conf file size and make your life a lot easier. Robert Mann ----- Original Message ----- From: +ACI-Sean Garland+ACI- +ADw-sean+AEA-siskiyoutech.com+AD4- To: +ADw-asterisk-users+AEA-lists.digium.com+AD4- Sent: Tuesday, December 30, 2003 3:00 PM Subject: +AFs-Asterisk-Users+AF0- RE: +AFs-Asterisk-Users+AF0- Multi-line, multi-registration phones Okay, so like this? PHONE1+AD0-SIP/2000 PHONE2+AD0-SIP/3000 PHONE3+AD0-SIP/4000 ALL+AD0AJAB7-PHONE1+AH0AJgAkAHs-PHONE2+AH0AJgAkAHs-PHONE3+AH0- Then you would have Exten +AD0APg- s,1,Dial(+ACQAew-ALL+AH0-,20) Is that right? I have read about the Macros but don't understand their use. Could someone provide an example? Sorry about the newby questions... This will hopefully be my production phone system soon. Thanks Sean Garland sean+AEA-siskiyoutech.com -----Original Message----- From: Steven Critchfield +AFs-mailto:critch+AEA-basesys.com+AF0- Sent: Tuesday, December 30, 2003 1:19 PM To: asterisk-users+AEA-lists.digium.com Subject: Re: +AFs-Asterisk-Users+AF0- Multi-line, multi-registration phones On Tue, 2003-12-30 at 14:29, Sean Garland wrote: +AD4- I have hard phones that are capable of handling three calls at once. +AD4- That is setup (apparently) through multiple registrations. My +AD4- question is has anyone done this and what is the proper way of doing +AD4- it? Do I have to setup (for 2 phones that have three lines) 6 +AD4- sections in my sip.conf and setup 6 extensions to handle the +AD4- registrations? +AD4- +AD4- Also, if I found by searching the web sample code for making both sip +AD4- extensions ring when a call comes in, but what if I had 100 +AD4- extensions? Seems like the string would get pretty long, is there a +AD4- way to put all extensions in a single group and ring the group? +AD4- +AD4- All kinda is the same question. But thanks for the answer anyway... This is where variables come in handy, and also macros. For example, I just put several new variables into my extensions.conf file to deal with the changing nature of our dialplan. I defined a variable for each user that we have, and I created a ALL variable that strings all the users together. You could also make variables for all the users in certain departments, and then your ALL variable could then just include your department variables. The benefit of the variables is just that you can change it in one location and it ripples through all the other definitions. As for the multiple call appearances in SIP, I don't know how to deal with that. -- Steven Critchfield +ADw-critch+AEA-basesys.com+AD4- +AF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXw- Asterisk-Users mailing list Asterisk-Users+AEA-lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users +AF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXw- Asterisk-Users mailing list Asterisk-Users+AEA-lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users