Scenario:
User (XP OS, running office 2003) - IP = 1xx.x.x.101
phone system (linux OS, running 'trixbox') - IP = 1xx.x.x.222
phones (aastra 55i IP phones) - IP = 1xx.x.x.201
I want to be able to click a button on the customer record on our database on their computer, and have that customers number sent to the phone, so picking up the phone dials the number.
Still with me?
M'kay.
I have a php file that does what I want, IF I hard code the number and phones IP address into it. Obviously useless in the context I want it. (See bottom of post for code)
I know it's possible to send the info as a hyperlink such as http://1xx.x.x.222/callfromdb.php?number=01234567890&ipadd=1xx.x.x.20 1
(I think that's where I'd have to send it anyway. That's the link I have hard-coded into the phone (before the ?) which worked, but now for some reason doesn't.
This sounds like the most plausible method (from my extremely limited knowledge), so could someone help me modify the code for this method please?
I know about POST and GET, but the tutorials are confusing the heck outta me, and I think I've fried my brain.
callfromdb.php
Expand|Select|Wrap|Line Numbers
- <?php
- #
- function push2phone($server,$phone,$data)
- {
- $xml = "xml=".$data;
- $post = "POST / HTTP/1.1\r\n";
- $post .= "Host: $phone\r\n";
- $post .= "Referer: $server\r\n";
- $post .= "Connection: Keep-Alive\r\n";
- $post .= "Content-Type: text/xml\r\n";
- $post .= "Content-Length: ".strlen($xml)."\r\n\r\n";
- $fp = @fsockopen ( $phone, 80, $errno, $errstr, 5);
- if($fp)
- {
- fputs($fp, $post.$xml);
- flush();
- fclose($fp);
- }
- }
- ##############################
- $xml = "<AastraIPPhoneTextMenu>\n";
- $xml .= "<Title>Call Customer</Title>\n";
- $xml .= "<MenuItem>\n";
- $xml .= "<Prompt>Call Customer</Prompt>\n";
- $xml .= "<URI>Dial:01234567890</URI>\n";
- $xml .= "</MenuItem>\n";
- $xml .= "</AastraIPPhoneTextMenu>\n";
- push2phone("1xx.x.x.222","1xx.x.x.201" ,$xml);
- ?>
Expand|Select|Wrap|Line Numbers
- $_REQUEST['number']
If you follow this and understand it, you're a genius and I thank you.
If you need clarification on something, please ask and I'll try my hardest not to make it worse.
Thank you all in advance for any help you can give.