Le 25/01/2018 à 10:37, Atux Atux a écrit :
Being honest, i did not manage to make it work. Now whoever calls the system extensions, does not know if they are on another phone call or away from the office.

For chan_sip you can do like this before ringing an extension. Status is returned in EXTENSTATUS so you can play any announce you want.

Also, il you have 2 calls and the callee doesn't hear a tone about a second call, you should take a look in your device configuration.

ARG1=Extension to call
ARG2=should we as well test the extension with IAX tech

[macro-isExtenAvailable]




exten => s,1,Set(__myEXTEN=${ARG1})

exten => s,n,Set(__IAXaction=${ARG2})

exten => s,n,Set(__CALLTECH=SIP)

exten => s,n(checkStatus),ChanIsAvail(${CALLTECH}/${myEXTEN},s) ;channel to test exten => s,n,NoOp(Status is <Channel=${AVAILCHAN}> <Status=${AVAILSTATUS}>) exten => s,n,Set(__EXTENSTATUS=inuse)

exten => s,n,GotoIf($["${AVAILSTATUS}" = "2"]?End) ;2 and more are in use status exten => s,n,Set(__EXTENSTATUS=busy)

exten => s,n,GotoIf($["${AVAILSTATUS}" = "3"]?End)

exten => s,n,Set(__EXTENSTATUS=invalid)

exten => s,n,GotoIf($["${AVAILSTATUS}" = "4"]?checkIAX)

exten => s,n,Set(__EXTENSTATUS=unavailable)

exten => s,n,GotoIf($["${AVAILSTATUS}" = "5"]?checkIAX)

exten => s,n,Set(__EXTENSTATUS=unavailable)

exten => s,n,GotoIf($["${AVAILSTATUS}" = "20"]?checkIAX)

exten => s,n,Set(__EXTENSTATUS=inuse)

exten => s,n,GotoIf($[${AVAILSTATUS} > 5]?End)

exten => s,n,Set(__EXTENSTATUS=idle)

exten => s,n(End),MacroExit




exten => s,n(checkIAX),GotoIf($["${IAXaction}" = "NOIAX"]?End)

exten => s,n,GotoIf($["${IAXaction}" = "IAXdone"]?End)

exten => s,n,Set(__CALLTECH=IAX2)

exten => s,n,Set(__IAXaction=IAXdone) ;reset ARG2
exten => s,n,Goto(checkStatus)


Daniel


On Tue, Jan 16, 2018 at 12:30 PM, Atux Atux <atuxn...@gmail.com <mailto:atuxn...@gmail.com>> wrote:

    at the moment i have in each extension in sip.conf the call-limit=2.
    Everytime someone calls that extension and that extension is busy,
    there is not any notification:
    - to the extension that there is a second call
    -to the calling party that this extension is on call. So the calling
    can either wait or hang up.


    How can i make that happen, please?

    On Thu, Jan 11, 2018 at 9:58 AM, Atux Atux <atuxn...@gmail.com
    <mailto:atuxn...@gmail.com>> wrote:

        No idea on how to write it in my system.

        On Thu, Jan 11, 2018 at 12:17 AM, John Kiniston
        <johnkinis...@gmail.com <mailto:johnkinis...@gmail.com>> wrote:

            There's some example code in the Dial-Users context of the
            basic-pbx samples that might be of use in implementing it.

            They are checking a DEVICE_STATE to see if a phone is BUSY,
            You could change it to be a database call or implement
            custom device states and check those.

            wrapping your test case in an ExecIF statement that uses the
            DB_EXISTS function to see if the database field you are
            checking is valid so you don't get errors about non existent
            entries.

            
https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Function_DB_EXISTS
            
