View previous topic :: View next topic |
Author |
Message |
cohomology MagicJack Newbie
Joined: 21 May 2009 Posts: 6
|
Posted: Mon Aug 03, 2009 9:39 pm Post subject: Anyone using MJ with own Asterisk server? |
|
|
I'm trying to configure MJ to work with my own asterisk server(PBX in a flash) in order to have more features, like caller id lookup, blocking, etc. .
I wouldn't believe it's as easy as extracting the sip credentials and using that as a trunk. There must be sth. like MJMD5 to work in between the PBX and the trunk, IMHO. Has anyone tried this? Did you have luck?
TIA! |
|
Back to top |
|
 |
RonV magicJack Apprentice
Joined: 08 Dec 2008 Posts: 14
|
|
Back to top |
|
 |
jaybob413 MagicJack Newbie
Joined: 23 Mar 2009 Posts: 6
|
Posted: Tue Aug 04, 2009 11:04 pm Post subject: |
|
|
I am currently running PIAF with MagicJack. You will need the mjproxy daemon running somewhere to do the nonce twirling.
Replace NXXNXXXXXX in the example below with your 10 digit phone number, MJ20CHARACTERPASSWD with your password, and MJPROXYIP with the IP address of the server running mjproxy. This might be your Asterisk box or an OpenWRT or DD-WRT router (I have had it working with both).
The remaining steps are:
1) Using FreePBX, Set up a trunk for your MJ.
Trunk Name: MagicJack
PEER Details:
username=ENXXNXXXXXX01
type=friend
secret=MJ20CHARACTERPASSWRD
qualify=2000
port=5070
nat=yes
insecure=very
host=MJPROXYIP
fromuser=ENXXNXXXXXX01
dtmfmode=inband
context=from-trunk
Register String
ENXXNXXXXXX01:[email protected]:5070/NXXNXXXXXX
2) Create an Outbound Route to call out on. I set my Dial Pattern so dialing 8 uses MagicJack, 9 uses GV, etc. Pick whatever you want here.
Outbound Route
Dial Patterns
8|.
Trunk Sequence
SIP/MagicJack
3) Configure Inbound Routing
Inbound Route
DID Number: NXXNXXXXXX
Hope this helps. |
|
Back to top |
|
 |
cohomology MagicJack Newbie
Joined: 21 May 2009 Posts: 6
|
Posted: Wed Aug 05, 2009 3:45 pm Post subject: |
|
|
Thank you jaybob413 for the instruction.
Seems your solution needs MJMD5 to run on a router. What if the PBX box is not behind a router? In fact, my scenario is that I'm running a hosted PBX virtual server.
So I gather my question boils down to: is there an MJMD5 port to i386 platform? |
|
Back to top |
|
 |
oldtimercurt Dan isn't smart enough to hire me
Joined: 07 Feb 2009 Posts: 281 Location: Pensacola
|
Posted: Wed Aug 05, 2009 3:57 pm Post subject: |
|
|
cohomology
I'll admit I don't totally understand what you are doing but how about the original MJMD5 such as I'm presently using on my Thin Client.
It will probably take some work to find it--I'm not very successful with the search function here.
OTC |
|
Back to top |
|
 |
jaybob413 MagicJack Newbie
Joined: 23 Mar 2009 Posts: 6
|
Posted: Wed Aug 05, 2009 6:55 pm Post subject: |
|
|
cohomology wrote: | Thank you jaybob413 for the instruction.
Seems your solution needs MJMD5 to run on a router. What if the PBX box is not behind a router? In fact, my scenario is that I'm running a hosted PBX virtual server.
So I gather my question boils down to: is there an MJMD5 port to i386 platform? |
I compiled the mjproxy source and am running it on the PIAF box. I did run it on a router at one time, but have since moved it to the same box that Asterisk is running on. The router is just redirecting the IAX, SIP, and RTP UDP ports to the PIAF box which allows me to use the public ip address of the router to accept SIP URI addresses to connect.
If you search for mjproxy, you should be able to download the source, compile it, and set up run scripts to start it on boot. They are different that the ones that are posted for OpenWRT/DD-WRT, but just use another one as an example, and modify it to do the start, stop, restart, etc. of mjproxy. Then in your MJ trunk, use the PIAF box as the host in the trunk setup and registration. |
|
Back to top |
|
 |
