[RELEASE] XBMC PBX Addon - Home Telephony Experience using Asterisk

  Thread Rating:
  • 3 Votes - 4.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
hmr Offline
Member
Posts: 83
Joined: Jun 2006
Reputation: 0
Location: Argentina
Post: #16
I've just uploaded a new version including those messages.

If CDR file and/or Voice Mail directory are not found, an error message will be shown in the XML output, which should help you on troubleshooting.

Best regards,
Hernan.-
find quote
hmr Offline
Member
Posts: 83
Joined: Jun 2006
Reputation: 0
Location: Argentina
Post: #17
New version available, including these changes:

* Updated py-asterisk library
* Added VoiceMail Context configuration
* Added NewChannel State configuration
* Added VoiceMail count notification on script startup
* Added ability to Redirect phone calls if playing video

The most notable change is the ability to Redirect (Transfer) incoming phone calls, which is in its early stage, but you can already achieve this:

You are watching your favorite movie and do not want to receive phone calls until finishes (let's say 45 minutes remaining time).
Your friend calls you and listen a message: "Hey, I'm watching this great movie, please call me back in 45 minutes".
Yes, you are that cool Smile

As usual, please provide feedback and any help (specially on skinning) will be appreciated.

Best regards!
Hernan.-
find quote
hmr Offline
Member
Posts: 83
Joined: Jun 2006
Reputation: 0
Location: Argentina
Post: #18
Uploaded new version, xbox compatible.

See changelog on first post.

Hernan.-
find quote
thatjoshguy Offline
Junior Member
Posts: 22
Joined: Mar 2010
Reputation: 0
Post: #19
this is a pretty cool idea, i may have to test it out being an Asterisk user myself. Very cool implementation!
find quote
hmr Offline
Member
Posts: 83
Joined: Jun 2006
Reputation: 0
Location: Argentina
Post: #20
Thanks thatjoshguy!, please share your feedback once you have tested it Smile

Is there any experienced skinner or python developer can help us fix this bug?

First time the script is opened, the WindowXML skin is not localized and therefore labels are shown empty. This is solved by opening script settings, and re-opening the script again. After this, all labels are properly displayed (and localized).

I've been taking a look into other scripts and I wasn't able to figure out what's wrong on mine.

Any help would be really appreciated!

Thank you!
Hernan.-
find quote
hmr Offline
Member
Posts: 83
Joined: Jun 2006
Reputation: 0
Location: Argentina
Post: #21
anyone? any suggestion?
find quote
keylogthis Offline
Junior Member
Posts: 11
Joined: Jun 2010
Reputation: 0
Post: #22
I really like this script. I have everything working except for VM and I was hoping that you could help me out with it. The VM shows up but when I try to play it it doesn't do anything after I click on Yes to play.

Here is the log:

Code:
21:31:26 M: 31297536  NOTICE: -->Python Initialized<--
21:33:03 M: 30642176  NOTICE: -->Python Initialized<--
21:33:04 M: 30117888  NOTICE: XBMC PBX Addon Version: 0.0.4
21:33:07 M: 27115520  NOTICE: [XBMC PBX Addon]: XBMC_HOME=special://home
21:33:07 M: 27115520  NOTICE: [XBMC PBX Addon]: Launching GUI...
21:33:07 M: 27115520  NOTICE: [XBMC PBX Addon]: __init__()
21:33:07 M: 30060544  NOTICE: [XBMC PBX Addon]: > onInit()
21:33:08 M: 30027776  NOTICE: [XBMC PBX Addon]: > getInfo()
21:33:08 M: 29958144   ERROR: LoadLibrary('NETAPI32.DLL') failed
21:33:08 M: 29958144 WARNING: Unable to resolve: user32.dll GetForegroundWindow
21:33:08 M: 29958144 WARNING: Unable to resolve: user32.dll GetCursorInfo
21:33:08 M: 29958144 WARNING: Unable to resolve: user32.dll GetQueueStatus
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll CreateToolhelp32Snapshot
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll CloseToolhelp32Snapshot
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll Heap32First
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll Heap32Next
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll Heap32ListFirst
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll Heap32ListNext
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll Process32First
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll Process32Next
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll Thread32First
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll Thread32Next
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll Module32First
21:33:08 M: 29958144 WARNING: Unable to resolve: kernel32.dll Module32Next
21:33:10 M: 30146560  NOTICE: [XBMC PBX Addon]: > showInfo()
21:33:10 M: 30081024  NOTICE: [XBMC PBX Addon]: >> Done.
21:33:21 M: 30281728  NOTICE: [XBMC PBX Addon]: > play_voice_mail()
21:33:22 M: 30257152  NOTICE: CMPlayer::CloseFile()
21:33:22 M: 29712384  NOTICE: CMPlayer::CloseFile()
[color=Red][b]21:33:23 M: 23199744   ERROR: CMPlayer::OpenFile http://192.168.1.223/xbmc-pbx-addon.php?recindex=0000&mailbox=200&vmcontext=default&format=wav failed with code 0[/b][/color]
21:33:23 M: 23199744  NOTICE: CMPlayer::CloseFile()
21:33:23 M: 23724032  NOTICE: CMPlayer::CloseFile()

I am able to put the URL http://192.168.1.223/xbmc-pbx-addon.php?...format=wav into a browser and it will download the wav file and I can listen to it. Let me know if there is anything that I can do to try and fix it or troubleshoot it. Thank you.
(This post was last modified: 2010-06-12 05:44 by keylogthis.)
find quote
hmr Offline
Member
Posts: 83
Joined: Jun 2006
Reputation: 0
Location: Argentina
Post: #23
keylogthis, glad to see you find this script useful!

Please verify your Asterisk Voicemail configuration (server side) and make sure you have format=wav and not format=wav49.

Besides that, I don't have a Windows setup at this moment to test it (I guess you are using XBMC for Windows) but I would recommend you testing the new script version 0.0.5 I've just uploaded.

BTW, have you tested all features (including call redirection)? Would like to hear your feedback.

Thanks!!
Hernan.-
find quote
keylogthis Offline
Junior Member
Posts: 11
Joined: Jun 2010
Reputation: 0
Post: #24
Thanks hernan. I'm running it on the xbox.

I checked my voicemail.conf and it didn't have anything set for format so I put in format=wav and now everything is working. I didn't test the redirection because I would not use this feature, but I'm curious what is the alert_info setting?
find quote
hmr Offline
Member
Posts: 83
Joined: Jun 2006
Reputation: 0
Location: Argentina
Post: #25
Good to see VM playback is working for you now Smile

ALERT_INFO is used for distinctive ring on SIP channels. See here: http://www.voip-info.org/wiki/view/Aster...P+channels

Given alert_info is some sort of variable which you can easily change its value from FreePBX (and I assume other GUIs as well) for different inbound routes, I'm taking advantage of it to control whether XBMC should redirect a call or not.

Please let me know if there is anything you would like to have added/removed/changed on this script and any other feedback.

Best regards!
Hernán.-
find quote
keylogthis Offline
Junior Member
Posts: 11
Joined: Jun 2010
Reputation: 0
Post: #26
Actually, I spoke too soon. I don't have the CID notification working. It was working but only because I had it setup this way. Now since I have removed that method for CID notification I no longer have the pop-up.

I do have the autoexec.py in Q:\scripts so it should be running in the background as soon as XBMC starts but for some reason when the call comes in nothing happens.

Call Logs are working.
Voicemail is working.

...but notification doesn't work unless I follow the directions in the above link and create an extension with the commands from the article and set my inbound destination to it. So if you can help me out again I would be very grateful because I would like to use your script for everything instead of do it this way.

Oh, and I have the settings for your script:
Initiate upon NewChannel State: Ring
Show CID Notification: Yes
CID Notification Timeout: 15


EDIT, found a little more out:

I changed autoexec.py to:
Code:
# Put this file into Q:\scripts folder to be executed when XBMC starts.
import os
import xbmc

xbmc.executescript('Q:\\scripts\\xbmc-pbx-addon\\bgservice.py')

And now I get the VM Inbox notification on start-up which was not working before I made this change. So the path is not set correctly in autoexec.py to start the bgservice.py in your script at the moment.

CID notification now partially works but it gives an error message instead of showing name/number. It gives this message: "Error: ChannelStateDesc"

I have tried to change the settings from both Ring and Down but it does the same thing. Any info on this problem? Thanks.

Here is logfile:
Code:
18:27:53 M: 37720064  NOTICE: XBMC PBX Addon Version: 0.0.5
18:27:56 M: 32342016  NOTICE: [XBMC PBX Addon]: Running in background...
18:27:56 M: 32350208  NOTICE: [XBMC PBX Addon]: >> Asterisk 1.4.24 built by root @ centos5-rpmbuilder.palosanto.com on a i686 running Linux on 2015-03-12 18:14:36 UTC
18:27:56 M: 32342016  NOTICE: [XBMC PBX Addon]: >> New messages: 0
18:27:56 M: 32342016  NOTICE: [XBMC PBX Addon]: __init__()
[color=Red]18:28:09 M: 29974528  NOTICE: [XBMC PBX Addon]: >> 'ChannelStateDesc'[/color]
18:28:53 M: 34107392  NOTICE: -->Python Initialized<--
(This post was last modified: 2010-06-15 01:33 by keylogthis.)
find quote
hmr Offline
Member
Posts: 83
Joined: Jun 2006
Reputation: 0
Location: Argentina
Post: #27
Thanks for your report!

Regarding autoexec.py, you are right, that path is for XBMC for Linux.
I should find a way to detect the platform and automatically change paths accordingly.

In regards to the CID notification issue, I've been testing this script with Asterisk 1.6 and it seems events have changed a little after 1.4, causing that error.

I've just uploaded an updated bgservice.py file including support for Asterisk 1.4. Download it from here: http://code.google.com/p/xbmc-pbx-addon/...svn37&r=37

Please give it a try and let me know your results Smile

Good luck!
Hernan.-
find quote
keylogthis Offline
Junior Member
Posts: 11
Joined: Jun 2010
Reputation: 0
Post: #28
Tried the new bgservice.py but it didn't do anything.

The VM Notification on start-up still works but when I make a call nothing happens... not even the error message that I was getting before and there is nothing in the log.

Code:
01:02:26 M: 32563200  NOTICE: [XBMC PBX Addon]: Running in background...
01:02:26 M: 32272384  NOTICE: [XBMC PBX Addon]: >> Asterisk 1.4.24 built by root @ centos5-rpmbuilder.palosanto.com on a i686 running Linux on 2015-03-12 18:14:36 UTC
01:02:26 M: 32268288  NOTICE: [XBMC PBX Addon]: >> New messages: 0
01:02:26 M: 32296960  NOTICE: [XBMC PBX Addon]: __init__()

I made the calls at about 01:05 but it didn't register with the script.


Quote:I should find a way to detect the platform and automatically change paths accordingly.
Yeah, otherwise I would probably just make a comment or direction for people to edit that path. Easier on you, but it depends on how fancy you want to get, lol. Thanks for the great support.
(This post was last modified: 2010-06-15 08:32 by keylogthis.)
find quote
hmr Offline
Member
Posts: 83
Joined: Jun 2006
Reputation: 0
Location: Argentina
Post: #29
Good, that's some progressSmile

I don't have an Asterisk 1.4 to test it at this moment.
Could you please remove all comments from log lines (You must change every occurrence of #log with log) and then copy the logfile so we can troubleshoot it?

Thank you!!
Hernán.-
find quote
keylogthis Offline
Junior Member
Posts: 11
Joined: Jun 2010
Reputation: 0
Post: #30
Here is the log file with all the log options enabled:

Code:
11:30:52 M: 38215680  NOTICE: XBMC PBX Addon Version: 0.0.6
11:30:54 M: 32362496  NOTICE: [XBMC PBX Addon]: Running in background...
11:30:58 M: 22618112  NOTICE: [XBMC PBX Addon]: >> Asterisk 1.4.24 built by root @ centos5-rpmbuilder.palosanto.com on a i686 running Linux on 2015-03-12 18:14:36 UTC
11:30:59 M: 22609920  NOTICE: [XBMC PBX Addon]: >> New messages: 0
11:30:59 M: 22597632  NOTICE: [XBMC PBX Addon]: __init__()
11:30:59 M: 22597632  NOTICE: [XBMC PBX Addon]: >> 1.4
11:31:34 M: 31535104  NOTICE: [XBMC PBX Addon]: > NewChannel()
11:31:34 M: 31535104  NOTICE: [XBMC PBX Addon]: >> 1276619494.51
11:31:34 M: 31535104  NOTICE: [XBMC PBX Addon]: >> Down
11:31:34 M: 31535104  NOTICE: [XBMC PBX Addon]: >> 1276619494.51
11:31:34 M: 31535104  NOTICE: [XBMC PBX Addon]: >> Down
11:31:35 M: 31535104  NOTICE: [XBMC PBX Addon]: > NewChannel()
11:31:35 M: 31535104  NOTICE: [XBMC PBX Addon]: >> 1276619495.52
11:31:35 M: 31535104  NOTICE: [XBMC PBX Addon]: >> Down
11:31:35 M: 31535104  NOTICE: [XBMC PBX Addon]: > Hangup()
11:31:35 M: 31535104  NOTICE: [XBMC PBX Addon]: >> 1276619495.52
11:31:39 M: 31535104  NOTICE: [XBMC PBX Addon]: > Hangup()
11:31:39 M: 31535104  NOTICE: [XBMC PBX Addon]: >> 1276619494.51
11:31:39 M: 31535104  NOTICE: [XBMC PBX Addon]: > hangup_actions()

It was set to ring but I tried down because that was showing in the log but still nothing.
(This post was last modified: 2010-06-15 18:37 by keylogthis.)
find quote
Post Reply