[Freeswitch-dev] How to hangup bridged sessions

Bernhard Suttner bernhard.suttner at winet.ch
Fri Oct 1 09:19:12 PDT 2010


Hi,

Did you try to hangup the session (not the peer session). This should freeswitch force to hangup all related channels (the session + the connected sessions).

BR,
Bernhard

-----Ursprüngliche Nachricht-----
Von: freeswitch-dev-bounces at lists.freeswitch.org [mailto:freeswitch-dev-bounces at lists.freeswitch.org] Im Auftrag von Achim Stamm
Gesendet: Freitag, 1. Oktober 2010 18:02
An: freeswitch-dev at lists.freeswitch.org
Betreff: [Freeswitch-dev] How to hangup bridged sessions

How to hangup bridged sessions

Hello,

i have following problem:

I used following code for brdiging my current session to multiple Voip 
Phones
in a freeswitch thread (same as bgapi):

switch_ivr_originate(session, &peer_session, &cause, 
"user/60 at 192.168.1.50,user/61 at 192.168.1.50", timelimit, NULL, NULL, 
NULL, NULL, NULL, SOF_NONE,NULL) != SWITCH_STATUS_SUCCESS)

Both Phones with number 60 and 61 rings.

In a special case I need to force hangup both Phones (stop ringing).
I use following code for hangup bridged sessions:

char * my_uuid = switch_core_session_get_uuid(session);
char other_uuid[255];
switch_ivr_find_bridged_uuid(my_uuid, other_uuid,255 );
sessionNebenstelle = switch_core_session_locate(other_uuid);
if (sessionNebenstelle)
{
    channelNebenstelle = 
switch_core_session_get_channel(sessionNebenstelle);
    switch_channel_hangup(channelNebenstelle,SWITCH_CAUSE_NO_ANSWER);
    if (switch_core_session_private_event_count(sessionNebenstelle)) {
        switch_ivr_parse_all_events(sessionNebenstelle);
    }
}

This Code works only for one phone, so Phone 61 stops ringing, but Phone 
60 continue ringing.

It is possible, that i can hangup the other phone ?

Is there a better solution for cancel switch_ivr_originate (hangup all 
originating sessions ?)

Greetings

Achim Stamm

-- 
Achim Stamm, Dipl.-Inform. (FH)


Lyncker & Theis GmbH
Wilhelmstr. 16
65185 Wiesbaden
Germany

Fon +49 611/9006951
Fax +49 611/9406125


Handelsregister: HRB 23156 Amtsgericht Wiesbaden
Steuernummer: 04323897052
USt-IdNr.: DE255806399

Geschäftsführer:
Filip Lyncker,
Armin Theis 


_______________________________________________
FreeSWITCH-dev mailing list
FreeSWITCH-dev at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
http://www.freeswitch.org




More information about the FreeSWITCH-dev mailing list