[asterisk-users] Simple dial plan inquiry
Hi all, This is a simple concept, however I'm not entirely comfortable with available applications and functions available to me to make this happen. I have a simple dialout macro such as the following: [macro-dialout]; arg1 = callerid number; arg2 = phone numberl exten = s,1,Set(CALLERID(number)=${ARG1}) exten = s,2,GotoIf($[${LEN(${ARG2})} = 10]?3:4) exten = s,3,Set(ARG2=1${ARG2}) exten = s,4,Dial(${TRUNK}/${ARG2},,m) exten = s,5,Congestion()exten = s,105,Busy() This macro overrides one SIP endpoint which I use for personal usage and do not wish to contain our default CID which is passed through arg1. Is there anyway I can combine GotoIf/Goto to set it otherwise? I was thinking in terms of pseudo code to do something similar to the following: if ($arg1 = SIP/MyPersonal) { set caller ID to mypersonal goto s,2 } else { Set(CALLERID(number)=${ARG1}) ; leave as is goto s,2 ; leave as is } Thanks for any insight. - sf ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Simple dial plan inquiry
Hi Steve - [macro-dialout]; arg1 = callerid number; arg2 = phone numberl exten = s,1,Set(CALLERID(number)=${ARG1}) exten = s,2,GotoIf($[${LEN(${ARG2})} = 10]?3:4) exten = s,3,Set(ARG2=1${ARG2}) exten = s,4,Dial(${TRUNK}/${ARG2},,m) exten = s,5,Congestion() exten = s,105,Busy() This macro overrides one SIP endpoint which I use for personal usage and do not wish to contain our default CID which is passed through arg1. Is there anyway I can combine GotoIf/Goto to set it otherwise? I was thinking in terms of pseudo code to do something similar to the following: Looks like it should work. Does it? Dialplan logic is fairly terse. I don't think you'll be able to clean it up much more than that. If you're looking for something that looks prettier, you could always use AEL/AEL2. Of course, in the end AEL code will compile down to Dialplan code. - Noah ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Simple dial plan inquiry
Howdy Noah, I just re-read my original inquiry and noticed my original purpose for mailing the list was not simple to dig out of the message. Ultimately, the dialout macro works fabulous. My issue is that I'd like to be able to override one particular SIP endpoint with its own unique callerID versus what is passed in $ARG1. So any exten that hits the dialout macro will get set to the callerID in $ARG1. My one particular SIP handset, for argument sake, SIP/123 .. should be set to CallerID = 234. Does that clear up what I'm trying to accomplish some? Thanks! - sf Noah Miller wrote: Hi Steve - [macro-dialout]; arg1 = callerid number; arg2 = phone numberl exten = s,1,Set(CALLERID(number)=${ARG1}) exten = s,2,GotoIf($[${LEN(${ARG2})} = 10]?3:4) exten = s,3,Set(ARG2=1${ARG2}) exten = s,4,Dial(${TRUNK}/${ARG2},,m) exten = s,5,Congestion() exten = s,105,Busy() This macro overrides one SIP endpoint which I use for personal usage and do not wish to contain our default CID which is passed through arg1. Is there anyway I can combine GotoIf/Goto to set it otherwise? I was thinking in terms of pseudo code to do something similar to the following: Looks like it should work. Does it? Dialplan logic is fairly terse. I don't think you'll be able to clean it up much more than that. If you're looking for something that looks prettier, you could always use AEL/AEL2. Of course, in the end AEL code will compile down to Dialplan code. - Noah ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users !DSPAM:1020,46364310262288221135878! ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users