Transfer to Voicemail Fails

When I attempt Transfer to Voicemail I don't get any response from the phone. Watching FOP2 server debug I get this error.
Use of uninitialized value in concatenation (.) or string at script/fop2_server.pl line 3919.
Use of uninitialized value in concatenation (.) or string at script/fop2_server.pl line 3926.
127.0.0.1            -> Action: Redirect
127.0.0.1            -> Channel: SIP/flowroute-00000033
127.0.0.1            -> Exten: *965004
127.0.0.1            -> Context:
127.0.0.1            -> Priority: 1
127.0.0.1            -> Async: True

127.0.0.1            <- Response: Error
127.0.0.1            <- Message: Context not specified

Comments

  • How are fop2 buttons configured? Via admin/manager or manually?
  • They were brought in from FreePBX automatically. Only thing I have done to buttons was to add Groups to separate departments in the panel.

    I am running FreePBX Distro with all updates version 5.211.65-15.
    I did change Direct Dial Voice-mail to *96 since it conflicted with other feature codes. (Dialing *52XX would change call waiting for XX and not send to voice-mail for 52XX).
  • There is a missing context in the extenvoicemail definition for the button config. There are two tools that are used to tweak configuration, the fop2admin freepbx module (now deprecated), and the fop2manager that is bundled with FOP 2.28. It seems there is a problem with any of those tools, and I wanted to find out which one is it so I can help you fix it.

    How do you configure fop2 users? From FreePBX, or going to http://your.server/fop2/admin ?

    Best regards,
  • Through fop2manager. Since it was bundled with 2.28 and this is a fresh install of 2.28, I never added the FreePBX module.
  • edited August 2014
    You need to make a little patch to functions-freepbx.php to append @from-internal to the extenvoicemail setting:

    diff -r c6f68c76f108 -r d6cec276c590 fop2manager/admin/functions-freepbx.php
    --- a/fop2manager/admin/functions-freepbx.php	Wed Aug 13 13:17:31 2014 -0300
    +++ b/fop2manager/admin/functions-freepbx.php	Wed Aug 13 13:22:55 2014 -0300
    @@ -186,10 +186,10 @@
         }
     
         if ($conf['EXTENSIONS'] == "deviceanduser") {
    -        $fields="extension,concat('USER/',extension) AS dial, if(voicemail='novm','',concat(extension,'@',voicemail)) AS mailbox,name,IF(voicemail<>'novm',concat('$vmprefix',extension),'') AS extenvoicemail";
    +        $fields="extension,concat('USER/',extension) AS dial, if(voicemail='novm','',concat(extension,'@',voicemail)) AS mailbox,name,IF(voicemail<>'novm',concat('$vmprefix',extension,'\@from-internal'),'') AS extenvoicemail";
         } else {
             $fields  = "extension, name, IF(dial IS null,CONCAT('VIRTUAL/',extension),dial) AS dial, ";
    -        $fields .= "IF(voicemail='novm','',CONCAT(extension,'@',voicemail)) AS mailbox, IF(voicemail<>'novm',concat('$vmprefix',extension),'') AS extenvoicemail ";
    +        $fields .= "IF(voicemail='novm','',CONCAT(extension,'@',voicemail)) AS mailbox, IF(voicemail<>'novm',concat('$vmprefix',extension,'\@from-internal'),'') AS extenvoicemail ";
         }
         $join = "LEFT JOIN $database.devices ON users.extension=devices.id";
     
    


    Consider the original concat('$vmprefix',extension),'') that needs to be replaced with concat('$vmprefix',extension,'\@from-internal'),'')

  • Patched functions-freepbx.php but this does not seem to have an affect. I have reloaded FOP2 service, and done synchronize labels and reload asterisk in FOP2 Manager. I again launched fop2_server with debug and still receive the no context error.

    Is there something I need to do to get this to reload?
  • Sorry, you need to regenerate the fop2buttons table. In order to do so it needs to be truncated first, and then you must browse the fop2 buttons admin page so it gets recreated again.

    To empty the fop2 buttons table run:
    mysql -u root -p asterisk -e "truncate table fop2buttons"
    
  • ah, thank you. I will use database access to update that field for all current buttons that have voicemail then let it create new ones going forward properly. I have assigned groups to buttons and don't want to have to recreate that.
  • Then something like this might work (have not tested it, I am writing it directly here)
    mysql -u root -p asterisk -e "update fop2buttons set mailbox=concat(mailbox,'@from-internal') where type='extension'"
    
  • I use mysql workbench. I updated those that already had something in extenvoicemail with this command it it works now.
    update asterisk.fop2buttons set extenvoicemail = concat('*96',exten,'\@from-internal') where extenvoicemail  <> '';
    
Sign In or Register to comment.