Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[Freeswitch-users] Socket inbound or outbound with PHP?

Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
dave at 3c.co.uk
Guest





PostPosted: Wed Oct 22, 2008 11:04 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

Hi Dennis,

Quote:
Till now I always worked with socket outbound and a PHP script, which
forks the different processes. Everything seemed to work great (in my
little test environment) and I am at the point, where I could do most
if not all of the things I wanted to do with fs.

Today I made an originate over api, passed the inbound uuid to the
outbound and could control different things - I also could bridge both
calls. Great, I thought. Then I wanted to start the next little test:
Start a playfile from the outbound, so that the inbound can hear it...
Negative!
It seems to be impossible to send a playfile or hangup (and more) over
api. Both command seem only to be available with sendmsg. But sendmsg
<uuid> does not work with socket outbound, at least not from the
outbound to the inbound.


What you'll probably need to do is to get the two processes handling the
two legs talking to each other, so that the one handling the outbound
leg
sends a message to the one handling the inbound leg, and that message
causes the process handling the inbound leg to start playing the file.

Stick with what you're doing - you're on the right track to end up
with a
fantastically powerful IVR, and it doesn't sound like you're far from
that
turning point where everything slots in to place and things just start
to
work..!

Cheers --

Dave


_______________________________________________
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: Wed Oct 22, 2008 11:19 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

You have to learn and understand the terminology and structure.

FSAPI is the name of the interface that allows the registration of arbitrary commands which can be executed by cli, xml-rpc and event socket, they are not tied to a specific channel at all.

APPLICATION is the name of the interface that provides applications to be executed by individual calls
they are designed with the concept that you have a channel and you want to make the channel do something these are the things you execute in the dialplan in the <action> tags.

event socket has the command sendmsg which lets you send a message to a specific channel. This can be any message but the one you are familiar with is the one that tells the session to execute an application. Think of it as you are sending an instant message to the channel saying, please execute this dialplan application.
The caveat to this is that it will only listen to you if you have first parked the call which is a mutual agreement between you and the call that you are allowed to control it. The outbound event socket to your program explicitly puts the call into park and the originated sessions that execute park also fall into this category.

the "api" event socket command is a way to execute FSAPI commands from the socket (anything you can type from the cli like "show channels") There are several FSAPI commands that can manipulate calls but rather than sending them a message to execte some app you are specifiying the uuid to gain acces to the channel in order to carry out your command. Most of these commands begin with uuid_ so there are things like
uuid_bridge, uuid_kill, uuid_transfer etc.

So in short, the answer is, yes, it's because you only started last week. Everything you want to be able to do is there for you you just have to shift your paradigm or as like Doc Brown likes to say "learn to think 4th dimensionally!"


You may find it useful to join irc irc.freenode.net #freeswitch or use the applet on our homeage by looking for the chat login box on the right side of the page towards the bottom. There are over one hundered people in there who can offer advice etc.










On Wed, Oct 22, 2008 at 10:23 AM, Dennis <odermann@googlemail.com (odermann@googlemail.com)> wrote:
Quote:
Ahh, help, I found something out about my question and would like to
know, if I am really in trouble...
The problem is, when one does not read every single word.

Till now I always worked with socket outbound and a PHP script, which
forks the different processes. Everything seemed to work great (in my
little test environment) and I am at the point, where I could do most
if not all of the things I wanted to do with fs.

Today I made an originate over api, passed the inbound uuid to the
outbound and could control different things - I also could bridge both
calls. Great, I thought. Then I wanted to start the next little test:
Start a playfile from the outbound, so that the inbound can hear it...
Negative!
It seems to be impossible to send a playfile or hangup (and more) over
api. Both command seem only to be available with sendmsg. But sendmsg
<uuid> does not work with socket outbound, at least not from the
outbound to the inbound.

show application and show api tell a lot and I do know, when I stopped
thinking Sad Perhaps my mistakes came up, because I started to use fs
one and a half week ago - I don't know.

So do I have to switch completely to socket inbound or is there a way
to continue using socket outbound? Or will I perhaps find out, that I
can not do some things with socket inbound, which I could do with
socket outbound?

In the moment I just do not know which way to go...

Dennis


