Re: [asterisk-users] Running asterisk as non-root

2017-03-21 Thread Dovid Bender
  Jerry,Can you define default install? If you are using a repo which one?Regards,DovidFrom: jerry.g...@gmail.comSent: March 21, 2017 8:54 PMTo: asterisk-users@lists.digium.comReply-to: asterisk-users@lists.digium.comSubject: [asterisk-users] Running asterisk as non-root  I found a page that assisted in running asterisk as non-root.My question is why is the default install not more friendly in this manner???I mean basically the instructions changed the permissions to allow GROUP write, so 775 instead of 755 and changed the astrun to be a directory Why doesn't the default install do this? Seems logical to me. I installed 11.25.1Thanks,Jerry
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Running asterisk as non-root

2017-03-21 Thread Jerry Geis
I found a page that assisted in running asterisk as non-root.

My question is why is the default install not more friendly in this
manner???

I mean basically the instructions changed the permissions to allow GROUP
write, so 775 instead of 755 and changed the astrun to be a directory

Why doesn't the default install do this? Seems logical to me. I installed
11.25.1

Thanks,

Jerry
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] While loop inside recursive calls

2017-03-21 Thread Jonathan H
Well, I've never seen dialplan like that - is this a very old version
of Asterisk, or psuedocode?

Anyway..

A subroutine MUST be balanced, and if a subroutine is aborted before
it reaches return, you'll be in all sorts of hell.

An example:

You make a subroutine of some sound files you want to loop through to
make an IVR menu.

You call it using Gosub. Someone presses two while the third of 5
tracks is playing.

The stack will then be unbalanced and you'll then be in a potential
world of stack overflow and unknown hell.

So keep the gosubs for things where they cannot be interrupted.
Playback is fine. Background and ControlPlayback is not. See?

Here's a solution to this problem which caused me HUGE amounts of
headaches early on (and I mean days and nights on end!)

Hope it helps...
https://github.com/lardconcepts/asterisk-pbx-tips-and-snips/blob/master/gotchas-and-warnings.md

On 21 March 2017 at 17:31, Ethy H. Brito  wrote:
>
> Hi All
>
> What happens if I, inside of a while/endwhile loop, call recursively a
> macro that itself has another while/endwhile loop and calls exitwhile() 
> inside the
> recursive call?
>
> [macro-recursive]
> instance=$ARG1
> if instance>3
> macroexit
> X=1
> _var1=""
> ; recursive loop
> while(Dcondition)
> _var1=value_${X}
> recursive(instance+1)
> if var1==""
> ExitWhile()
> X=X+1
> some_Dcondition_changing
> bla...
> bla...
> EndWhile
> macroexit
>
> [some_running_context]
> ; Main loop
> while(Zcondition)
> recursive(1)
> if (var1=="")
> ExitWhile
> some_Zcondition_changing
> bla...
> bla...
> endwhile
> more_intructions
> MacroExit
>
> The problem I see is if I reentry "macro-recursive" a the second time,
> Macroexit returns to "more_instructions" at "some_running_context" (just after
> the Main Loop endWhile). It should return to 'if (var1=="")' at the previous
> "macro-recursive" call.
>
> It is like the second call to "macro-recursive" overwrites the first
> "macro-recursive" while/endwhile loop return point, and the second ExitWhile
> exits from the while/endwhile at "some_running_context" and not from first
> "macro-recursive" instance.
>
> In short: second (and subsequent??) call to macro-recursive is ExitWhile()ing
> from "some_running_context" while loop. First call exits ok.
>
> Any directions to share?
>
> Is this explanation too complicated to understand?
>
> Regards
>
> Ethy
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] While loop inside recursive calls

2017-03-21 Thread Ethy H. Brito

Hi All

What happens if I, inside of a while/endwhile loop, call recursively a
macro that itself has another while/endwhile loop and calls exitwhile() inside 
the
recursive call?

