Feature #225

Provide data source(s) to feed number and caller ID to outside devices / programs

Added by tshif over 2 years ago. Updated over 2 years ago.

Status:Closed Start:11/01/2009
Priority:High Due date:11/03/2009
Assigned to:- % Done:

100%

Category:-
Target version:Caller ID Superfecta Source Files

Description

Provide a function in Superfecta Module that will allow it to send both Caller ID Name AND Number to a third party process or device.

Provde way for Superfecta Module (via data sources) send both Caller ID Name AND Number to a variety of third party process or devices.

The goal is to provide a way to send both name and number to a scrolling LED sign, or a program such as XBMC.

This ticket may include several such sources.

The approach used could be very similar to the approach used for the CID Prefil URL function - with the importnt exception that it should be applied at the CID SCHEME level, and not globally.

source-Send_to_URL.php (1.3 KB) tshif, 11/01/2009 01:15 pm

source-Send_to_XBMC.php - beta 1 (1.5 KB) tshif, 11/03/2009 10:14 am

History

Updated by patrick_elx over 2 years ago

Easy to do. Try source_send_to_URL in rev 216

Updated by patrick_elx over 2 years ago

  • % Done changed from 0 to 40

Updated by tshif over 2 years ago

  • Status changed from New to Reviewed
  • Target version changed from Caller ID Superfecta - Future Versions to Caller ID Superfecta Source Files

Oh Man that is COOL.

Updated by tshif over 2 years ago

Patrick, we need a example use syntax -

Updated by tshif over 2 years ago

Ok check r219 I took a stab at the syntax example.

Updated by tshif over 2 years ago

  • File source-Send_to_URL.php added

Updated by patrick_elx over 2 years ago

put the source as the last one.
enter the url/file.php you want to call.
click debug and you will see the syntax:
url/file.php?thenumber=123465&CLID=theclid

Updated by tshif over 2 years ago

Updated by tshif over 2 years ago

  • File deleted (source-Send_to_URL.php)

Updated by tshif over 2 years ago

[rockinthesixstring]

Ok, so I put this in the URL field but it only took a short bit of the string http://192.168.0.115:2345/xbmcCmds/xbmcHttp?command=ExecBuiltIn is supposed to be http://192.168.0.115:2345/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.Notification%28Incoming%20Call%2C&thenumber

Patrick - where is the char limit imposed? I dont see it in the data source.

Updated by tshif over 2 years ago

  • Status changed from Reviewed to Assigned

Updated by tshif over 2 years ago

Since I dont see any character limits, Im guessing we have an escapment problem with the ampersand character, and most likely all the rest.

Patrick - can we pass the URL_Adress parameter through a php escapement command?

Updated by patrick_elx over 2 years ago

the clid is sanitized before being sent to the url.

We can do an htmlentities encode to change space and other characters with a &#

However, in this case it seems more an SQL database problem as the line entered in the option was not stored properly.

Also, this specific syntax will probably not work either as it seems that this url does require not a ?thenumber&clid at the end.

To provide a fit all module will be tough as each module is different.
However it should be easy to modify a module for a specific application.

We just need to have the required parameters, and we can create a custom made send_to_xbmc.

Updated by tshif over 2 years ago

We probably should be sanitizing before we save user entered parameters to the data base. This may be thie first time we run itno this problem, but doubtful the last.

Thoughts?

Updated by tshif over 2 years ago

[rockinthesixstring]

XBMC has pretty basic requirements. All you have to do is send a string

http://192.168.0.115:2345/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.Notification(This%20Is%20Line%20One%2CThis%20is%20line%20two)

Updated by tshif over 2 years ago

  • File source-Send_to_XBMC.php added

PLease give this a try

Updated by tshif over 2 years ago

  • File source-Send_to_XBMC.php added

Updated by tshif over 2 years ago

  • Subject changed from Provide hooks in module to feed number and caller ID to outside device / program to Provide data source(s) to feed number and caller ID to outside devices / programs

Updated by tshif over 2 years ago

Im pretty sure we need some variant of `addslashes ( string $str )` in the current alpha to get it to work right.

Updated by tshif over 2 years ago

[rockinthesixstring]

If I run my number through the debug, I get this output

Send to XBMC: http://192.168.0.115:2345/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.Notification(4039754852%2cChase Florell (Mobile))

then if I enter this portion into the querystring, I get my popup on the Media Player.

http://192.168.0.115:2345/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.Notification(4039754852%2cChase Florell (Mobile))