_______________________________________________
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/

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
odermann at googlemail...
Guest





PostPosted: Wed Oct 22, 2008 11:47 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

Hi David,

2008/10/22 David Knell <dave@3c.co.uk>:

Quote:
What you'll probably need to do is to get the two processes handling the
two legs talking to each other, so that the one handling the outbound
leg
sends a message to the one handling the inbound leg, and that message
causes the process handling the inbound leg to start playing the file.

Stick with what you're doing - you're on the right track to end up
with a
fantastically powerful IVR, and it doesn't sound like you're far from
that
turning point where everything slots in to place and things just start
to
work..!

Thanks for giving me hope and let me feel not beeing on the absolutely
wrong track!

For sure I will go on working on the problems. I know that freeswitch
is the way to go and I know, that freeswitch can do everything I need.
It is only frustrating to see, that so many spent hours where spent
for the probably wrong way.

Because many hours spent on freeswitch let me learn a lot about it and
let me know, that I can reach my goals with it, makes me not
resignate.

I hope I will find out, how to make both (or perhaps a lot more)
processes talk to each other.

Kind regards
Dennis

_______________________________________________
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: Wed Oct 22, 2008 11:48 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

You may also be interested in a new feature added to r10110 (no we dont use binary version numbers)

you can call inbound to event_socket and once authenticated you can issue the command
myevents <uuid>
where <uuid> is the uuid of some not-yet-controlled call. If all goes well you will get a positive reply and now you the behaviour will be identical to outbound event socket with async full flags and events on that one channel will begin to flow.



On Wed, Oct 22, 2008 at 11:00 AM, Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
Quote:
You have to learn and understand the terminology and structure.

FSAPI is the name of the interface that allows the registration of arbitrary commands which can be executed by cli, xml-rpc and event socket, they are not tied to a specific channel at all.

APPLICATION is the name of the interface that provides applications to be executed by individual calls
they are designed with the concept that you have a channel and you want to make the channel do something these are the things you execute in the dialplan in the <action> tags.

event socket has the command sendmsg which lets you send a message to a specific channel. This can be any message but the one you are familiar with is the one that tells the session to execute an application. Think of it as you are sending an instant message to the channel saying, please execute this dialplan application.
The caveat to this is that it will only listen to you if you have first parked the call which is a mutual agreement between you and the call that you are allowed to control it. The outbound event socket to your program explicitly puts the call into park and the originated sessions that execute park also fall into this category.

the "api" event socket command is a way to execute FSAPI commands from the socket (anything you can type from the cli like "show channels") There are several FSAPI commands that can manipulate calls but rather than sending them a message to execte some app you are specifiying the uuid to gain acces to the channel in order to carry out your command. Most of these commands begin with uuid_ so there are things like
uuid_bridge, uuid_kill, uuid_transfer etc.

So in short, the answer is, yes, it's because you only started last week. Everything you want to be able to do is there for you you just have to shift your paradigm or as like Doc Brown likes to say "learn to think 4th dimensionally!"


You may find it useful to join irc irc.freenode.net #freeswitch or use the applet on our homeage by looking for the chat login box on the right side of the page towards the bottom. There are over one hundered people in there who can offer advice etc.











On Wed, Oct 22, 2008 at 10:23 AM, Dennis <odermann@googlemail.com (odermann@googlemail.com)> wrote:
Quote:
Ahh, help, I found something out about my question and would like to
know, if I am really in trouble...
The problem is, when one does not read every single word.

Till now I always worked with socket outbound and a PHP script, which
forks the different processes. Everything seemed to work great (in my
little test environment) and I am at the point, where I could do most
if not all of the things I wanted to do with fs.

Today I made an originate over api, passed the inbound uuid to the
outbound and could control different things - I also could bridge both
calls. Great, I thought. Then I wanted to start the next little test:
Start a playfile from the outbound, so that the inbound can hear it...
Negative!
It seems to be impossible to send a playfile or hangup (and more) over
api. Both command seem only to be available with sendmsg. But sendmsg
<uuid> does not work with socket outbound, at least not from the
outbound to the inbound.

show application and show api tell a lot and I do know, when I stopped
thinking Sad Perhaps my mistakes came up, because I started to use fs
one and a half week ago - I don't know.

