Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3199 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

Hello All,

I have a script that passes a url to an IP/PBX (Sipxcom) which will then ring the user and once the user picks up the phone, will place the call to a phone number the user clicked from the FMP CRM.  Its pretty slick.  My only issue is that I cannot get httpost or httpspost to work.    I can get the script to work correctly with Troi URL plugin from both client and run on FMPA Server.  

Here is the syntax for the Troi  plugin (which works):  TURL_POST("";"http://mydomain:6667/callcontroller/"&$userextension&"/"&$dialednumber&"?"&$userpw)

Here is what the Wiki say from Sipxcom http://wiki.sipxcom.org/display/sipXcom/Configuration+RESTful+Service:  

Sample php Click to Call Code:

<?php
    $to="101";        //Number to dial
    $from="5001"; //userid in sipx
    $pass="1234"; //sipx pin (NOT SIP password)
     
    //replace sipx.gcgov.local with your sipx server
    $url = "http://sipx.gcgov.local:6667/callcontroller/".$from."/".$to."?isForwardingAllowed=true";    //This is the line I based my synax from.
    $ch = curl_init();    
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_USERPWD, $from.":".$pass);
    $result = curl_exec($ch); 
    curl_close($ch); 
?>
I would love to be able to just use httppost so my users could perform the script on their local machine and not have to use Troi URL

Any help is much appreciated!

Jim Gill

Edited by Jim Gill
Formatting still bad
Posted

Where does the HTTP authentication happen with the Troi plugin? Or does it? In the php example, it looks like that is required.

Posted

Hello Mike - 

From the SipXcom Wiki  http://wiki.sipxcom.org/display/sipXcom/Call+Control+Web+Service:  

Services

If you are issuing the curl command  from a trusted host ( i.e. one where sipx proxy is running) please use only HTTPS (no authentication is required).
From a non-trusted host you must authenticate the curl command with Digest authentication.

There are some examples with notes in the source directory. Download the source code from svn and take a look at the scripts in sipXcallController/test

6666 is the HTTPS port.
6667 is the HTTP port.

You can use either HTTPS or HTTP when issuing the curl command from a non-trusted host.

Since version 4.6 you should use the redirector in sipxconfig as using port 6666 seems deprecated. The REST interface can be reached (using digest authentication) on http(s)://<host>/sipxconfig/rest/my/redirect/callcontroller etc.

 

Also I have now managed to get httppost to work but NOT how the wiki at Sipxcom direct the URL to be written.   I'm starting to think it may be more of a Sipxcom issue than FMP.  Here is the syntax that works for my Click to Call script:  

"httppost://mydomain.com:6667/callcontroller/"&click_to_call|Selfjoin::User_Ext&"/"&$$DialedNumber&"?"&click_to_call|Selfjoin::User_Password

 

Thanks for any advice or leads you can give me.  

Also the progression of my post at Sipxcom forum can be found here:  

https://groups.google.com/forum/#!searchin/sipxcom-users/click$20to$20call/sipxcom-users/hPB6b2LnnIk/2dDQ4UqUIDkJ

Jim

 

Posted

Update:  Mike your question was the key to the correct answer:

On 2/13/2016 at 8:17 AM, Mike Duncan said:

Where does the HTTP authentication happen with the Troi plugin? Or does it? In the php example, it looks like that is required.

I was able to get Insert from URL function to work using httpspost. - No plugin!  Here is what is looks like:

Insert from URL [No dialog; 

"httpspost://"&click_to_call|Selfjoin::User_Ext&":"&click_to_call|Selfjoin::User_Password&"@sipx.mydomain.com/sipxconfig/rest/my/redirect/callcontroller/"&click_to_call|Selfjoin::User_Ext&"/"&$$DialedNumber&"?"&click_to_call|Selfjoin::User_Ext&":"&click_to_call|Selfjoin::User_Password]

Note that once I included the auth (click_to_call|Selfjoin::User_Ext&":"&click_to_call|Selfjoin::User_Password&"@) this made everything work - both from client and server.   

Thank you!

Jim

This topic is 3199 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.