[macro-recursive]
instance=$ARG1
if instance>3
macroexit
X=1
_var1=""
; recursive loop
while(Dcondition)
_var1=value_${X}
recursive(instance+1)
if var1==""
ExitWhile()
X=X+1
some_Dcondition_changing
bla...
bla...
EndWhile
macroexit

[some_running_context]
; Main loop
while(Zcondition) 
recursive(1)
if (var1=="")
ExitWhile
some_Zcondition_changing
bla...
bla...
endwhile
more_intructions
MacroExit

The problem I see is if I reentry "macro-recursive" a the second time,
Macroexit returns to "more_instructions" at "some_running_context" (just after
the Main Loop endWhile). It should return to 'if (var1=="")' at the previous
"macro-recursive" call.

It is like the second call to "macro-recursive" overwrites the first
"macro-recursive" while/endwhile loop return point, and the second ExitWhile
exits from the while/endwhile at "some_running_context" and not from first
"macro-recursive" instance.

In short: second (and subsequent??) call to macro-recursive is ExitWhile()ing
from "some_running_context" while loop. First call exits ok.

Any directions to share?

Is this explanation too complicated to understand?

Regards

Ethy

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] How to install and configure Dahdi from Debian Stretch repo ?

2017-03-21 Thread Tzafrir Cohen
On Tue, Mar 21, 2017 at 05:18:50PM +0100, Steinwendtner wrote:
> Hello Tzafrir,
> 
> Am 2017-03-21 um 11:23 schrieb Tzafrir Cohen:
> > On Tue, Mar 21, 2017 at 09:36:21AM +0100, Olivier wrote:
> >
> > I'm still having some questions:
> >
> > 1. I can't find any /etc/init.d/dahdi file in my newly built system so
> > "service dahdi status" (or systemctl status dahdi) fails with:
> > Unit dahdi.service could not be found.
> > Shall I worry about this ?
> > No. As I mentioned, that is meaningless.
> So it is no longer possible to make changes on dahdi parameters
> without rebooting the machine ?

There should be no need for a reboot. Long live your system.

> 
> I think in the early days it was possible something like this:
> 
> make a change in /etc/dahdi/system.conf

What kind of change? Technically it would only take running 'dahdi_cfg'
to apply that change. However that may not be enough. Depending on the
specific change.

> asterisk -rx "module unload chan_dahdi.so"
> service dahdi stop
> service dahdi start
> asterisk -rx "module load chan_dahdi.so"

It only got faster. No need to deconfigure anything in Asterisk (This
happens on its own. At least on Asterisk >= 13). No need to unload and
re-load any modules (And why would you? Just to run dahdi_cfg?).

But anyway, if merely running dahdi_cfg is not enough, try:

  dahdi_span_assignment remove
  dahdi_span_assignment add # or: auto

This should also configure DAHDI and register spans with Asterisk
(again: >= 13). If there are still problems with asterisk:

  asterisk -rx "dahdi restart"

-- 
   Tzafrir Cohen
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] How to install and configure Dahdi from Debian Stretch repo ?

2017-03-21 Thread Steinwendtner
Hello Tzafrir,

Am 2017-03-21 um 11:23 schrieb Tzafrir Cohen:
> On Tue, Mar 21, 2017 at 09:36:21AM +0100, Olivier wrote:
>
> I'm still having some questions:
>
> 1. I can't find any /etc/init.d/dahdi file in my newly built system so
> "service dahdi status" (or systemctl status dahdi) fails with:
> Unit dahdi.service could not be found.
> Shall I worry about this ?
> No. As I mentioned, that is meaningless.
So it is no longer possible to make changes on dahdi parameters
without rebooting the machine ?

I think in the early days it was possible something like this:

make a change in /etc/dahdi/system.conf
asterisk -rx "module unload chan_dahdi.so"
service dahdi stop
service dahdi start
asterisk -rx "module load chan_dahdi.so"

Regards

Hans

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] How to install and configure Dahdi from Debian Stretch repo ?