So do I have to switch completely to socket inbound or is there a way
to continue using socket outbound? Or will I perhaps find out, that I
can not do some things with socket inbound, which I could do with
socket outbound?

In the moment I just do not know which way to go...

Dennis


_______________________________________________
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/

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/

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: Wed Oct 22, 2008 11:52 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

imagine how many hours were spent trying to code it from scratch =D

you did not waste any hours, you have convinced yourself you are doing it wrong when really you are just choosing the wrong commands. again JOIN IRC so more people can help you.



On Wed, Oct 22, 2008 at 11:34 AM, Dennis <odermann@googlemail.com (odermann@googlemail.com)> wrote:
Quote:
Hi David,

2008/10/22 David Knell <dave@3c.co.uk (dave@3c.co.uk)>:

Quote:
What you'll probably need to do is to get the two processes handling the
two legs talking to each other, so that the one handling the outbound
leg
sends a message to the one handling the inbound leg, and that message
causes the process handling the inbound leg to start playing the file.

Stick with what you're doing - you're on the right track to end up
with a
fantastically powerful IVR, and it doesn't sound like you're far from
that
turning point where everything slots in to place and things just start
to
work..!


Thanks for giving me hope and let me feel not beeing on the absolutely
wrong track!

For sure I will go on working on the problems. I know that freeswitch
is the way to go and I know, that freeswitch can do everything I need.
It is only frustrating to see, that so many spent hours where spent
for the probably wrong way.

Because many hours spent on freeswitch let me learn a lot about it and
let me know, that I can reach my goals with it, makes me not
resignate.

I hope I will find out, how to make both (or perhaps a lot more)
processes talk to each other.

Kind regards
Dennis


_______________________________________________
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/

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
odermann at googlemail...
Guest





PostPosted: Wed Oct 22, 2008 11:53 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