cohomology MagicJack Newbie
Joined: 21 May 2009 Posts: 6
|
Posted: Thu Aug 06, 2009 12:34 am Post subject: |
|
|
oldtimercurt
The search function here does not like me very much either:(
I'm just trying to use MJMD5 w/o a router, hehe.
C |
|
Back to top |
|
 |
cohomology MagicJack Newbie
Joined: 21 May 2009 Posts: 6
|
Posted: Thu Aug 06, 2009 12:35 am Post subject: |
|
|
Gr8! This is exactly what I'm looking for!
jaybob413 wrote: | cohomology wrote: | Thank you jaybob413 for the instruction.
Seems your solution needs MJMD5 to run on a router. What if the PBX box is not behind a router? In fact, my scenario is that I'm running a hosted PBX virtual server.
So I gather my question boils down to: is there an MJMD5 port to i386 platform? |
I compiled the mjproxy source and am running it on the PIAF box. I did run it on a router at one time, but have since moved it to the same box that Asterisk is running on. The router is just redirecting the IAX, SIP, and RTP UDP ports to the PIAF box which allows me to use the public ip address of the router to accept SIP URI addresses to connect.
If you search for mjproxy, you should be able to download the source, compile it, and set up run scripts to start it on boot. They are different that the ones that are posted for OpenWRT/DD-WRT, but just use another one as an example, and modify it to do the start, stop, restart, etc. of mjproxy. Then in your MJ trunk, use the PIAF box as the host in the trunk setup and registration. |
|
|
Back to top |
|
 |
cohomology MagicJack Newbie
Joined: 21 May 2009 Posts: 6
|
Posted: Thu Aug 06, 2009 12:44 am Post subject: |
|
|
Can anyone direct me to the source code of MJMD5? I just cannnot find it anywhere. Maybe I'm too blind to see it ... ...
jaybob413 wrote: | cohomology wrote: | Thank you jaybob413 for the instruction.
Seems your solution needs MJMD5 to run on a router. What if the PBX box is not behind a router? In fact, my scenario is that I'm running a hosted PBX virtual server.
So I gather my question boils down to: is there an MJMD5 port to i386 platform? |
I compiled the mjproxy source and am running it on the PIAF box. I did run it on a router at one time, but have since moved it to the same box that Asterisk is running on. The router is just redirecting the IAX, SIP, and RTP UDP ports to the PIAF box which allows me to use the public ip address of the router to accept SIP URI addresses to connect.
If you search for mjproxy, you should be able to download the source, compile it, and set up run scripts to start it on boot. They are different that the ones that are posted for OpenWRT/DD-WRT, but just use another one as an example, and modify it to do the start, stop, restart, etc. of mjproxy. Then in your MJ trunk, use the PIAF box as the host in the trunk setup and registration. |
|
|
Back to top |
|
 |
jaybob413 MagicJack Newbie
Joined: 23 Mar 2009 Posts: 6
|
Posted: Thu Aug 06, 2009 8:11 am Post subject: |
|
|
cohomology wrote: | Can anyone direct me to the source code of MJMD5? I just cannnot find it anywhere. Maybe I'm too blind to see it ... ...
|
Here is the post that I used for the source.
http://www.phoneservicesupport.com/post42750.html#42750
Compile and put the binary in /usr/sbin, then create a run script in /etc/init.d like:
(Be sure to change where it has YOURCITY and YOURPASSWORD)
--- begin script ---
#!/bin/bash
#
# mjproxy This shell script takes care of starting and stopping
# standalone mjproxy.
#
# chkconfig: - 60 50
# description: mjproxy is a sip proxy, which is the program \
# that forwards incoming requests for MagicJack.
# processname: mjproxy
# Source function library.
. /etc/rc.d/init.d/functions
[ -x /usr/sbin/mjproxy ] || exit 0
RETVAL=0
prog="mjproxy"
mjproxy="/usr/sbin/mjproxy"
MJPROXYARGS="0.0.0.0 5070 proxy01.YOURCITY.talk4free.com 5070 YOURPASSWORD"
start() {
# Start daemons.
echo -n $"Starting $prog: "
daemon $mjproxy $MJPROXYARGS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Shutting down $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/$prog ]; then
stop
start
RETVAL=$?
fi
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL
--- end script ---
Then add it to the startup list
chkconfig --add mjproxy
You will get a [Failed] on the start because the fork in mjproxy.c exits with a return value of 1, so it always says it fails. I did not bother with this, as the start, stop, restart, and status functions all do work. If you change the code at line 69 from exit(1) to exit(0) and recompile, start will always say [OK].
I did not spend any more time with that, as I was eager to move on to Google Voice integration.
And you may also want to change the useragent string that Asterisk sends to whatever the current MagicJack useragent string is. This can be done in /etc/asterisk/sip_general_custom.conf. Just add a line like:
useragent="MagicJack/1.80.484a (SJ Labs)"
That should do it. This setup has been working without fail or need to restart for days for both incoming and outgoing calls. |
|
Back to top |
|
 |
cohomology MagicJack Newbie
Joined: 21 May 2009 Posts: 6
|
Posted: Thu Aug 06, 2009 10:56 pm Post subject: |
|
|
Thanks a lot! Will try it over the weekend and report back.
C
jaybob413 wrote: | cohomology wrote: | Can anyone direct me to the source code of MJMD5? I just cannnot find it anywhere. Maybe I'm too blind to see it ... ...
|
Here is the post that I used for the source.
http://www.phoneservicesupport.com/post42750.html#42750
Compile and put the binary in /usr/sbin, then create a run script in /etc/init.d like:
(Be sure to change where it has YOURCITY and YOURPASSWORD)
--- begin script ---
#!/bin/bash
#
# mjproxy This shell script takes care of starting and stopping
# standalone mjproxy.
#
# chkconfig: - 60 50
# description: mjproxy is a sip proxy, which is the program \
# that forwards incoming requests for MagicJack.
# processname: mjproxy
# Source function library.
. /etc/rc.d/init.d/functions
[ -x /usr/sbin/mjproxy ] || exit 0
RETVAL=0
prog="mjproxy"
mjproxy="/usr/sbin/mjproxy"
MJPROXYARGS="0.0.0.0 5070 proxy01.YOURCITY.talk4free.com 5070 YOURPASSWORD"
start() {
# Start daemons.
echo -n $"Starting $prog: "
daemon $mjproxy $MJPROXYARGS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Shutting down $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/$prog ]; then
stop
start
RETVAL=$?
fi
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL
--- end script ---
Then add it to the startup list
chkconfig --add mjproxy
You will get a [Failed] on the start because the fork in mjproxy.c exits with a return value of 1, so it always says it fails. I did not bother with this, as the start, stop, restart, and status functions all do work. If you change the code at line 69 from exit(1) to exit(0) and recompile, start will always say [OK].
I did not spend any more time with that, as I was eager to move on to Google Voice integration.
And you may also want to change the useragent string that Asterisk sends to whatever the current MagicJack useragent string is. This can be done in /etc/asterisk/sip_general_custom.conf. Just add a line like:
useragent="MagicJack/1.80.484a (SJ Labs)"
That should do it. This setup has been working without fail or need to restart for days for both incoming and outgoing calls. |
|
|
Back to top |
|
 |
XoDiViAoX magicJack Apprentice
Joined: 07 Dec 2007 Posts: 17
|
Posted: Fri Aug 07, 2009 12:56 am Post subject: |
|
|
Running Trixbox here |
|
Back to top |
|
 |
mykroft MagicJack User
Joined: 19 Oct 2008 Posts: 47
|
Posted: Mon Aug 24, 2009 10:56 pm Post subject: |
|
|
jaybob413 wrote: | I am currently running PIAF with MagicJack. You will need the mjproxy daemon running somewhere to do the nonce twirling.
1) Using FreePBX, Set up a trunk for your MJ.
Trunk Name: MagicJack
PEER Details:
username=ENXXNXXXXXX01
type=friend
secret=MJ20CHARACTERPASSWRD
qualify=2000
port=5070
nat=yes
insecure=very
host=MJPROXYIP
fromuser=ENXXNXXXXXX01
dtmfmode=inband
context=from-trunk
Register String
ENXXNXXXXXX01:[email protected]:5070/NXXNXXXXXX
2) Create an Outbound Route to call out on. I set my Dial Pattern so dialing 8 uses MagicJack, 9 uses GV, etc. Pick whatever you want here.
Outbound Route
Dial Patterns
8|.
Trunk Sequence
SIP/MagicJack
3) Configure Inbound Routing
Inbound Route
DID Number: NXXNXXXXXX
Hope this helps. |
On the inbound routing for mine I had to use the ENXXNXXXXXX01 for the DID number - otherwise I got number is not in service |
|
Back to top |
|
 |