2017-03-21 Thread Tzafrir Cohen
On Tue, Mar 21, 2017 at 09:36:21AM +0100, Olivier wrote:
> Thanks to Tzafrir help, Now I have an Asterisk-Dahdi system installed from
> Stretch repository.
> This system has a Digium HX8 card with BRI modules, Asterisk 13.14.0, Dahdi
> 2.11.1.
> BRI spans appears as up and active but I've not tested them yet:
> CLI> pri show spans
> PRI span 1/0: Up, Active
> PRI span 2/0: Up, Active
> PRI span 3/0: Up, Active
> 
> 
> I'm still having some questions:
> 
> 1. I can't find any /etc/init.d/dahdi file in my newly built system so
> "service dahdi status" (or systemctl status dahdi) fails with:
> Unit dahdi.service could not be found.
> Shall I worry about this ?

No. As I mentioned, that is meaningless.

There are various commands that show the status at various levels:

lsmod | grep ^wctdm24xxp
dahdi_hardware | grep 'wctdm24xxp\+'
dahdi_span_assignments list
lsdahdi
asterisk -rx 'pri show spans'

What exactly do you consider as "status of dahdi"?

> 
> 2. Where can Dahdi 2.11.1 Changelog file be found ?
> In http://downloads.asterisk.org/pub/telephony/ ?

git log #?

The tarball has no changelog and thus it is not packaged. Sorry.

-- 
   Tzafrir Cohen
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Something similar to Doxygen for standard dialplan?

2017-03-21 Thread J Montoya or A J Stiles
On Saturday 18 Mar 2017, Jonathan H wrote:
> Hi, thanks - that looks really good!
> 
> I was about to embark on some non-visual stuff using Ragic, but this
> looks great.
> 
> Is there a binary anywhere, or any instructions to compile? I've never
> compiled C# code before, and although a quick google suggests it
> shouldn't be too hard, I might need to know a few things like what
> version of .net it should be compiled with.

Most distributions ship an out-of-date version of mono, so you may need to 
compile that from Source Code first.

As a general rule, you should never, ever run any binary that was not compiled 
either by yourself or your distro -- and if anyone ever offers you a binary 
without the Source Code, walk as fast as you can in a different direction, 
because it is likely poisioned.

-- 
JM or AJS

Note:  Originating address only accepts e-mail from list!  If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] How to install and configure Dahdi from Debian Stretch repo ?

2017-03-21 Thread Olivier
Thanks to Tzafrir help, Now I have an Asterisk-Dahdi system installed from
Stretch repository.
This system has a Digium HX8 card with BRI modules, Asterisk 13.14.0, Dahdi
2.11.1.
BRI spans appears as up and active but I've not tested them yet:
CLI> pri show spans
PRI span 1/0: Up, Active
PRI span 2/0: Up, Active
PRI span 3/0: Up, Active


I'm still having some questions:

1. I can't find any /etc/init.d/dahdi file in my newly built system so
"service dahdi status" (or systemctl status dahdi) fails with:
Unit dahdi.service could not be found.
Shall I worry about this ?

2. Where can Dahdi 2.11.1 Changelog file be found ?
In http://downloads.asterisk.org/pub/telephony/ ?

Best regards


2017-03-20 16:25 GMT+01:00 Olivier :