I know, that I am missing a lot of things regarding freeswitch and
that I still have to learn a lot about it (it would be sad, if could
lear all aspects within a week Wink.

I will come back to your answer tomorrow, because I want to understand
every single aspect of it and I want to make my own little tests to
understand more.
I have to admit, that I have to think a little bit more about what I
read, if it is written in english Smile

Thanks again
Dennis



2008/10/22 Anthony Minessale <anthony.minessale@gmail.com>:
Quote:
You have to learn and understand the terminology and structure.

FSAPI is the name of the interface that allows the registration of arbitrary
commands which can be executed by cli, xml-rpc and event socket, they are
not tied to a specific channel at all.

APPLICATION is the name of the interface that provides applications to be
executed by individual calls
they are designed with the concept that you have a channel and you want to
make the channel do something these are the things you execute in the
dialplan in the <action> tags.

event socket has the command sendmsg which lets you send a message to a
specific channel. This can be any message but the one you are familiar with
is the one that tells the session to execute an application. Think of it as
you are sending an instant message to the channel saying, please execute
this dialplan application.
The caveat to this is that it will only listen to you if you have first
parked the call which is a mutual agreement between you and the call that
you are allowed to control it. The outbound event socket to your program
explicitly puts the call into park and the originated sessions that execute
park also fall into this category.

the "api" event socket command is a way to execute FSAPI commands from the
socket (anything you can type from the cli like "show channels") There are
several FSAPI commands that can manipulate calls but rather than sending
them a message to execte some app you are specifiying the uuid to gain acces
to the channel in order to carry out your command. Most of these commands
begin with uuid_ so there are things like
uuid_bridge, uuid_kill, uuid_transfer etc.

So in short, the answer is, yes, it's because you only started last week.
Everything you want to be able to do is there for you you just have to shift
your paradigm or as like Doc Brown likes to say "learn to think 4th
dimensionally!"


You may find it useful to join irc irc.freenode.net #freeswitch or use the
applet on our homeage by looking for the chat login box on the right side of
the page towards the bottom. There are over one hundered people in there
who can offer advice etc.

_______________________________________________
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
odermann at googlemail...
Guest





PostPosted: Wed Oct 22, 2008 12:18 pm    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

Quote:
imagine how many hours were spent trying to code it from scratch =D

I don't think I want to know that. Do you ever sleep??? Wink


Quote:
you did not waste any hours, you have convinced yourself you are doing it
wrong when really you are just choosing the wrong commands.

Hehe, that gives me hope and I will be up very early tomorrow
(european time) to go through everything to try to avoid mistakes and
missunderstandings (as far this is possible as a fs-noob and an
only-slightly-good-english-speaking-person).


Quote:
again JOIN IRC so more people can help you.

I am a webdeveloper for 12 years now and I never used IRC. Strange,
that I never used it, but I will be happy to take a ride. Might be
fun, a new experiance and informative.

Thanks
Dennis

_______________________________________________
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
odermann at googlemail...
Guest





PostPosted: Thu Oct 23, 2008 6:53 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

2008/10/22 Anthony Minessale <anthony.minessale@gmail.com>:

Quote:
event socket has the command sendmsg which lets you send a message to a
specific channel. This can be any message but the one you are familiar with
is the one that tells the session to execute an application. Think of it as
you are sending an instant message to the channel saying, please execute
this dialplan application.
The caveat to this is that it will only listen to you if you have first
parked the call which is a mutual agreement between you and the call that
you are allowed to control it. The outbound event socket to your program
explicitly puts the call into park and the originated sessions that execute
park also fall into this category.

If you talk about "event socket", do you mean "event socket inbound",
"event socket outbound" or both?
When I use sendmsg <uuid> in socket outbound to handle the current
process, everything works fine (I do not even need the uuid). But it
does not help to use sendmsg <uuid> to send commands to other
processes, although I know the uuid of the target.

It could be so easy (for me), if sendmsg would work to control another
process and not just the current or api would be able to send the same
commands as sendmsg...

It seems as if I HAVE to use event socket inbound if I want to be able
to send a playback command from one process or leg to the other.

Or do I have to use event socket inbound AND socket event outbound? So
that fs connects to one PHP script and another PHP script connects to
the fs?
You wrote: "you can call inbound to event_socket and once
authenticated you can issue the command myevents <uuid>". This seems
to tell me, that I have to connect to the fs, right?

_______________________________________________
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 Oct 23, 2008 8:19 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

On Thu, Oct 23, 2008 at 6:45 AM, Dennis <odermann@googlemail.com (odermann@googlemail.com)> wrote:
Quote:
2008/10/22 Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)>:

Quote:
event socket has the command sendmsg which lets you send a message to a
specific channel. This can be any message but the one you are familiar with
is the one that tells the session to execute an application. Think of it as
you are sending an instant message to the channel saying, please execute
this dialplan application.
The caveat to this is that it will only listen to you if you have first
parked the call which is a mutual agreement between you and the call that
you are allowed to control it. The outbound event socket to your program
explicitly puts the call into park and the originated sessions that execute
park also fall into this category.


If you talk about "event socket", do you mean "event socket inbound",
"event socket outbound" or both?
When I use sendmsg <uuid> in socket outbound to handle the current
process, everything works fine (I do not even need the uuid). But it
does not help to use sendmsg <uuid> to send commands to other
processes, although I know the uuid of the target.

What messages do you want to send? Be Specific.
Like i said you CANNOT blindly call sendmsg on any channel that was not first parked to indicate you should be controlling it.
Also like I already said, if you open a new inbound event socket connection and isssue "myevents <uuid>"
it is identical to as if that was an outbound event socket from the desired channel. It's new in latest trunk.

Probably if you explain *exactly* what you want to accomplish there is some simple way to do it.
Don't fret about the difference between inbound and outbound there is no difference besides you cant control calls that
were not in park.


Quote:

It could be so easy (for me), if sendmsg would work to control another
process and not just the current or api would be able to send the same
commands as sendmsg...

I'll tell you what, i'll lift that restriction in latest trunk and you tell me if it breaks anything or if it makes your life
easier since it's not really doing much but protecting you from yourself. So with latest code you can use your one socket
to send messages to the other leg too.


Quote:

It seems as if I HAVE to use event socket inbound if I want to be able
to send a playback command from one process or leg to the other.

