[Freeswitch-users] Help with detecting hangup events.

mszlazak mszlazak at aol.com
Fri Mar 13 16:38:28 PDT 2009



I have a problem in setting up an extension that will detect different
hangup events.

If an outside call comes in and gets sent to "myExtension" then that call is
bridged to an application. When the application hangs up then the hangup
hook "notify.js" is used to originate a call to another phone which notifies
that phone that the application has been used. However, the problem here is
that in the initial call, the caller can't hangup because then notify.js
won't execute.

    <extension name="myExtension">    
        <condition field="destination_number" expression="^2222$">
            <action application="info"/>
            <action application="set" data="bypass_media=true"/>
            <action application="set"
data="effective_caller_id_number=${caller_id_number}"/>
            <action application="set" data="hangup_after_bridge=true"/>
            <action application="set" data="api_hangup_hook=jsrun
notify.js"/>
            <action application="bridge"
data="sofia/internal/${sip_to_user}@127.0.0.1:5068"/>
        </condition>
    </extension>

I haven't tried this but if I changed things so "hang_after_bridge=false"
then I'm guessing that notify.js will execute when the initial caller hangs
up their phone. This I want but I don't want the call originated in
notify.js to happen unless the bridged to application also issued a hangup
previously. Otherwise, if the caller hangs up  before the application does
it's thing and hasn't issued a hangup then notify.js will still originate
calls and these I don't want. 

So, I want notify.js to originate calls after the caller hangs up but these
hangups have to be those that came after the bridged to application issued a
hung up.

I hope this makes sense.

Thanks.

Mark.
-- 
View this message in context: http://www.nabble.com/Help-with-detecting-hangup-events.-tp22507114p22507114.html
Sent from the Freeswitch-users mailing list archive at Nabble.com.





More information about the FreeSWITCH-users mailing list