Asterisk originate not working - php

I am trying to make vtiger work with asterisk 1.6 (freepbx server). I have managed to get to the point where I can connect to the asterisk manager interface (AMI) and write to it. But for some weird reason, the originate would not work. I am using -
Action: Originate
Channel: SIP/2000
Exten: 1000
Context: from-internal
Priority: 1
Callerid: 2000
Async: yes
I tried reading the responses from AMI after making a direct call and it always had a random number after the channel. For example -
Event: Dial
Privilege: call,all
SubEvent: Begin
Channel: SIP/1000-0000000c
Destination: SIP/2000-0000000d
CallerIDNum: 1000
CallerIDName: 1000
UniqueID: 1359790601.12
DestUniqueID: 1359790601.13
Dialstring: 2000
Can this be an issue or am I missing anything here? Any pointers would be most helpful. Would be happy to provide any details.

Random number added,becuase can be more then one channel to same extension.
Cordinly to info you provided it do call. No way determine using this info why it "not working" for you, sorry.
Use
asterisk -rvvv
to check what happens on asterisk. Also will be nice read some book like "Aterisk the future of telephony"(or hire consultant able determine what you dooing wrong).

I managed to fix the issue, so here is how the debugging went -
started asterisk CLI using asterisk -rvvv
used a CLI originate command
channel originate SIP/1000 extension 2000#from-internal
step 2 showed an error on the extension being busy (error 486 to be specific).
googled error to find out that the extension 1000 is being used by a hard phone and that can cause issues
changed the manager extension to 2000 in manager.conf and tried making the call using
channel originate SIP/2000 extension 1000#from-internal
step 5 worked, but calls from PHP still failed. added debugging to find that the AMI was returning a permission denied
found out that from 1.6 onwards you need to have originate in the manager.conf read/write options
Now it works perfectly fine. Hope this helps someone, though I think this case might be a very personalized issue.

Related

PHP Bitcoin TestNet using Denpa\Bitcoin "Empty reply from server"