Or do I have to use event socket inbound AND socket event outbound? So
that fs connects to one PHP script and another PHP script connects to
the fs?
You wrote: "you can call inbound to event_socket and once
authenticated you can issue the command myevents <uuid>". This seems
to tell me, that I have to connect to the fs, right?


_______________________________________________
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/

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
dave at 3c.co.uk
Guest





PostPosted: Thu Oct 23, 2008 8:43 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

Hi Anthony,

Quote:
I'll tell you what, i'll lift that restriction in latest trunk and
you tell me if it breaks anything or if it makes your life
easier since it's not really doing much but protecting you from
yourself. So with latest code you can use your one socket
to send messages to the other leg too.

A request from dumb and paranoid over here - could you add a config
variable to control this behaviour which is defaulted to keep
behaviour as it is - i.e. the restriction only gets lifted if the
switch is configured in that way?

Cheers --

Dave

_______________________________________________
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
odermann at googlemail...
Guest





PostPosted: Thu Oct 23, 2008 10:19 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

2008/10/23 Anthony Minessale <anthony.minessale@gmail.com>:

Please do not lose patience with me. I am absolutely new to the whole
sip-/phone-/call-thing...

Quote:
What messages do you want to send? Be Specific.

For example I want to send the message "playfile" from one process to
another (the call_direction outbound should send this message to the
call_direction inbound).


Quote:
Like i said you CANNOT blindly call sendmsg on any channel that was not
first parked to indicate you should be controlling it.

This is a point I do not understand. If two persons are talking to
each other, #1 (call_direction inbound) called #2 (call_direction
outbound), and #2 presses a key to play a file for #1, I see no way to
do so, because session #2 can not talk to session #1 (at least not
send a playfile message), when I use event socket outbound.
When both persons are connected to each other, how can I park #1 to
send a message to #1 from #2?


Quote:
Probably if you explain *exactly* what you want to accomplish there is some
simple way to do it.

Ok, then I will try to be a little more precise:

1.) I would like to use event socket outbound, because I have a good
PHP script, which works well and automatically forks a new PHP process
for each call/leg. If one of theses processes dies because of some
problems, all other calls are not affected. I have some problems to
thing the other way round and switch to event socket inbound.
Therefore I would prefer to keep the current PHP script.

2.) I have NO dialplan or something like this! I want to tell fs what
to over my PHP scripts.

3.) I want fs to come and tell my PHP script, if there are new events.
After that, my PHP script tells fs what to do. Then fs tells me, that
it has done what it should, I tell, what to do next.

Here is a detailed example:

1.) fs is connected to my PHP socket-script (not the other way round).

2.) The PHP socket-script registers to "myevents" and "event SESSION_HEARTBEAT".

3.) fs comes with an event and tells, that someone is calling/ringing.
The PHP socket-script forks a new PHP process (p #1), which handles this call.
Then I tell fs to answer (sendmsg answer) and to play a soundfile for
the caller (call_direction inbound).

sendmsg
call-command: execute
execute-app-name: playback
execute-app-arg: /var/www/freeswitch/hello.wav

4.) The caller knows, that if he presses the 1 digit, he will be
connected to a target.

5.) fs tells me, that the call_direction inbound pressed the 1
(event_name:DTMF, dtmf_digit:1).

6.) I tell fs to originate to a target. I do not want to bridge! I
want to control everything for different reasons.

api originate {origination_caller_id_number=1234567,inbound_uuid=".$event['Unique-ID']."}sofia/internal/1001@192.168.1.5
123

I pass the uuid of the call_direction inbound/caller to the
call_direction outbound/target, so that the call_direction outbound
knows the uuid of the call_direction inbound (to hopefully send
messages to the process of the call_direction inbound).


