[Freeswitch-dev] connecting two sessions
Peter Volchek
pvolchek at voicemobility.com
Fri Oct 16 13:03:18 PDT 2009
Sure I did,
See the code in the initial posting.
As I realized, I need to create a bridge to connect the existing session
with the new one.
I tried the following code:
session:execute("bridge",
"{originate_timeout=20,origination_caller_id_number=6006,origination_caller_id_name=Peter
,ringback=/usr/local/freeswitch/sounds/music/8000/ponce-preludio-in-e-major.wav}sofia/192.168.1.52/1004");
It places the call (the destination phone rings), but does not play
anything back.
There is something else I am missing.
PV
Chris Burns wrote:
> Did you already answer the channel?
>
> http://wiki.freeswitch.org/wiki/Variable_ringback
> vs.
> http://wiki.freeswitch.org/wiki/Variable_transfer_ringback
>
> On October 16, 2009 01:25:01 pm Peter Volchek wrote:
>
>> Using some hints, that Mike sent me, I found the answer to my question #2.
>>
>> I found an answer to question 2
>> local session1 =
>> freeswitch.Session("{originate_timeout=20}sofia/192.168.1.52/1004"); This
>> will be trying to connect fo 20 seconds
>>
>> HOwever, when I place a call like that, there is a silence in the caller
>> handset. I was trying to play some music on hold (question #1 and #3) using
>> the following syntax, but that did not work
>>
>> local session1 = freeswitch.Session(
>> "{originate_timeout=20,
>>
>> ringback=/usr/local/freeswitch/sounds/music/8000/ponce-preludio-in-e-major.
>> wav}sofia/192.168.1.52/1004");
>>
>> Any solutions?
>> PV
>>
>> Michael Jerris wrote:
>> There is no reason to re-create this functionality in lua, it already
>> exists.
>>
>>
>> http://wiki.freeswitch.org/wiki/Freeswitch_IVR_Originate
>>
>>
>> http://wiki.freeswitch.org/wiki/Variable_ringback
>>
>>
>>
>>
>> Mike
>>
>>
>> On Oct 15, 2009, at 8:55 PM, Peter Volchek wrote:
>>
>>
>> Hi Guys,
>> Here is the task I need your help with.
>>
>> The feature I am trying to build is called 'Find Me" or 'Follow Me'.
>> When the call comes in, I am trying the call the predefined list of
>> numbers in sequence, and if none answers, I am going into voice receiving
>> mode.
>>
>> I am using the lua language.
>>
>> Here is what I am doing (pseudo code)
>> I'll be asking the question just in the code
>>
>>
>> session:answer();
>>
>> playPrompt('transfer_greeting');
>>
>> next_number = getNextNumber();
>>
>> -- Question #1:
>> -- I am about to start a new session.
>> -- However, at this point I'd like to play some moho (music on hold) for
>> the existing one
>>
>>
>> -- Creating a new session. The destination phone start ringing
>> local session1 = freeswitch.Session("sofia/192.168.1.52/" .. next_number
>> ); -- Question #2:
>> -- How could I specify the number of rings to wait before session answers?
>> Or maybe the timeout
>>
>>
>>
>> if( session1:ready() == true ) then
>> -- Question #3
>> -- Session answered. At this point I need to stop the music on hold.
>> How? -- Now I need to join the existing session with the newly created one
>> -- there is a session:transfer method, but I can't see how I can use it
>> here else
>> playPrompt("Can't find. Please leave a message");
>> doReceiveMessage()'
>> end
>>
>>
>>
>>
>> Has anyone worked on that feature before. I would appreciate all possible
>> solutions and explanations. Thank you in advance.
>>
>>
>>
>>
>>
>
More information about the FreeSWITCH-dev
mailing list