[Freeswitch-users] Originating Calls, without knowing the endpoint URL?
Brian West
brian at freeswitch.org
Tue Sep 2 13:46:14 PDT 2008
On Sep 2, 2008, at 3:20 PM, Brian Wood wrote:
> I'm experimenting with FreeSWITCH. I have a setup working with FXO,
> FXS,
> and SIP (to hardware and software phones, and gateways). I'd like to
> be
> able to place a new outgoing call and then do something, for example,
> play a message notifying me that the power has gone out.
>
> I have been successful doing this through the event socket, XML-RPC,
> JavaScript, etc. However, I have to know the full endpoint URL. I've
> searched the list, wiki, web for examples. I've seen several
> attempts at
> an example, but no clear and complete example.
>
> What I'd really like to be able to do is something like (JavaScript
> example):
>
> var s = new Session();
> s.originate(session, "1234567890");
> s.streamFile("test.wav");
>
> Instead of:
>
> var s = new Session();
> s.originate(session, "sofia/internal/1000");
> s.streamFile("test.wav");
>
> I would like to be able to originate a new session, and have
> FreeSWITCH
> lookup the endpoint. Transfer and bridge don't seem quite right, and
> exceute_extension seems to block (and require a existing session).
> I've
> looked at Session.Originate, but I can't seem to get it to do anything
> useful.
Well the only thing you can use is the user channel to resolve the
target endpoint. Look at the dial-string in the directory/default.xml
and you can use that on a per domain or per user...
Example you can have user/mycell at domain.com which resolves to openzap/
1/19185551212 but you don't know that its just user/mycell at domain.com
Brian West
sip:brian at freeswitch.org
More information about the FreeSWITCH-users
mailing list