However, the debug test AND a live phone call do NOT popup the info.

Updated by tshif over 2 years ago

Updated by tshif over 2 years ago

  • File source-Send_to_XBMC.php added

Updated by tshif over 2 years ago

Alpha v3 I think needs some escapement for the ampersand character.

Updated by tshif over 2 years ago

  • File deleted (source-Send_to_XBMC.php)

Updated by tshif over 2 years ago

  • File source-Send_to_XBMC.php added

Updated by tshif over 2 years ago

  • File source-Send_to_XBMC.php added

Updated by tshif over 2 years ago

  • File deleted (source-Send_to_XBMC.php)

Updated by tshif over 2 years ago

  • File deleted (source-Send_to_XBMC.php)

Updated by tshif over 2 years ago

  • File deleted (source-Send_to_XBMC.php)

Updated by patrick_elx over 2 years ago

try rev 223.

Also try to it with uncommenting the urlencode line.

Updated by tshif over 2 years ago

With the current SVN build I get this in debug, and no pop up on the media player:

Send to XBMC: http://federationrnd:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn¶meter=XBMC.Notification(7601234567,Sams Jade Factory)

Note the paragraph symbol in the middle.

With the encode line unremarked I get this in debug:

Couldn't resolve host 'http%3A%2F%2Ffederationrnd%3A8080%2FxbmcCmds%2FxbmcHttp%3Fcommand%3DExecBuiltIn%26parameter%3DXBMC.Notification%287601234567%2CSam+Jade+Factory%29'

Updated by tshif over 2 years ago

r223 w/out the encode url is very close.

When I cut ans paste the debug version, and fix only the part thats messed up (The ampersand and the start of the word parameter, it works as expected. The ampersand needs to be escaped somehow.

http://federationrnd:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.Notification(7601234567,Sames Jade Factory)

The ampersand needs to be escaped somehow.

Updated by tshif over 2 years ago

  • File source-Send_to_XBMC.php added

Updated by tshif over 2 years ago

Ok - this actually looks perfect in debug:

$url=$run_param['URL_address'].'/xbmcCmds/xbmcHttp?command=ExecBuiltIn&#38parameter=XBMC.Notification('.$thenumber.','.$first_caller_id.')';

But it does NOT create the desire results in XBMC. If you cut and paste the debug results into a browser - it DOES make XBMC do what is expected.

Updated by patrick_elx over 2 years ago

could you try rev 225

all the static part of the url is using standard characters that should not create problems. I've tried just to urlencode the CLID part (to encode the space, etc...).

Try also by uncommenting the $url line.

Updated by tshif over 2 years ago

Success!

r225 works as expected.
Requestor also asks that we format the CID number in a pretty way.
(xxx)xxx-xxxx

Updated by tshif over 2 years ago

  • File deleted (source-Send_to_XBMC.php)

Updated by tshif over 2 years ago

  • File deleted (source-Send_to_XBMC.php)

Updated by tshif over 2 years ago

Updated by tshif over 2 years ago

  • % Done changed from 40 to 60

I see a potential problem when trying to format the cid number for astehtics.

The requestor asked for (xxx) xxx-xxxx, but thats ionly good for north american style numbers.

Can we provide a pretty-fication process that will be smart enough to format worldwide numbers in a meaningful way? It wont do to try and force all numbers into the USA style display -

Updated by tshif over 2 years ago

This destination (XBMC) may be secured with a login id/password. If it is, then this datasource will fail.

I have asked the requestor to provide syntax examples for the url thatinclude authentcation. If we get this info - I suggest we add configuration items to support it.

Updated by patrick_elx over 2 years ago

see rev 227
formatting option

Updated by tshif over 2 years ago

Brilliant. Formatting option works perfectly.

Updated by tshif over 2 years ago

The debug display for this data source is pretty messed up looking. Can that be addressed without breaking the source?

Updated by patrick_elx over 2 years ago

the debug shows exactly the http string that will be sent. That was useful for our debug.
If you want to declutter, we can change the debug by just writing: called server FQDN/IP:port and without anything else.

Updated by patrick_elx over 2 years ago

try rev 229.

Updated by tshif over 2 years ago

  • Due date set to 11/03/2009
  • Status changed from Assigned to Resolved
  • % Done changed from 60 to 100

This case is CLOSED to further comment. XBMC now has stand alone tickets, like any other source.

Updated by tshif over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF