[Asterisk-Users] screen safe_asterisk does'nt spawn asterisk
Simone Cittadini
mymailforlists at gmail.com
Sun Dec 18 01:12:11 MST 2005
Tzafrir Cohen ha scritto:
>On Thu, Dec 15, 2005 at 01:45:24PM +0100, Simone Cittadini wrote:
>
>
>>screen -d -m asterisk -vvvcng works well for me, but I'd prefer to run
>>safe_asterisk in production
>>
>>
>
>Any reason you need to run asterisk in a console?
>
>asterisk -r allows you to view the current console.
>
>
First of all, I think my complain about 'screen safe_asterisk' not
working was a nonsense, even if I'd get it work it would detach the
safe_asterisk script and not asterisk's process ....
Anyway, screen seems the only way to see agi's output (old discussion in
the list, and some lines in the wiki), for example :
agy.py :
[...]
def Write(self,data):
"""
Write unbuffered line output to STDERR.
Ensures data is flushed out.
"""
sys.stderr.write(str(data) + "\n")
sys.stderr.flush()
[...]
myhagi.py :
import agy.py
import hgsm.py
agiDo = agi.AGI()
hGsm = hgsm.HGSM()
dst = sys.argv[1]
gatDst = hGsm.getGatewayFromDst(dst)
agiDo.Write("gatDst: "+str(gatDst))
this last line will print on the CLI with 'asterisk -vvvc'
nothing is printed with 'safe_asterisk' -> 'asterisk -r'
so I must 'screen -d -m asterisk -vvvcng' -> 'screen -r'
More information about the asterisk-users
mailing list