[Freeswitch-dev] How to hangup bridged sessions

Achim Stamm stamm at lyth.de
Fri Oct 1 09:01:50 PDT 2010


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 




More information about the FreeSWITCH-dev mailing list