7.) The target ansers the call, but the call_direction inbound and the
call_direction outbound are not connected (which is good)
The PHP socket-scripts forks a new PHP process (p #2), which handles
the call_direction outbound/target.

Now I have two calls and two PHP processes.

Now the problems are coming up....

I want thecall_direction outbound to be able to press a digit and to
start a playback for the call_direction inbound/caller.
Because I passed the uuid of the call_direction inbound to the
call_direction outbound, the call_direction outbound knows the uuid
and could use this uuid to send a message to it.

But I can not use sendmsg uuid to do that.
I would like to send from p #2 (call_direction outbound)...

sendmsg 1dca106c-a10c-11dd-b986-d5cdf6924ae6 (which is the uuid of the
call_direction inbound in p #1)
call-command: execute
execute-app-name: playback
execute-app-arg: /var/www/freeswitch/again_hello.wav

... so that the call_direction inbound (in p #1) can hear the again_hello.wav.

Instead, the uuid is ignored and the file is playback for the
call_direction outbound (in p #2). The call with the uuid
1dca106c-a10c-11dd-b986-d5cdf6924ae6 will not hear anything.


I hope this example was a little bit better to understand than my
other examples.



Quote:
I'll tell you what, i'll lift that restriction in latest trunk and you tell
me if it breaks anything or if it makes your life
easier since it's not really doing much but protecting you from yourself. So
with latest code you can use your one socket
to send messages to the other leg too.

That sounds interesting, at least to find out, where my problems are.
I just donwloaded the latest trunk, but the szenario described above
stays the same.

If I send...

sendmsg 1dca106c-a10c-11dd-b986-d5cdf6924ae6 (which is the uuid of the
caller/inbound in p #1)
call-command: execute
execute-app-name: playback
execute-app-arg: /var/www/freeswitch/again_hello.wav

...the file will still be played back for the target/outbound.


Thanks again for your patience
Dennis

_______________________________________________
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 Oct 23, 2008 10:35 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

What does 123 lead to? launching another script?

you could make the 2nd originate lead to &park() in place of 123

and you could control both legs from the same socket.

please please join irc and let the whole group help you.




On Thu, Oct 23, 2008 at 10:02 AM, Dennis <odermann@googlemail.com (odermann@googlemail.com)> wrote:
Quote:
2008/10/23 Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)>:

Please do not lose patience with me. I am absolutely new to the whole
sip-/phone-/call-thing...

Quote:
What messages do you want to send? Be Specific.


For example I want to send the message "playfile" from one process to
another (the call_direction outbound should send this message to the
call_direction inbound).


Quote:
Like i said you CANNOT blindly call sendmsg on any channel that was not
first parked to indicate you should be controlling it.


This is a point I do not understand. If two persons are talking to
each other, #1 (call_direction inbound) called #2 (call_direction
outbound), and #2 presses a key to play a file for #1, I see no way to
do so, because session #2 can not talk to session #1 (at least not
send a playfile message), when I use event socket outbound.
When both persons are connected to each other, how can I park #1 to
send a message to #1 from #2?


Quote:
Probably if you explain *exactly* what you want to accomplish there is some
simple way to do it.


Ok, then I will try to be a little more precise:

1.) I would like to use event socket outbound, because I have a good
PHP script, which works well and automatically forks a new PHP process
for each call/leg. If one of theses processes dies because of some
problems, all other calls are not affected. I have some problems to
thing the other way round and switch to event socket inbound.
Therefore I would prefer to keep the current PHP script.

2.) I have NO dialplan or something like this! I want to tell fs what
to over my PHP scripts.

3.) I want fs to come and tell my PHP script, if there are new events.
After that, my PHP script tells fs what to do. Then fs tells me, that
it has done what it should, I tell, what to do next.

Here is a detailed example:

1.) fs is connected to my PHP socket-script (not the other way round).

2.) The PHP socket-script registers to "myevents" and "event SESSION_HEARTBEAT".

3.) fs comes with an event and tells, that someone is calling/ringing.
The PHP socket-script forks a new PHP process (p #1), which handles this call.
Then I tell fs to answer (sendmsg answer) and to play a soundfile for
the caller (call_direction inbound).

sendmsg
call-command: execute
execute-app-name: playback
execute-app-arg: /var/www/freeswitch/hello.wav

4.) The caller knows, that if he presses the 1 digit, he will be
connected to a target.

5.) fs tells me, that the call_direction inbound pressed the 1
(event_name:DTMF, dtmf_digit:1).

6.) I tell fs to originate to a target. I do not want to bridge! I
want to control everything for different reasons.

api originate {origination_caller_id_number=1234567,inbound_uuid=".$event['Unique-ID']."}sofia/internal/1001@192.168.1.5 (1001@192.168.1.5)
123

