Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

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

  • Author

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

 

  • Author

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.