Asterisk Unable to connect to remote asterisk **Solved**

Hi, i triying to develop a Click to call in php. this is the initial code

<?php $cmd=<

But i got this error message : Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)

when i execute in the command /usr/sbin/asterisk -rx "originate SIP/101 extension 100@extensiones in the linux console work fine.

Looking on the Web, i found that is more than the simple code above, i need to edit the manager.conf and write my code more complex, a long task to perform

If i had to guess, it is because the user that is running apache, which runs your php script, has no access to the asterisk console. Is asterisk running under root?

yes im running asterisk under the root account, how ever i already configured the manafer.conf and now i was able to perform the call through the web

First log in on the remote asterisk server

192.168.15.200:8088/rawman?actio … ecret=1230

second make the phone call

192.168.15.200:8088/rawman?actio … =originate SIP/100 extension 101@extensiones

but i will continue triying to make php script for full control of asterisk

Just change the Asterisk Permision in the asterisk.conf

[files]
;astctlpermissions = 0660
astctlpermissions = 7777
astctlowner = root
astctlgroup = apache
astctl = asterisk.ctl

try with
[color=#40FFFF]sudo [/color]/usr/sbin/asterisk -rx "originate SIP/101 extension 100@extensiones"
good luck :smiley:
if above doesn’t work…
why don’t you try with AMI…

Never follow advice like this unless you are operating “system high” (i.e. everyone with potential access to the whole system is fundamentally trustworthy) or you thoroughly understand the security implications.

In particular, the above attempts to give:

execute to everyone.
set user
set group
sticky status

I’m not sure that execute is meaningful on a pipe, but the fact remains that simply opening up permissions is not something htat should be done lightly.

[quote=“ajayteck”]try with
[color=#40FFFF]sudo [/color]/usr/sbin/asterisk -rx "originate SIP/101 extension 100@extensiones"
good luck :smiley:
if above doesn’t work…
why don’t you try with AMI…[/quote]

I already did it AMI, too and is working smooth,

[quote=“david55”][quote=“ambiorixg12”]
astctlpermissions = 7777
[/quote]

Never follow advice like this unless you are operating “system high” (i.e. everyone with potential access to the whole system is fundamentally trustworthy) or you thoroughly understand the security implications.

In particular, the above attempts to give:

execute to everyone.
set user
set group
sticky status

I’m not sure that execute is meaningful on a pipe, but the fact remains that simply opening up permissions is not something htat should be done lightly.[/quote]

Thanks david, I know that the persmission are not set properly but im working with a test server, not a production server, will change the permission later any sugestion or advise will be aprecitated