I'm new to BTC development, so sorry if I get any key words wrong!
My Setup:
I'm using: https://github.com/denpamusic/php-bitcoinrpc
In a Laravel Application.
I've downloaded BTC testnet locally.
Developing on my spare PC, A windows 10, using xxamp as my Linux laptop is dead :(
My network facing IP is 192.168.1.184, I've tried 127.0.0.1 and same issue described below.
My bitcoin.conf file
testnet=1
rest=1
txindex=1
disablewallet=1
printtoconsole=1
rpcuser=user
rpcpassword=pass
rpcallowip=192.168.1.184
My Main Controller method:
public function index()
{
$ip = '192.168.1.184';
$bitcoind = new BitcoinClient('http://user:pass#'.$ip.':18333');
$block = $bitcoind->getinfo();
dd($block);
}
When I ping my application via a web link I get this error:
Denpa\Bitcoin\Exceptions\ConnectionException
cURL error 52: Empty reply from server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
And I don't know why. I've used other Api calls from this list: https://en.bitcoinwiki.org/wiki/Original_Bitcoin_client/API_calls_list and get the same result.
Is there any 'better' tutorial or BTC for dummies sites out there?
Eventually I just want to be able to Scan the ledger for incoming payments to my wallet address, then pay various people 'automatically' based on my own settings.
So my questions:
Any thoughts on my Empty reply issue?
Does anyone know if this repo can be used to send payment instructions to a wallet?
Many thanks for reading!
So, I did lots of tweaking, poking and testing.. nothing worked.
I decided to just do a fresh Laravel install and just add a single package, the one listed above.. and it worked instantly.
Urgh, I love tech sometimes...

Kubernetes guestbook-controller failing with permission denied error

I am following the guestbook example for kubernetes on gce:
https://cloud.google.com/container-engine/docs/tutorials/guestbook
I am able to complete up to step 4, exactly as it is described in the tutorial (all outputs match), however when I try to initialize the guestbook web server pods with
create -f $CONFIG_DIR/guestbook-controller.json
I get the following output with when using kubectl get pods
guestbook-controller-2mjqj Pending About a minute php-redis
API error (500): Cannot start container containerID: [8] System error: open /sys/fs/cgroup/memory/containerID/memory.memsw.limit_in_bytes: permission denied
I haven't been able to find anything related to this, any help would be greatly appreciated. Thanks in advance.
This was fixed last week in Kube:
https://github.com/GoogleCloudPlatform/kubernetes/issues/8814

Twitter OAuth failing to work (PHP)

I have the TwitterOAuth class and demonstration running on a local development server and I cannot get it to authorize. I have entered the new CONSUMER_KEY and CONSUMER_SECRET in the config.php. I have also synced the server time to NTP. I get the error message: 'Could not connect to Twitter. Refresh the page or try again later.'
var_dump($connection->http_code);
results:
int 0
ANY help or advise would be appreciated.
I am running PHP 5.3
When I try to ping the api server I can't.
C:\Users\Owner>ping api.twitter.com
Ping request could not find host api.twitter.com. Please check the name and try
again.
could this be the problem ?
I had some issues with this process as well. I don't exactly recall what resolved this error, but I followed This Tutorial (albeit a bit out of date) and made sure I explicitly set the callback URL in the twitter panel for my app. Also, and I believe this one also caused the int 0 return for me, make sure that if you are going with a hosting provider they allow CURL requests.
step 1: https://apps.twitter.com/app or go to your app setting
step 2: Unchecked the (Enable Callback Locking (It is recommended to enable callback locking to ensure apps cannot overwrite the callback url)) This box..
save and exit and check..
ThankYou..!

How to resolve "MgIndexOutOfRangeException" in MGOS 2.2?

I am working on a GIS based application. I am using the following tools:
MapGuide Open Source 2.2
MapGuide Maestro 3.5.0.6071
Oracle 10g
Oracle SQL Developer 3.0.04
PHP 5
In MapGuide Meastro, Whenever I add a new SHP Provider feature resource and preview it in the browser, it gives the following message:
Failed to retrieve message for "MgIndexOutOfRangeException". The value is invalid because it is too large.
However, when I add an Oracle Provider feature resource, and preview it in browser, it works fine.
Googling the error message with the above configuration gives ALMOST 0 useful results. I have posted the same question even the support site, osgeo.org, long ago, but have not received a reply yet.
Does anyone working on these technologies have any idea?
EDIT
At least, I have found the root of the problem. It is in
C:\Program Files\OSGeo\MapGuide\Web\www\schemareport\displayschema.php
on line: 61
$firstClass = substr(strrchr($classCollection->GetItem(0), ":"), 1);
I resolved the issue by downgrading the MapGuide Maestro from 3.5.0.6071 to 2.1.1.5078. The interface is not as user-friendly as the latter version, but it resolved not only the problem in question, but some other problems with database connectivity also.
One more drawback, it has no support for composite geometry shapes.
Thanks

ldap_add error too vague

I am using php-ldap to manage posix accounts on a linux machine. I am able to search the database in php. And I am able to add users via the command line "ldapadd". However, when I try to add a user via PHP ldap_add, I get an "Object class violation" error (errno 65).
I have tried everything I can think of, but the error has not changed. I have even looked to see if there is an alternative to php-ldap, but have not found one.
The problem is when I look up that error in the general LDAP guide, it says "This error is returned with the entry to be added or the entry as modified violates the object class schema rules. Normally additional information is returned the error detailing the violation." And then it lists 8 possible causes.
I need this more in depth error, but cannot find it. ldap_error was also no help. Any ideas how to dig deaper here?
I figured out how to dig deeper. I am using Ubuntu which was dumping logs to /var/log/{debug,syslog}
In order to get more info I had to increase the log level to 424 in /etc/ldap/slapd.d/cn=config.ldif
Then I was able to see the error in the logs which told me what I was doing wrong... using a dc attribute with an inetOrgPerson objectClass.
Thanks.
Object class violation always means the object you created violated the expectations of the schema.
slapd provides a metric ton of logging if you simply set the debug level to some arbitarily high number.
PosixAccount (the class that is needed for Linux users) has some mandatory attributes. You must provide in the same operation the:
uid
uidNumber
gidNumber
homeDirectory
Perhaps in one approach you are, one you are not?
A comment under ldap_error documentation says that to obtain additional info you can call this:
ldap_get_option($conn, LDAP_OPT_DIAGNOSTIC_MESSAGE, $err);
// $err now contains the additional info
We had the same problems, so we used the following bash command:
sudo tail -f syslog |grep slapd
So you will have an real time window to show you the detail reactions on your LDAP manipulations.

Categories