I pass the uuid of the call_direction inbound/caller to the
call_direction outbound/target, so that the call_direction outbound
knows the uuid of the call_direction inbound (to hopefully send
messages to the process of the call_direction inbound).


7.) The target ansers the call, but the call_direction inbound and the
call_direction outbound are not connected (which is good)
The PHP socket-scripts forks a new PHP process (p #2), which handles
the call_direction outbound/target.

Now I have two calls and two PHP processes.

Now the problems are coming up....

I want thecall_direction outbound to be able to press a digit and to
start a playback for the call_direction inbound/caller.
Because I passed the uuid of the call_direction inbound to the
call_direction outbound, the call_direction outbound knows the uuid
and could use this uuid to send a message to it.

But I can not use sendmsg uuid to do that.
I would like to send from p #2 (call_direction outbound)...

sendmsg 1dca106c-a10c-11dd-b986-d5cdf6924ae6 (which is the uuid of the
call_direction inbound in p #1)
call-command: execute
execute-app-name: playback
execute-app-arg: /var/www/freeswitch/again_hello.wav

... so that the call_direction inbound (in p #1) can hear the again_hello.wav.

Instead, the uuid is ignored and the file is playback for the
call_direction outbound (in p #2). The call with the uuid
1dca106c-a10c-11dd-b986-d5cdf6924ae6 will not hear anything.


I hope this example was a little bit better to understand than my
other examples.



Quote:
I'll tell you what, i'll lift that restriction in latest trunk and you tell
me if it breaks anything or if it makes your life
easier since it's not really doing much but protecting you from yourself. So
with latest code you can use your one socket
to send messages to the other leg too.


That sounds interesting, at least to find out, where my problems are.
I just donwloaded the latest trunk, but the szenario described above
stays the same.

If I send...

sendmsg 1dca106c-a10c-11dd-b986-d5cdf6924ae6 (which is the uuid of the
caller/inbound in p #1)
call-command: execute
execute-app-name: playback
execute-app-arg: /var/www/freeswitch/again_hello.wav

...the file will still be played back for the target/outbound.


Thanks again for your patience
Dennis


_______________________________________________
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/

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
odermann at googlemail...
Guest





PostPosted: Thu Oct 23, 2008 11:15 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

2008/10/23 Anthony Minessale <anthony.minessale@gmail.com>:
Quote:
What does 123 lead to? launching another script?

The 123 is the destination_number in the "/dialplan/default.xml".

<extension name="test">
<condition field="destination_number" expression="^123$">
<action application="set" data="hangup_after_bridge=false"/>
<action application="set" data="enable_heartbeat_events=10"/>
<action application="socket" data="192.168.1.5:8022 async full"/>
</condition>
</extension>



Quote:
you could make the 2nd originate lead to &park() in place of 123

I tried that... The target of the originate rings, but as soon one
answers the call, nothing else happens. No events, nothing...



Quote:
and you could control both legs from the same socket.

How? What do you mean?
Do you now have an idea what I am trying to do, after I described the
whole thing?


Quote:
please please join irc and let the whole group help you.
I was there today, but it seemed, that nobody could hear/read me. I
will try again tomorrow.

_______________________________________________
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
mcollins at fcnetwork.com
Guest





PostPosted: Thu Oct 23, 2008 1:39 pm    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

Quote:
Quote:
please please join irc and let the whole group help you.
I was there today, but it seemed, that nobody could hear/read me. I
will try again tomorrow.

What is your IRC nick? Mine is mercutioviz. I'm interested in this issue
because I've been dialing in some somewhat similar scenarios and I might
be able to help, at least a little bit.

-MC

_______________________________________________
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
odermann at googlemail...
Guest





PostPosted: Fri Oct 24, 2008 6:20 am    Post subject: [Freeswitch-users] Socket inbound or outbound with PHP? Reply with quote

2008/10/23 Michael Collins <mcollins@fcnetwork.com>:
Quote:
What is your IRC nick? Mine is mercutioviz. I'm interested in this issue
because I've been dialing in some somewhat similar scenarios and I might
be able to help, at least a little bit.

My nick is Dennis93. Looking forward to it.

_______________________________________________
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
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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