Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Can I stream a file to a parked call.


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
pjintheusa at gmail.com
Guest





PostPosted: Thu Aug 27, 2009 3:16 pm    Post subject: [Freeswitch-users] Can I stream a file to a parked call. Reply with quote

Hi there,

I know there are other ways of doing this. I am just trying get to
know have fun with the FreeSWITCH API.

I am using originate and park a call:

fsApi.Execute("originate",
string.Format("[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2}
&park", blegSession.Uuid, OutgoingCallerID, NumberToDial));

That works great, the phone rings. I want to play something to this
called party when they pick up.

while (!blegSession.answered())
{
Log.WriteLine(LogLevel.Alert,
"Inside::CallReturns:!Session.answered::Loop");
blegSession.sleep(500, 1);
}

string promptFile = "prompts/whisper.wav";
blegSession.StreamFile(promptFile, 0);


This works - but the audio is choppy and slow.

Is there something I need to do to that parked call before streaming that file?


Thanks for any input.

Phil

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
anthony.minessale at g...
Guest





PostPosted: Thu Aug 27, 2009 3:36 pm    Post subject: [Freeswitch-users] Can I stream a file to a parked call. Reply with quote

try wedging {ignore_early_media=true} before the first [ in your dial string
and eliminate the code waiting for answer.


On Thu, Aug 27, 2009 at 3:09 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
Hi there,

I know there are other ways of doing this. I am just trying get to
know have fun with the FreeSWITCH API.

I am using originate and park a call:

fsApi.Execute("originate",
string.Format("[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2}
&park", blegSession.Uuid, OutgoingCallerID, NumberToDial));

That works great, the phone rings. I want to play something to this
called party when they pick up.

 while (!blegSession.answered())
 {
       Log.WriteLine(LogLevel.Alert,
"Inside::CallReturns:!Session.answered::Loop");
       blegSession.sleep(500, 1);
 }

string promptFile = "prompts/whisper.wav";
blegSession.StreamFile(promptFile, 0);


This works - but the audio is choppy and slow.

Is there something I need to do to that parked call before streaming that file?


Thanks for any input.

Phil

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
pjintheusa at gmail.com
Guest





PostPosted: Fri Aug 28, 2009 3:24 pm    Post subject: [Freeswitch-users] Can I stream a file to a parked call. Reply with quote

thanks for the reply.

Tried this and exactly the same result. The prompt is slowed - as if
the person is drunk.

I do notice that the originating call SDP shows:

a=rtpmap:0 PCMU/8000

but the play tries to use:

EXECUTE sofia/external/6093693828
playback(prompts/press-1-to-accept-call-from.wav)
2009-08-28 16:03:14.507375 [DEBUG] switch_ivr_play_say.c:1097 Codec
Activated L16@8000hz 1 channels 20ms


Should the codec be PCMU@8000hz as opposed to L16@8000hz? If so of
there a way of forcing this codec for play.

Thanks


Phillip


Full code & logs
http://pastebin.freeswitch.org/10147
http://pastebin.freeswitch.org/10150



On Thu, Aug 27, 2009 at 4:30 PM, Anthony
Minessale<anthony.minessale@gmail.com> wrote:
Quote:
try wedging {ignore_early_media=true} before the first [ in your dial string
and eliminate the code waiting for answer.


On Thu, Aug 27, 2009 at 3:09 PM, Phillip Jones <pjintheusa@gmail.com> wrote:
Quote:

Hi there,

I know there are other ways of doing this. I am just trying get to
know have fun with the FreeSWITCH API.

I am using originate and park a call:

fsApi.Execute("originate",

string.Format("[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2}
&park", blegSession.Uuid, OutgoingCallerID, NumberToDial));

That works great, the phone rings. I want to play something to this
called party when they pick up.

 while (!blegSession.answered())
 {
       Log.WriteLine(LogLevel.Alert,
"Inside::CallReturns:!Session.answered::Loop");
       blegSession.sleep(500, 1);
 }

string promptFile = "prompts/whisper.wav";
blegSession.StreamFile(promptFile, 0);


This works - but the audio is choppy and slow.

Is there something I need to do to that parked call before streaming that
file?


Thanks for any input.

Phil

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



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org
pstn:213-799-1400

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
anthony.minessale at g...
Guest





PostPosted: Fri Aug 28, 2009 3:41 pm    Post subject: [Freeswitch-users] Can I stream a file to a parked call. Reply with quote

the L16 codec is used because the wav files is raw PCM audio
which is being encoded to PCMU

Have you tried doing this to a locally registered phone?



On Fri, Aug 28, 2009 at 3:13 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
thanks for the reply.

Tried this and exactly the same result. The prompt is slowed - as if
the person is drunk.

I do notice that the originating call SDP shows:

a=rtpmap:0 PCMU/8000

but the play tries to use:

EXECUTE sofia/external/6093693828
playback(prompts/press-1-to-accept-call-from.wav)
2009-08-28 16:03:14.507375 [DEBUG] switch_ivr_play_say.c:1097 Codec
Activated L16@8000hz 1 channels 20ms


Should the codec be PCMU@8000hz as opposed to L16@8000hz? If so of
there a way of forcing this codec for play.

Thanks


Phillip


Full code & logs
http://pastebin.freeswitch.org/10147
http://pastebin.freeswitch.org/10150




On Thu, Aug 27, 2009 at 4:30 PM, Anthony
Minessale<anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
try wedging {ignore_early_media=true} before the first [ in your dial string
and eliminate the code waiting for answer.


On Thu, Aug 27, 2009 at 3:09 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:

Hi there,

I know there are other ways of doing this. I am just trying get to
know have fun with the FreeSWITCH API.

I am using originate and park a call:

fsApi.Execute("originate",

string.Format("[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2}
&park", blegSession.Uuid, OutgoingCallerID, NumberToDial));

That works great, the phone rings. I want to play something to this
called party when they pick up.

 while (!blegSession.answered())
 {
       Log.WriteLine(LogLevel.Alert,
"Inside::CallReturns:!Session.answered::Loop");
       blegSession.sleep(500, 1);
 }

string promptFile = "prompts/whisper.wav";
blegSession.StreamFile(promptFile, 0);


This works - but the audio is choppy and slow.

Is there something I need to do to that parked call before streaming that
file?


Thanks for any input.

Phil

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@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@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org





--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
anthony.minessale at g...
Guest





PostPosted: Fri Aug 28, 2009 3:44 pm    Post subject: [Freeswitch-users] Can I stream a file to a parked call. Reply with quote

nevermind,

I didn't look closely at your code.

how did you end up with blegSession ?
Are you running this script from the CLI or via the application interface.







On Fri, Aug 28, 2009 at 3:33 PM, Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
the L16 codec is used because the wav files is raw PCM audio
which is being encoded to PCMU

Have you tried doing this to a locally registered phone?




On Fri, Aug 28, 2009 at 3:13 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
thanks for the reply.

Tried this and exactly the same result. The prompt is slowed - as if
the person is drunk.

I do notice that the originating call SDP shows:

a=rtpmap:0 PCMU/8000

but the play tries to use:

EXECUTE sofia/external/6093693828
playback(prompts/press-1-to-accept-call-from.wav)
2009-08-28 16:03:14.507375 [DEBUG] switch_ivr_play_say.c:1097 Codec
Activated L16@8000hz 1 channels 20ms


Should the codec be PCMU@8000hz as opposed to L16@8000hz? If so of
there a way of forcing this codec for play.

Thanks


Phillip


Full code & logs
http://pastebin.freeswitch.org/10147
http://pastebin.freeswitch.org/10150




On Thu, Aug 27, 2009 at 4:30 PM, Anthony
Minessale<anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
try wedging {ignore_early_media=true} before the first [ in your dial string
and eliminate the code waiting for answer.


On Thu, Aug 27, 2009 at 3:09 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:

Hi there,

I know there are other ways of doing this. I am just trying get to
know have fun with the FreeSWITCH API.

I am using originate and park a call:

fsApi.Execute("originate",

string.Format("[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2}
&park", blegSession.Uuid, OutgoingCallerID, NumberToDial));

That works great, the phone rings. I want to play something to this
called party when they pick up.

 while (!blegSession.answered())
 {
       Log.WriteLine(LogLevel.Alert,
"Inside::CallReturns:!Session.answered::Loop");
       blegSession.sleep(500, 1);
 }

string promptFile = "prompts/whisper.wav";
blegSession.StreamFile(promptFile, 0);


This works - but the audio is choppy and slow.

Is there something I need to do to that parked call before streaming that
file?


Thanks for any input.

Phil

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@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@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org







--

Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400





--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
pjintheusa at gmail.com
Guest





PostPosted: Fri Aug 28, 2009 3:59 pm    Post subject: [Freeswitch-users] Can I stream a file to a parked call. Reply with quote

The dialplan is is kicking off the C# script:

<condition field="destination_number" expression="^(12125553666)$">
     <action application="managed" data="MyFSProjects.ProcessCall"/>
</condition>

I launch a thread and specify the uuid to originate:

fsApi.Execute("originate", string.Format("{{ignore_early_media=true,absolute_codec_string='PCMU'}}[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2} &park", call.Uuid, call.OutgoingCallerID, call.NumberToDial));

in the callback i try and play the wav file:

FreeSWITCH.Native.ManagedSession blegSession = new FreeSWITCH.Native.ManagedSession(callID);
           
if (blegSession.Ready() && blegSession.mediaReady())
{
      blegSession.Answer();
      blegSession.Execute("playback", "prompts/press-1-to-accept-call-from.wav");
}

I go on to bridge the leg a and b - that bits works fine.



On Fri, Aug 28, 2009 at 4:40 PM, Anthony Minessale<anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
nevermind,

I didn't look closely at your code.

how did you end up with blegSession ?
Are you running this script from the CLI or via the application interface.







On Fri, Aug 28, 2009 at 3:33 PM, Anthony Minessale
<anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:

the L16 codec is used because the wav files is raw PCM audio
which is being encoded to PCMU

Have you tried doing this to a locally registered phone?



On Fri, Aug 28, 2009 at 3:13 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)>
wrote:
Quote:

thanks for the reply.

Tried this and exactly the same result. The prompt is slowed - as if
the person is drunk.

I do notice that the originating call SDP shows:

a=rtpmap:0 PCMU/8000

but the play tries to use:

EXECUTE sofia/external/6093693828
playback(prompts/press-1-to-accept-call-from.wav)
2009-08-28 16:03:14.507375 [DEBUG] switch_ivr_play_say.c:1097 Codec
Activated L16@8000hz 1 channels 20ms


Should the codec be PCMU@8000hz as opposed to L16@8000hz? If so of
there a way of forcing this codec for play.

Thanks


Phillip


Full code & logs
http://pastebin.freeswitch.org/10147
http://pastebin.freeswitch.org/10150



On Thu, Aug 27, 2009 at 4:30 PM, Anthony
Minessale<anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
try wedging {ignore_early_media=true} before the first [ in your dial
string
and eliminate the code waiting for answer.


On Thu, Aug 27, 2009 at 3:09 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)>
wrote:
Quote:

Hi there,

I know there are other ways of doing this. I am just trying get to
know have fun with the FreeSWITCH API.

I am using originate and park a call:

fsApi.Execute("originate",


string.Format("[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2}
&park", blegSession.Uuid, OutgoingCallerID, NumberToDial));

That works great, the phone rings. I want to play something to this
called party when they pick up.

 while (!blegSession.answered())
 {
       Log.WriteLine(LogLevel.Alert,
"Inside::CallReturns:!Session.answered::Loop");
       blegSession.sleep(500, 1);
 }

string promptFile = "prompts/whisper.wav";
blegSession.StreamFile(promptFile, 0);


This works - but the audio is choppy and slow.

Is there something I need to do to that parked call before streaming
that
file?


Thanks for any input.

Phil

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users

UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@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@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


Back to top
anthony.minessale at g...
Guest





PostPosted: Fri Aug 28, 2009 4:22 pm    Post subject: [Freeswitch-users] Can I stream a file to a parked call. Reply with quote

Taking over the session while it's parked like that from your code and asking it to play a file is making it do 2 things at once.
The session's thread is already busy in the park loop so you would have to change it's state to something passive like soft_execute so
it's thread was not doing anything or send it a message so the park loop would pick it up by using the uuid_broadcast app::arg

there are variables you can set that begin group_confirm_* that you can set to do this all without even using a script.

http://wiki.freeswitch.org/wiki/Channel_Variables#Answer_confirmation_variables




On Fri, Aug 28, 2009 at 3:53 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
The dialplan is is kicking off the C# script:

<condition field="destination_number" expression="^(12125553666)$">
     <action application="managed" data="MyFSProjects.ProcessCall"/>
</condition>

I launch a thread and specify the uuid to originate:

fsApi.Execute("originate", string.Format("{{ignore_early_media=true,absolute_codec_string='PCMU'}}[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2} &park", call.Uuid, call.OutgoingCallerID, call.NumberToDial));

in the callback i try and play the wav file:

FreeSWITCH.Native.ManagedSession blegSession = new FreeSWITCH.Native.ManagedSession(callID);
           
if (blegSession.Ready() && blegSession.mediaReady())
{
      blegSession.Answer();
      blegSession.Execute("playback", "prompts/press-1-to-accept-call-from.wav");
}

I go on to bridge the leg a and b - that bits works fine.




On Fri, Aug 28, 2009 at 4:40 PM, Anthony Minessale<anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
nevermind,

I didn't look closely at your code.

how did you end up with blegSession ?
Are you running this script from the CLI or via the application interface.







On Fri, Aug 28, 2009 at 3:33 PM, Anthony Minessale
<anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:

the L16 codec is used because the wav files is raw PCM audio
which is being encoded to PCMU

Have you tried doing this to a locally registered phone?



On Fri, Aug 28, 2009 at 3:13 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)>
wrote:
Quote:

thanks for the reply.

Tried this and exactly the same result. The prompt is slowed - as if
the person is drunk.

I do notice that the originating call SDP shows:

a=rtpmap:0 PCMU/8000

but the play tries to use:

EXECUTE sofia/external/6093693828
playback(prompts/press-1-to-accept-call-from.wav)
2009-08-28 16:03:14.507375 [DEBUG] switch_ivr_play_say.c:1097 Codec
Activated L16@8000hz 1 channels 20ms


Should the codec be PCMU@8000hz as opposed to L16@8000hz? If so of
there a way of forcing this codec for play.

Thanks


Phillip


Full code & logs
http://pastebin.freeswitch.org/10147
http://pastebin.freeswitch.org/10150



On Thu, Aug 27, 2009 at 4:30 PM, Anthony
Minessale<anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
try wedging {ignore_early_media=true} before the first [ in your dial
string
and eliminate the code waiting for answer.


On Thu, Aug 27, 2009 at 3:09 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)>
wrote:
Quote:

Hi there,

I know there are other ways of doing this. I am just trying get to
know have fun with the FreeSWITCH API.

I am using originate and park a call:

fsApi.Execute("originate",


string.Format("[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2}
&park", blegSession.Uuid, OutgoingCallerID, NumberToDial));

That works great, the phone rings. I want to play something to this
called party when they pick up.

 while (!blegSession.answered())
 {
       Log.WriteLine(LogLevel.Alert,
"Inside::CallReturns:!Session.answered::Loop");
       blegSession.sleep(500, 1);
 }

string promptFile = "prompts/whisper.wav";
blegSession.StreamFile(promptFile, 0);


This works - but the audio is choppy and slow.

Is there something I need to do to that parked call before streaming
that
file?


Thanks for any input.

Phil

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users

UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@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@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@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@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
pjintheusa at gmail.com
Guest





PostPosted: Mon Aug 31, 2009 3:30 pm    Post subject: [Freeswitch-users] Can I stream a file to a parked call. Reply with quote

That makes perfect sense - I now send the call to a managed app instead of park and every thing works great. thanks.



On Fri, Aug 28, 2009 at 5:12 PM, Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
Taking over the session while it's parked like that from your code and asking it to play a file is making it do 2 things at once.
The session's thread is already busy in the park loop so you would have to change it's state to something passive like soft_execute so
it's thread was not doing anything or send it a message so the park loop would pick it up by using the uuid_broadcast app::arg

there are variables you can set that begin group_confirm_* that you can set to do this all without even using a script.

http://wiki.freeswitch.org/wiki/Channel_Variables#Answer_confirmation_variables





On Fri, Aug 28, 2009 at 3:53 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)> wrote:
Quote:
The dialplan is is kicking off the C# script:

<condition field="destination_number" expression="^(12125553666)$">
     <action application="managed" data="MyFSProjects.ProcessCall"/>
</condition>

I launch a thread and specify the uuid to originate:

fsApi.Execute("originate", string.Format("{{ignore_early_media=true,absolute_codec_string='PCMU'}}[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2} &park", call.Uuid, call.OutgoingCallerID, call.NumberToDial));

in the callback i try and play the wav file:

FreeSWITCH.Native.ManagedSession blegSession = new FreeSWITCH.Native.ManagedSession(callID);
           
if (blegSession.Ready() && blegSession.mediaReady())
{
      blegSession.Answer();
      blegSession.Execute("playback", "prompts/press-1-to-accept-call-from.wav");
}

I go on to bridge the leg a and b - that bits works fine.




On Fri, Aug 28, 2009 at 4:40 PM, Anthony Minessale<anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
nevermind,

I didn't look closely at your code.

how did you end up with blegSession ?
Are you running this script from the CLI or via the application interface.







On Fri, Aug 28, 2009 at 3:33 PM, Anthony Minessale
<anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:

the L16 codec is used because the wav files is raw PCM audio
which is being encoded to PCMU

Have you tried doing this to a locally registered phone?



On Fri, Aug 28, 2009 at 3:13 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)>
wrote:
Quote:

thanks for the reply.

Tried this and exactly the same result. The prompt is slowed - as if
the person is drunk.

I do notice that the originating call SDP shows:

a=rtpmap:0 PCMU/8000

but the play tries to use:

EXECUTE sofia/external/6093693828
playback(prompts/press-1-to-accept-call-from.wav)
2009-08-28 16:03:14.507375 [DEBUG] switch_ivr_play_say.c:1097 Codec
Activated L16@8000hz 1 channels 20ms


Should the codec be PCMU@8000hz as opposed to L16@8000hz? If so of
there a way of forcing this codec for play.

Thanks


Phillip


Full code & logs
http://pastebin.freeswitch.org/10147
http://pastebin.freeswitch.org/10150



On Thu, Aug 27, 2009 at 4:30 PM, Anthony
Minessale<anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
try wedging {ignore_early_media=true} before the first [ in your dial
string
and eliminate the code waiting for answer.


On Thu, Aug 27, 2009 at 3:09 PM, Phillip Jones <pjintheusa@gmail.com (pjintheusa@gmail.com)>
wrote:
Quote:

Hi there,

I know there are other ways of doing this. I am just trying get to
know have fun with the FreeSWITCH API.

I am using originate and park a call:

fsApi.Execute("originate",


string.Format("[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2}
&park", blegSession.Uuid, OutgoingCallerID, NumberToDial));

That works great, the phone rings. I want to play something to this
called party when they pick up.

 while (!blegSession.answered())
 {
       Log.WriteLine(LogLevel.Alert,
"Inside::CallReturns:!Session.answered::Loop");
       blegSession.sleep(500, 1);
 }

string promptFile = "prompts/whisper.wav";
blegSession.StreamFile(promptFile, 0);


This works - but the audio is choppy and slow.

Is there something I need to do to that parked call before streaming
that
file?


Thanks for any input.

Phil

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users

UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@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@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@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@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services