>
>
> 2017-03-14 15:26 GMT+01:00 Tzafrir Cohen :
>
>> On Tue, Mar 14, 2017 at 02:58:07PM +0100, Olivier wrote:
>> > 2017-03-14 13:08 GMT+01:00 Tzafrir Cohen :
>> >
>> > > On Tue, Mar 14, 2017 at 11:10:57AM +0100, Olivier wrote:
>> > > > Hello,
>> > > >
>> > > > After all these years installing from source, I'm giving Dahdi
>> package
>> > > > installation a try on a recent Stretch box.
>> > > >
>> > > > Google over the web, I didn't find too many doc on this topic.
>> > > >
>> > > > 1. Is this one [1] up-to-date ?
>> > >
>> > > Not exactly.
>> > >
>> > > > Reading Stretch I would say a single asterisk-dahdi would be enough
>> to
>> > > > install asterisk dahdi and libpri.
>> > >
>> > > Almost. Except the kernel modules. For those:
>> > >
>> > >   apt install dahdi-source
>> > >   # also install module-assistant, if it wasn't installed already
>> > >   m-a a-i dahdi
>> > >   # Should also install linux-headers-`uname -r`, IIRC
>> > >
>> > > >
>> > > > 2. On my box, the following fails. What would you suggest ? Re-base
>> > > > everything on Jessie ?
>> > > > apt-get install linux-headers-`uname -r`
>> > >
>> > > That should not happen. What is the output of uname -r #?
>> > >
>> >
>> > # uname -r
>> > 4.8.0-2-686-pae
>> >
>> > # apt-get install linux-headers-`uname -r`
>> > ...
>> > E: Couldn't find any package by glob 'linux-headers-4.8.0-2-686-pae'
>> >
>> > # apt-cache show linux-headers-4.8
>> > ...
>> > N: Couldn't find any package by glob 'linux-headers-4.8'
>> > ...
>> >
>> > # apt-cache show linux-headers-4.9
>> > Package: linux-headers-4.9.0-2-686
>> > Source: linux
>> > ...
>> >
>> > It looks like linux-headers-4.8 are currently missing in Stretch repo
>> > though currently installed kernel is 4.8.
>> > This issue seems quite independant from asterisk, anyway.
>>
>> You probably started working on this box a while ago. Streetch's current
>> kernel is 4.9.0-2 (it changed shortly before the freeze). It is now
>> frozen and won't change (barring a really good reason).
>>
>> >
>> >
>> > I started all over with a Jessie box.
>>
>> I recommend to go back to Stretch and just upgrade the kernel. In other
>> words: keep the software up-to-date.
>>
>> > Relating to [1], I could positively run:
>> > # m-a a-i dahdi
>> > ...
>> >
>> > But # dahdi_genconf required a reboot to run OK.
>>
>> Certainly not. See below.
>>
>> > Though this worries me as I need to script the whole install process, I
>> can
>> > leave it aside at the moment.
>> >
>> >
>> >
>> > > >
>> > > > 3. How is dahdi started-stopped in Stretch ? (I can't find any
>> > > > /etc/init.d/dahdi file after apt-get install asterisk-dahdi).
>> > >
>> > > Started: should be automatically at boot.
>> >
>> >
>> > Shall I find an /etc/init.d/dahdi file or equivalent ?
>> > If positive which command produces this file ?
>> > I would expect dahdi-linux or dahdi packages to install these file.
>> >
>> >
>> > > Waht hardware device do you
>> > > have?
>> > >
>> >
>> > # dahdi_hardware
>> > pci::04:05.0 wctdm24xxp+  d161:8007 HA8-
>>
>> Traditionally dahdi has been shipped with a modprobe.d configuration
>> file to blacklist all of the PCI cards. This was because the order in
>> which they were loaded was not well-defined.
>>
>> This is irrelevant on a system with a single device. And anyway,
>> irrelevant in a system configured (as is in the Debian packages) with
>> auto_assign_spans=0 . In such a system, devices register automatically,
>> but their spans are not assigned span and channel numbers unless they
>> are configured in /etc/dahdi/assigned-spans.conf .
>>
>> So try:
>>
>>   dahdi_span_assignment auto
>>   dahdi_genconf
>>
>>
>
> This "dahdi_span_assignments auto" stratement was missing in my
> installation script.
>
> This one is now:
>
>
> DAHDI_MODULES="wctdm24xxp"
> apt-get -s install asterisk-dahdi module-assistant
> linux-headers-$(uname -r) dahdi-source
> m-a a-i dahdi
> modprobe ${DAHDI_MODULES}
> dahdi_span_assignments auto
>
> ... edit asterisk and dahdi config files
>
> dahdi_cfg -v
>
> Thank you very much for letting me know about this dahdi_span_assignments
> command.
>
> May I add I've still got no