mykroft MagicJack User
Joined: 19 Oct 2008 Posts: 47
|
Posted: Mon Aug 24, 2009 11:01 pm Post subject: |
|
|
XoDiViAoX wrote: | Running Trixbox here |
you will either have to download and patch the source then compile or use the mjproxy program and run it on your server. I just patched my home box and it works great, will patch and change the work box from the mjproxy program tomorrow after my days off.
Best bet is to move to PBXIAF like I did from TrixBox - too many things you can not modify in TB that are easily available for PBXIAF users....
Take a look, you wont regret it
Myk |
|
Back to top |
|
 |
kidjake28 MagicJack Newbie
Joined: 18 Mar 2009 Posts: 1
|
Posted: Tue Sep 08, 2009 4:27 pm Post subject: |
|
|
Need some help here please.
I have compiled the application on my trixbox server and put the startup script in the init.d directory as instructed.
All works fine accept when I try to telnet to port 5070 on the local host I get Unable to connect to remote host: Connection refused
What could be wrong?
This is my MJProxyargs
MJPROXYARGS="0.0.0.0 5070 proxy01.miami.talk4free.com 5070 PASSWORD" |
|
Back to top |
|
 |
VaHam Dan Should Pay Me
Joined: 13 Feb 2008 Posts: 851
|
|
Back to top |
|
 |
pvsoares MagicJack Newbie
Joined: 17 Apr 2013 Posts: 8
|
Posted: Sun Apr 21, 2013 11:28 pm Post subject: Magicjack plus write settings to my FreepBX server |
|
|
has anyone find out how to get into the MJ Device to change the settings to the freepbx |
|
Back to top |
|
 |
crackerjack Dan Should Pay Me
Joined: 16 Nov 2007 Posts: 784
|
Posted: Mon Apr 22, 2013 12:38 am Post subject: Re: Magicjack plus write settings to my FreepBX server |
|
|
pvsoares wrote: | has anyone find out how to get into the MJ Device to change the settings to the freepbx |
Yes, back in 2008 |
|
Back to top |
|
 |
|