Ian Service wrote:
Hey Guys,
I set up something similar for a customer of mine and it's really
building Asterisk support from my client's employees, but I let
Asterisk handle it. When you click on the "call" button next to their
phone number in their intranet, it connects to the manager and issues
the following:
Action: Originate
Channel: SIP/$_REQUEST["myexten"]
Exten: $_REQUEST["tendigitnumber"]
Priority: 1
Callerid: Dialer <www.thewebsite.com <http://www.thewebsite.com>>
Variable: CDR(accountcode)=$_REQUEST["accountcode"]
The user's phone rings, if they don't answer the call doesn't go
through. Once they do answer, it connects their call just as if their
phone dialed it. It uses their default dialling context from sip.conf
or Realtime to send out the call.
I used PHP to build the script to connect to manager, since I built it
on their time I can't share it, but there's another approach for you.
Telnet to the manager and give it a go.
No problem on not sharing it. My script does basically the same, save
that the context it connects them to plays a "connecting" message.
Eventually I'm planning to allow for canceling the call as well. It now
works fine with SIP-to-SIP calls, but I'm still working on getting the
PSTN gateway machine to allow the calls through. Pyst is actually doing
the equivalent of a telnet to the manager, incidentally, it's just
wrapped with code to parse the messages, deal with events, that kind of
thing.
Interestingly, a simple command-line shell script on any SER platform
will allow you to generate SIP REFER messages that produce the same
basic effect, save that Asterisk isn't in the middle of the call (for
better or worse). It's the examples/ctd.sh script in your SER source
package. I will have to do some hacking to get the referrer to be a
trusted individual (i.e. requires a login that the script doesn't do),
but it works just as well as the Asterisk script out of the box (i.e.
works fine for SIP-to-SIP calls).
Have fun all,
Mike
--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com