hamidlee / fusionpbx

Automatically exported from code.google.com/p/fusionpbx
0 stars 1 forks source link

If extension (user) doesn't have voicemail and call is not answer, call is answered then dropped #920

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an extension with voicemail disabled
2. Register a phone to the extension
3. Call the extension but allow the call to timeout

What is the expected output? What do you see instead?
We expect to see SIP 480 response (no answer), but instead the call answered 
then dropped with SIP BYE response.

What version of the product are you using? On what operating system?
FusionPBX 3.6.0
FreeSWITCH 1.4.15
Ubnuntu 12.04.05 LTS

Please provide any additional information below.

This is a problem with the local_extension dialplan and voicemail application, 
we have resolved the issue with the following changes.

The default dialplan XML file 
'/var/www/fusionpbx/app/dialplan/resources/switch/conf/dialplan/999_local_extens
ion.xml':
##### Remove line 28; don't answer the call yet
<action application="answer"/>
#####

The LUA script '/usr/local/freeswitch/scripts/app/voicemail/index.lua':
##### Remove line 61 to 73; don't answer the call yet
--answer the session
            if (session:ready()) then
                session:answer();
            end

        --unset bind meta app
            session:execute("unbind_meta_app", "");

        --set the callback function
            if (session:ready()) then
                session:setVariable("playback_terminators", "#");
                session:setInputCallback("on_dtmf", "");
            end
#####
##### Add line 146 to 161; answer the call is voicemail_uuid exists
--valid voicemail
                if (voicemail_uuid ~= nil) then
                --answer the session
                    if (session:ready()) then
                        session:answer();
                    end

                --unset bind meta app
                    session:execute("unbind_meta_app", "");

                --set the callback function
                    if (session:ready()) then
                        session:setVariable("playback_terminators", "#");
                        session:setInputCallback("on_dtmf", "");
                    end
                end
#####
##### Update line 347 to 354; if voicemail not enabled hangup with 480 no answer
                --voicemail not enabled or does not exist
                    referred_by = session:getVariable("sip_h_Referred-By");
                    if (referred_by) then
                        referred_by = referred_by:match('[%d]+');
                        session:transfer(referred_by, "XML", context);
                    else
                        session:hangup("NO_ANSWER");
                    end

Original issue reported on code.google.com by shaun.st...@itec-support.co.uk on 16 Apr 2015 at 8:30

Attachments:

GoogleCodeExporter commented 9 years ago
Patch implemented in r8347.  Thanks.

Original comment by sevenate on 29 Apr 2015 at 9:21