[Freeswitch-users] No reINVITE when bridging two sessions from JavaScript with bypass_media_after_bridge=true

Timur Valishev tim at novion.ru
Wed Feb 10 00:35:06 PST 2010


Dear Mike,

I'm trying to build a kind of complicated callback. I will be happy if
you suggest alternative way to do it!

Scenario is:

0. Get command over the socket to initiate connection, get A-number,
B-number, route preference, Caller ID option (incognito/normal)
1. Call billing stored procedure to determine maximum call duration
2. Reply over the socket (or better through database?) that connection
is in progrees (to display it on the user GUI)
3. Initiate connection to A-number
4. Upon connection to A, say welcome, start calling B, play ringback tone
5. Upon dialling B, call billing stored procedure to report that
session state changed and report the status to user GUI (over the
socket or through the database?)
5.1 If there was error during connection - speak the reason to end
user (e.g. "Number busy" or "Timeout expired" etc.)
6. Join peers in bypass media mode
6.1 Wait for various commands over the socket - e.g. transfer the
call, put on hold, join to conference etc. User will have GUI for that
operations.
7. If B hangs up, call billing stored procedure to finalize session
and calculate the cost of the call. Cost is to be calculated only by
B-leg length. Speak to A the cost of the call, say thanks and hang up.
7.1 If A hangs up, just call billing and terminate.

Best regards,
Timur Valishev

2010/2/10 Michael Jerris <mike at jerris.com>:
> controlling multiple calls in a script like this is tricky, you need to use
> the first session to create the second one.  Why are you not just doing an
> originate to do all of this not even in a js file?  What exactly are you
> trying to accomplish
> Mike
> On Feb 5, 2010, at 3:02 PM, Timur Valishev wrote:
>
> I think we are on the right way) still does not work, but there is hope)
> First of all, this script does not produce any reinvite either (even if
> replace bypass_media to bypass_media_after_bridge, or set bypass_media only
> on one channel):
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> session = new
> Session("{bypass_media=true,ignore_early_media=true,hangup_after_bridge=true}user/1001");
> session2 = new
> Session("{bypass_media=true,ignore_early_media=true} user/1001");
> bridge(session, session2);
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> BUT! if I run the following script:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> session = new
> Session("{bypass_media=true,ignore_early_media=true,hangup_after_bridge=true} user/1001");
> session2 = new
> Session("{bypass_media=true,ignore_early_media=true}user/1001");
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> And then manually type in the console
> uuid_media off <uuid of my session>
> - then I get the reINVITE!
> BUT! When I try to write it to the script:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> session = new
> Session("{bypass_media=true,ignore_early_media=true,hangup_after_bridge=true}sofia/external/timwork at novion.ru");
> session2 = new
> Session("{bypass_media=true,ignore_early_media=true}sofia/external/timwork at novion.ru");
> bridge(session, session2);
> apiExecute('uuid_media off '+session.uuid); // <-- this line is not
> executed, because bridge hangs up untill BYE
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> the last line is not executed, because bridge hangs up untill BYE
> Then I've tried to do like this:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> session = new
> Session("{bypass_media=true,ignore_early_media=true,hangup_after_bridge=true}user/1001");
> session2 = new
> Session("{bypass_media=true,ignore_early_media=true}user/1001");
> session.setAutoHangup(false)
> session2.setAutoHangup(false)
> apiExecute("uuid_bridge "+session.uuid+" "+session2.uuid);
> apiExecute('uuid_media off '+session.uuid);
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> But sessions do not get bridged -( Even if I insert session.ready() after
> each call.
> Any ideas on how to call the functions correctly to get the reINVITE?
> Best regards,
> Timur Valishev
> 2010/2/5 Brian West <brian at freeswitch.org>
>>
>> set it inside each of the {} for each session you create its not set after
>> the fact the call is up already...  you're setting it too late.
>> you an also issue uuid_media off <uuid>
>> /b
>> On Feb 5, 2010, at 2:18 AM, Timur Valishev wrote:
>>
>> I've modified my script to make sure: <<<<<<<<<<<<<<<<<<<<<<<<<<<<,
>> session = new Session(
>>
>> "{ignore_early_media=true,hangup_after_bridge=true}sofia/external/timwork at novion.ru"
>> );
>> session2 = new Session(
>> "{ignore_early_media=true}sofia/external/timwork at novion.ru"
>> );
>> session.setVariable('bypass_media', 'true');
>> session2.setVariable('bypass_media', 'true');
>> bridge(session, session2);
>>
>> _______________________________________________
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>




More information about the FreeSWITCH-users mailing list