<https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Function_DB_EXISTS>

            https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Function_DB
            <https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Function_DB>

            On Wed, Jan 10, 2018 at 11:19 AM, Atux Atux
            <atuxn...@gmail.com <mailto:atuxn...@gmail.com>> wrote:

                That is the general idea. But how do i make it work? is
                there somewhere ready?


                On Wed, Jan 10, 2018 at 6:39 PM, John Kiniston
                <johnkinis...@gmail.com <mailto:johnkinis...@gmail.com>>
                wrote:

                    Define your *72 and *73 extensions in your internal
                    context, Have them set a value in the ASTDB that you
                    then check when dialing your handsets.

                    The same can be done for call forwarding, store a
                    number in the ASTDB and check if it's present, if it
                    is forward the call to that number.

                    On Wed, Jan 10, 2018 at 12:18 AM, Atux Atux
                    <atuxn...@gmail.com <mailto:atuxn...@gmail.com>> wrote:

                        Hi. i am running asterisk 11 and i would like to
                        have features access codes in my system such as
                        call waiting(all types) (enable/disable), call
                        forward (enable/disable) and DND. my dialplan is
                        pretty simple and it is the following

                        |[DefaultPlan] exten =>
                        _XXXXXXXXXX,1,Dial(SIP/VoipGate/${EXTEN},120,Tt)
                        exten => _XXXXXXXXXX,1,Busy() exten =>
                        _4XX,2,Answer() exten =>
                        _4XX,3,VoiceMail(${EXTEN}@Office,su) exten =>
                        _4XX,4,HangUp() exten => _4XX,102,Answer() exten
                        => _4XX,103,VoiceMail(${EXTEN}@Office,sb) exten
                        => _4XX,104,HangUp() |

                        i would like to enable/disable call waiting by
                        typing eg. *70/*71
                        DND for the extension *72 enable, *73 to disable.

                        Regarding call waiting, at the moment it is
                        disabled (default value). Now if an extension is
                        busy, a busy message is send back to the caller.
                        I would like have the following behavior:
                        -in the event were the extension is busy, then
                        send a message indication to the extension and
                        the caller to hear from the SIP provider the
                        default early media for call waiting due to
                        busy. Then after some period of time eg 30 secs
                        send busy.
                        -in the event where the extension is busy, send
                        the early media to the caller and waiting
                        indication to the extension. If the extension
                        decides to get the call then get the 2nd call
                        and send the 1st to hear moh.

                        My phones are mainly softphones (zoiper), a few
                        IP phones and 2 SPA3000 for analog devices.

                        could someone help me please with this task, please?


                        --
                        
_____________________________________________________________________
                        -- Bandwidth and Colocation Provided by
                        http://www.api-digital.com --

                        Check out the new Asterisk community forum at:
                        https://community.asterisk.org/
                        <https://community.asterisk.org/>

                        New to Asterisk? Start here:
                        
https://wiki.asterisk.org/wiki/display/AST/Getting+Started
                        
<https://wiki.asterisk.org/wiki/display/AST/Getting+Started>

                        asterisk-users mailing list
                        To UNSUBSCRIBE or update options visit:
                        http://lists.digium.com/mailman/listinfo/asterisk-users
                        
<http://lists.digium.com/mailman/listinfo/asterisk-users>




-- A human being should be able to change a diaper,
                    plan an invasion, butcher a hog, conn a ship, design
                    a building, write a sonnet, balance accounts, build
                    a wall, set a bone, comfort the dying, take orders,
                    give orders, cooperate, act alone, solve equations,
                    analyze a new problem, pitch manure, program a
                    computer, cook a tasty meal, fight efficiently, die
                    gallantly. Specialization is for insects.
                    ---Heinlein

                    --
                    
_____________________________________________________________________
                    -- Bandwidth and Colocation Provided by
                    http://www.api-digital.com --

                    Check out the new Asterisk community forum at:
                    https://community.asterisk.org/
                    <https://community.asterisk.org/>

                    New to Asterisk? Start here:
                    https://wiki.asterisk.org/wiki/display/AST/Getting+Started
                    <https://wiki.asterisk.org/wiki/display/AST/Getting+Started>

                    asterisk-users mailing list
                    To UNSUBSCRIBE or update options visit:
                    http://lists.digium.com/mailman/listinfo/asterisk-users
                    <http://lists.digium.com/mailman/listinfo/asterisk-users>



                --
                
_____________________________________________________________________
                -- Bandwidth and Colocation Provided by
                http://www.api-digital.com --

                Check out the new Asterisk community forum at:
                https://community.asterisk.org/
                <https://community.asterisk.org/>

                New to Asterisk? Start here:
                https://wiki.asterisk.org/wiki/display/AST/Getting+Started
                <https://wiki.asterisk.org/wiki/display/AST/Getting+Started>

                asterisk-users mailing list
                To UNSUBSCRIBE or update options visit:
                http://lists.digium.com/mailman/listinfo/asterisk-users
                <http://lists.digium.com/mailman/listinfo/asterisk-users>




-- A human being should be able to change a diaper, plan an
            invasion, butcher a hog, conn a ship, design a building,
            write a sonnet, balance accounts, build a wall, set a bone,
            comfort the dying, take orders, give orders, cooperate, act
            alone, solve equations, analyze a new problem, pitch manure,
            program a computer, cook a tasty meal, fight efficiently,
            die gallantly. Specialization is for insects.
            ---Heinlein

            --
            
_____________________________________________________________________
            -- Bandwidth and Colocation Provided by
            http://www.api-digital.com --

            Check out the new Asterisk community forum at:
            https://community.asterisk.org/
            <https://community.asterisk.org/>

            New to Asterisk? Start here:
            https://wiki.asterisk.org/wiki/display/AST/Getting+Started
            <https://wiki.asterisk.org/wiki/display/AST/Getting+Started>

            asterisk-users mailing list
            To UNSUBSCRIBE or update options visit:
            http://lists.digium.com/mailman/listinfo/asterisk-users
            <http://lists.digium.com/mailman/listinfo/asterisk-users>







--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
     https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to