Magicjack Patch for Asterisk(updated)

magicJack Tips and Tricks

Moderators: Bill Smith, Pilot

RonV
magicJack Apprentice
Posts: 14
Joined: Mon Dec 08, 2008 2:13 pm

Post by RonV »

Well I took the drive from the Linux mjproxy to recompiling the sip module for my version of asterisk and it works great. Thank you for providing the patched code to handle the authentication of the MJ account. Thats one less piece of software that I need to run on my PBX.

If anyone is interested I can post the compiled sip module. Mine was from the Trixbox 2.4.2 distribution of Asterisk so its version 1.4.22.
completetech
magicJack Apprentice
Posts: 16
Joined: Sun Jul 26, 2009 1:11 am

Re: Thanks

Post by completetech »

VaHam wrote:
DarwinPeru wrote:Thanks for this tutorial, for me it is working good, I have Debian 5.0, Asterisk 1.6.0.13 and used the first patch.

and when I make a call to my MJ number my CLI show this message:

[Aug 28 14:19:44] WARNING[2645]: chan_sip.c:10502 check_auth: username mismatch, have <MYMJNUMBER>, digest has <EMYMJNUMBER01>
[Aug 28 14:19:44] NOTICE[2645]: chan_sip.c:17282 handle_request_invite: Failed to authenticate user <sip:[email protected]:5070>;tag=3584d42c-co6406-INS024
Hopefully mykroft's hint about matching the inbound exactly with your fromuser got you going.

I think you could also have set the global parameter to accept anonymous sip calls and that would have worked as well. If you use ENUM to allow incoming sip calls I think you need to set the allow anonymous sip for that to work as well.
I do think you are correct
sgarringer
MagicJack Newbie
Posts: 1
Joined: Sat Sep 05, 2009 1:30 am

Problems with Registration

Post by sgarringer »

Edit: Gave up, and am just forwarding my Magic Jack calls to another number which works fine in Asterisk.

I wish there were more VoIP providers that offered 319 area codes!
patppp
MagicJack Newbie
Posts: 5
Joined: Fri May 15, 2009 1:39 pm

Post by patppp »

RonV wrote: If anyone is interested I can post the compiled sip module. Mine was from the Trixbox 2.4.2 distribution of Asterisk so its version 1.4.22.
I've the compiled sip module for Asterisk 1.4.26.1 on Centos 5 (32bits).
Worked on my Elastix distrib.

PM if needed.
tvland
magicJack Apprentice
Posts: 23
Joined: Tue Mar 11, 2008 3:05 pm

Post by tvland »

I have trixbox 2.8.0.1 with asterisk 1.6.0.9 and recompiling asterisk for MJMD5 breaks the system. A number of problems happen after the recompile. I fixed everything except the CDR. The CDR no longer logs calls.

If I just patch chan_sip.so, I get a bunch of errors in the frePBX interface and everything to do with SIP is broken. I used the source package with the same version from the asterisk site.


Any suggestions on this?

Update: I have figured out that the Asterisk version in trixbox is a custom patched version. My version is not available in a source package. This patch won't be possible unless trixbox uses a release version of Asterisk.
azuretech
MagicJack Newbie
Posts: 1
Joined: Wed Oct 07, 2009 2:04 pm

Patch not working for me...

Post by azuretech »

I applied the patch, used Passwordfinder 2.2 to get my password, entered everything in, but for some reason I'm still getting:

NOTICE[3193] chan_sip.c: Failed to authenticate on REGISTER to '[email protected]' (Tries 3)

(obviously NXXNXXXXXX is my MJ phone number and MY20CHARPASSWORD is my password obtained through password finder)

Only thing I can figure is passwordfinder isn't pulling the correct password.... is there another way to find it?

register=ENXXNXXXXXX01:[email protected]:5070/NXXNXXXXXX

[MagicJack]
username=ENXXNXXXXXX01
authuser=ENXXNXXXXXX01
type=friend
secret=MY20CHARPASSWORD
qualify=2000
port=5070
insecure=port,invite
host=proxy01.boston.talk4free.com
fromuser=ENXXNXXXXXX01
useragent=MagicJack/1.80.499b (SJ Labs)
context=from-trunk
disallow=all
allow=ulaw
dtmfmode=rfc2833
nat=yes


Am I missing anything?
Is there a better way to obtain the sip password than Passwordfinder 2.2? I'm using the only one it came up with.... Passwordfinder 2.1 came up with a few other possibilities, but I tried all of them, also with no success.
VaHam
Dan Should Pay Me
Posts: 851
Joined: Wed Feb 13, 2008 8:02 pm

Re: Patch not working for me...

Post by VaHam »

azuretech wrote:I applied the patch, used Passwordfinder 2.2 to get my password, entered everything in, but for some reason I'm still getting:

NOTICE[3193] chan_sip.c: Failed to authenticate on REGISTER to '[email protected]' (Tries 3)

(obviously NXXNXXXXXX is my MJ phone number and MY20CHARPASSWORD is my password obtained through password finder)

Only thing I can figure is passwordfinder isn't pulling the correct password.... is there another way to find it?

register=ENXXNXXXXXX01:[email protected]:5070/NXXNXXXXXX

[MagicJack]
username=ENXXNXXXXXX01
authuser=ENXXNXXXXXX01
type=friend
secret=MY20CHARPASSWORD
qualify=2000
port=5070
insecure=port,invite
host=proxy01.boston.talk4free.com
fromuser=ENXXNXXXXXX01
useragent=MagicJack/1.80.499b (SJ Labs)
context=from-trunk
disallow=all
allow=ulaw
dtmfmode=rfc2833
nat=yes


Am I missing anything?
Is there a better way to obtain the sip password than Passwordfinder 2.2? I'm using the only one it came up with.... Passwordfinder 2.1 came up with a few other possibilities, but I tried all of them, also with no success.
I don't see a thing wrong with your settings. In fact I copied them exactly and substituted my # and PW and can verify they work.

I am sure it is just the way you represented the register string but of coarse it would not really include the "register=" as a part of it.

Did the patch, recompile and copying files etc. go ok?

Which version of Asterisk are you using?

You may want to setup a MJMD5 proxy and try using as softphone to register to test your credentials so you know they are correct.
Sad Times Ahead for this Obamanation !!!! Psalms 109:8
CharlesNY
MagicJack Newbie
Posts: 1
Joined: Thu Oct 08, 2009 8:24 am

How did dtm get the new algorithm?

Post by CharlesNY »

MagicJack changed their SIP authentication to non-standard. But how did dtm figured out the new algorithm to calculate the new nonce which involves the call-ID.

Thank you dtm for sharing the algorithm otherwise I would never figure it out.

Thanks,
Charles
crackerjack
Dan Should Pay Me
Posts: 784
Joined: Fri Nov 16, 2007 9:32 pm

Re: How did dtm get the new algorithm?

Post by crackerjack »

CharlesNY wrote: how did dtm figured out the new algorithm to calculate the new nonce which involves the call-ID.
He found a 'bone' that was thrown his way.....

Crackerjack
Good Luck

CrackerJack

MagicJack Customer #73
MagicJack user since May 2007
MagicJack abuser since June 2007
"I gots mo' numbers than a Lotto machine!!!"
vicos
MagicJack Newbie
Posts: 5
Joined: Wed Sep 17, 2008 5:03 am

Post by vicos »

Any one have an Idea of why i get this output when patching chan_sip?

The text leading up to this was:
--------------------------
|--- old/channels/chan_sip.c 2009-08-13 10:24:40.000000000 -0700
|+++ new/channels/chan_sip.c 2009-08-22 13:47:29.000000000 -0700
--------------------------
File to patch: channels/chan_sip.c
patching file channels/chan_sip.c
Hunk #1 succeeded at 8413 (offset -122 lines).
Hunk #2 FAILED at 11562.
1 out of 2 hunks FAILED -- saving rejects to file channels/chan_sip.c.rej

the command I run was : patch -l -p0 < chan_sip.patch

Thanks
VaHam
Dan Should Pay Me
Posts: 851
Joined: Wed Feb 13, 2008 8:02 pm

Post by VaHam »

vicos wrote:Any one have an Idea of why i get this output when patching chan_sip?

The text leading up to this was:
--------------------------
|--- old/channels/chan_sip.c 2009-08-13 10:24:40.000000000 -0700
|+++ new/channels/chan_sip.c 2009-08-22 13:47:29.000000000 -0700
--------------------------
File to patch: channels/chan_sip.c
patching file channels/chan_sip.c
Hunk #1 succeeded at 8413 (offset -122 lines).
Hunk #2 FAILED at 11562.
1 out of 2 hunks FAILED -- saving rejects to file channels/chan_sip.c.rej

the command I run was : patch -l -p0 < chan_sip.patch

Thanks
Are you sure the version of Asterisk your patching is the same as the one the patch is for?
Sad Times Ahead for this Obamanation !!!! Psalms 109:8
vicos
MagicJack Newbie
Posts: 5
Joined: Wed Sep 17, 2008 5:03 am

Post by vicos »

well my version is plain asterisk 1.4.18.1 , don't know what the problem seems to be...


Thanks
VaHam
Dan Should Pay Me
Posts: 851
Joined: Wed Feb 13, 2008 8:02 pm

Post by VaHam »

vicos wrote:well my version is plain asterisk 1.4.18.1 , don't know what the problem seems to be...


Thanks
And what patch did you use?
Sad Times Ahead for this Obamanation !!!! Psalms 109:8
vicos
MagicJack Newbie
Posts: 5
Joined: Wed Sep 17, 2008 5:03 am

Post by vicos »

Well, I used the one in the first page, would the one in the bottom of the page work for me?


Thanks
VaHam
Dan Should Pay Me
Posts: 851
Joined: Wed Feb 13, 2008 8:02 pm

Post by VaHam »

vicos wrote:Well, I used the one in the first page, would the one in the bottom of the page work for me?


Thanks
Thats why I asked with the version your using I think neither match. You may want to try manually editing the source yourself for your version instead of using the patch. But you could try the one at the bottom and see if it gives you errors.
Sad Times Ahead for this Obamanation !!!! Psalms 109:8
nttranbao
MagicJack Newbie
Posts: 1
Joined: Mon Oct 19, 2009 1:39 am

My settings that work

Post by nttranbao »

Here is my settings, which should give you both incoming and outgoing:

username=EMJTENDIGITS01
type=peer
secret=MJ20CHARACTERSPASSWORD
qualify=yes
port=5070
nat=yes
insecure=very ;(1)
host=67.88.84.6 ;(2)
fromuser=EMJTENDIGITS01
dtmfmode=rfc2833
disallow=all
context=from-pstn
allow=ulaw&g729
fromdomain=talk4free.com

REGISTER:
EMJTENDIGITS01:[email protected]:5070/EMJTENDIGITS01

Note: Must patch chan_sip.so as instructed.
(1): MUST be =very. If you set to "insecure=yes", then either incoming or outgoing direction fails.
(2): I use hostIP, and it works.

I use Trixbox 2.6.2.3.

TIPS: never upgrade your MagicJack to avoid these kinds of troubles :)

Regards,

Bao Nguyen.
MST
magicJack Apprentice
Posts: 28
Joined: Mon Nov 02, 2009 11:35 pm

Post by MST »

Hello

Could you please let me know Which patch is required by Trixbox 2.6.2.3?

It uses Asterisk 1.4.22-4 I guess it is required by new MJ that I bought from radioshack a couple days ago. have to admitt that my old MJ (2007version) works without any patches. I get SIP credentials using passwordfinder 2.1 and using it now. regarding new MJ I have used the same tools and use the password and user extracted from PF2.1. I use the same proxy URL server as for old MJ. Can't get new MJ working with Trix. MY old Mj even works on PAP2T. Configuration get me 2 min and use 5 different info from Trixbox SIP trunk + this forum = success. Please advice if new MJ has new soft or something like that my Trix does not want to register with it.

Regards, MST
MST
fala
magicJack Apprentice
Posts: 20
Joined: Sat Mar 28, 2009 7:37 pm

Post by fala »

I'm a little confuse about this whole thing. I have PBX In A Flash (PIAF) running on a HP T5720 Thin Client and PIAF is running off of a 8G Flash Drive. I have magicJack setup on PIAF and the Mjproxy running on a DD-WRT Router.

Questions:

A) I can received calls through PIAF and can make outgoing calls without problem. This, without having to make ANY (PATCH) modification to PIAF. The only issue I'm experiencing is that if I make a call from my cell phone to my MagicJack Number, I DONOT get any ring tone in my cell phone and I can hearing my Majic Jack phone (Extension) rings. After a set number of rings, I can hear, from my cell phone, the voicemail annoucement on my PIAF system, but again, no ringing feedback on my cell phone before the voicemail kicks in!.

Is this issue related to the fact that I did not apply the asterisk patch to PIAF? Do you have to do the patch to get incoming working properly? The only issue is the absence of a ring tone the caller hears on incoming calls.

B) Given my setup, instead running the Mjproxy on the Router, is there a way to run the proxy on my Thin Client and if yes, could someone point me to the link which walks you through the steps necessary to install on the HP Thin Client.
crackerjack
Dan Should Pay Me
Posts: 784
Joined: Fri Nov 16, 2007 9:32 pm

Post by crackerjack »

Definitely not a MJ related issue. Does this only happen with calls from your cell??
What version pbxiaf?
Good Luck

CrackerJack

MagicJack Customer #73
MagicJack user since May 2007
MagicJack abuser since June 2007
"I gots mo' numbers than a Lotto machine!!!"
fala
magicJack Apprentice
Posts: 20
Joined: Sat Mar 28, 2009 7:37 pm

Post by fala »

crackerjack wrote:Definitely not a MJ related issue. Does this only happen with calls from your cell??
What version pbxiaf?
I agree that it is not a MJ issue, but related to the whole Asterisk/mjproxy setup.

I'm using version:

FreePBX 2.6.0.0
PIAF Asterisk Version : 1.4.21.2
CenOS: 5.3 (Final)

Yes, the same thing happens with calls from my cell phone, my POTS (AT&T) line and my other VOIP using T-Mobile@home line. If I call the majicJack extension (1020) from another extension (1010), I do hear the ringing tone on the receiver and the extension phone does ring.

I do not hear any ringing during the placing of the call, even though the phone (extension) is ringing. If the MajicJack call is not answered, I will suddenly hear the voicemail annoucement.

Again, is it necessary to install the asterisk patch inorder to get the MajicJack to function on Asterisk (PIAF)? I guess what I asking is whether anyone has been able to get asterisk to work with the mjproxy approach without the asterisk patch? If so, specifically which procedure should I follow for Asterisk 1.4.21.2?

Thanks
crackerjack
Dan Should Pay Me
Posts: 784
Joined: Fri Nov 16, 2007 9:32 pm

Post by crackerjack »

fala wrote:
crackerjack wrote:
Again, is it necessary to install the asterisk patch inorder to get the MajicJack to function on Asterisk (PIAF)?

Thanks
NO.

Make sure to update-fixes and update-scripts from cli in piaf
Good Luck

CrackerJack

MagicJack Customer #73
MagicJack user since May 2007
MagicJack abuser since June 2007
"I gots mo' numbers than a Lotto machine!!!"
fala
magicJack Apprentice
Posts: 20
Joined: Sat Mar 28, 2009 7:37 pm

Post by fala »

crackerjack wrote:
fala wrote:
crackerjack wrote:
Again, is it necessary to install the asterisk patch inorder to get the MajicJack to function on Asterisk (PIAF)?

Thanks
NO.

Make sure to update-fixes and update-scripts from cli in piaf
Did as you suggested and it still did not work. I should mention that Everything work great (incoming/outgoing) with the mjproxy on my WRT54G-TM Router (192.168.1.44) and my SPA-3102. Once I switch to Asterisk, I'm having this one issue on incoming. Here is my Peer detail, maybe someone can spot the problem:

Code: Select all

Trunk Name: MagicJack
disallow=all
allow=ulaw
username=EXXXXXXXXXX01
useragent=MagicJack/1.80.499b (SJ Labs)
type=friend
secret=MJPASSWORD
qualify=yes
port=5070
nat=no
insecure=port,invite
host=192.168.1.44; IP address of the WRT54G-TM DD-WRT Router Running mjproxy
fromuser=EXXXXXXXXXX01
fromdomain=talk4free.com
dtmfmode=rfc2833
context=from-trunk


Thanks
VaHam
Dan Should Pay Me
Posts: 851
Joined: Wed Feb 13, 2008 8:02 pm

Post by VaHam »

fala wrote:
crackerjack wrote:
fala wrote: NO.

Make sure to update-fixes and update-scripts from cli in piaf
Did as you suggested and it still did not work. I should mention that Everything work great (incoming/outgoing) with the mjproxy on my WRT54G-TM Router (192.168.1.44) and my SPA-3102. Once I switch to Asterisk, I'm having this one issue on incoming. Here is my Peer detail, maybe someone can spot the problem:

Code: Select all

Trunk Name: MagicJack
disallow=all
allow=ulaw
username=EXXXXXXXXXX01
useragent=MagicJack/1.80.499b (SJ Labs)
type=friend
secret=MJPASSWORD
qualify=yes
port=5070
nat=no
insecure=port,invite
host=192.168.1.44; IP address of the WRT54G-TM DD-WRT Router Running mjproxy
fromuser=EXXXXXXXXXX01
fromdomain=talk4free.com
dtmfmode=rfc2833
context=from-trunk


Thanks
The patch allows MJ to be used without having to use the MJPROXY at all since it performs the same MD5 computation as the MJPROXY does.

What does your registration string look like and what have you set as the USER Context: under incoming settings?
Sad Times Ahead for this Obamanation !!!! Psalms 109:8
fala
magicJack Apprentice
Posts: 20
Joined: Sat Mar 28, 2009 7:37 pm

Post by fala »

Registration string:

EXXXXXXXXXX01:[email protected]:5070/EXXXXXXXXXX01

I left the Incoming Settings Blank (no incoming contexts). All my other trunks do not have "Incoming Settings" and I have no issues at all. I was trying to post the SPA-3102 Line 1 settings but do not know how, so I will list a few of the critical settings:

Subscriber Information

Display Name: myname
User ID: 1020
Password: the extension (1020) password
Use Auth ID: no
Auth ID: Blank

Proxy and Registration

Proxy:192.168.1.130 (IP address of PIAF Box)
Outbound Proxy: Blank
Register Expires: 120
Proxy Fallback Intvl:120
Make Call Without Reg: no
Ans Call Without Reg: no

Dial Plan: ([*x]x.)

SIP Port: 5070

SIP
SIP User Agent Name:$VERSION (Default)
SIP Reg User Agent Name:$VERSION
SIP Server Name: Blank

I'm curious as why some people are using

dtmfmode=rfc2833 versus dtmfmode=inband.

Does this have anything to do with the intermittent beep sound I hear while on the phone (my MJ was recently purchased at a Walgreen .).
VaHam
Dan Should Pay Me
Posts: 851
Joined: Wed Feb 13, 2008 8:02 pm

Post by VaHam »

Try changing your register string so that the at the end you have only your 10 digit MJ number.

EXXXXXXXXXX01:[email protected]:5070/EXXXXXXXXXX01

change to:

EXXXXXXXXXX01:[email protected]:5070/XXXXXXXXXX

Then under incoming settings enter the same 10 digit MJ number as the USER Context leaving the rest of the incoming blank.

Then setup an inbound route using your 10 digit MJ number as the DID and point it where ever you like IVR, Extension etc.

I didn't look at your 3102 settings but if they are working with other trunks then they should be ok.
Sad Times Ahead for this Obamanation !!!! Psalms 109:8
fala
magicJack Apprentice
Posts: 20
Joined: Sat Mar 28, 2009 7:37 pm

Post by fala »

VaHam wrote:Try changing your register string so that the at the end you have only your 10 digit MJ number.

EXXXXXXXXXX01:[email protected]:5070/EXXXXXXXXXX01

change to:

EXXXXXXXXXX01:[email protected]:5070/XXXXXXXXXX

Then under incoming settings enter the same 10 digit MJ number as the USER Context leaving the rest of the incoming blank.

Then setup an inbound route using your 10 digit MJ number as the DID and point it where ever you like IVR, Extension etc.

I didn't look at your 3102 settings but if they are working with other trunks then they should be ok.
I will try you suggestions and report back later.....Thanks!!
tvland
magicJack Apprentice
Posts: 23
Joined: Tue Mar 11, 2008 3:05 pm

Post by tvland »

fala wrote:
I'm curious as why some people are using

dtmfmode=rfc2833 versus dtmfmode=inband.

Does this have anything to do with the intermittent beep sound I hear while on the phone (my MJ was recently purchased at a Walgreen .).
I am quite interested in the differences in the dtmf mode myself.

As for the beep, I have experienced this too. For me, it is heard only by the other party and not on my end talking with a SPA-2102 and trixbox. This one is puzzling me!
josetann
MagicJack Newbie
Posts: 1
Joined: Wed Mar 04, 2009 5:04 pm

Post by josetann »

So...everything was working fine until recently. Incoming would work, but not outgoing.

Searched, found this thread. Upgraded asterisk to 1.6.1.9. Applied patch with no problems (even ran the strings command to verify). Had some issues registering, patched chan_sip to allow expiry of 0.

I can now register fine, incoming calls work fine, but outgoing still gives this:

-- Got SIP response 400 "Bad Request" back from 216.234.77.8
-- SIP/MagicJack-XXXXXXXX is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)

It was taking a while to timeout until I changed the host to proxy01.nashville.talk4free.com vs the ip. Not sure if that helps.

Here's my sip.conf entries:

register => EXXXXXXXXXX01:[email protected]:5070

[MagicJack]
username=EXXXXXXXXXX01
type=friend
secret=XXXXXXXXXXXXXXXXXXXX
port=5070
nat=yes
insecure=invite,port
host=proxy01.nashville.talk4free.com
fromuser=EXXXXXXXXXX01
useragent=MagicJack/1.80.484a (SJ Labs)
dtmfmode=rfc2833
context=packet8
canreinvite=no
qualify=2000

Not sure if it matters...but I did change my useragent to a newer version...don't remember what it used to be (whatever it would have been around March or April I guess).
kingmony
magicJack Apprentice
Posts: 11
Joined: Sun Feb 01, 2009 12:33 pm

patch for elastix

Post by kingmony »

I need help installing this on elastix with asterisk 1.4.26.
there is no such a directory usr/src/asterisk
does anybody have a .tar file that I can install.
Thanks
MST
magicJack Apprentice
Posts: 28
Joined: Mon Nov 02, 2009 11:35 pm

Post by MST »

Just do using the same way as you do with asterisk or trixbox.
It works with Elastix.
MST
kingmony
magicJack Apprentice
Posts: 11
Joined: Sun Feb 01, 2009 12:33 pm

elastix

Post by kingmony »

but where is the file ? that directory is not there.
MST
magicJack Apprentice
Posts: 28
Joined: Mon Nov 02, 2009 11:35 pm

Post by MST »

You have to download Asterisk.TAR from http://downloads.asterisk.org

choose version that Elastix uses

UNZIP it and patch the script that is provided on the 1st page in this forum.

MST
MST
kingmony
magicJack Apprentice
Posts: 11
Joined: Sun Feb 01, 2009 12:33 pm

Post by kingmony »

I'm sorry I don't get this. My elastix comes with asterisk ver.14.26.1
Why should I install it again? iis it just asterisk add-ons?
mykroft
MagicJack User
Posts: 47
Joined: Sun Oct 19, 2008 12:28 am

Post by mykroft »

you have to patch the asterisk source and then recompile it
joecanadian
MagicJack Contributor
Posts: 58
Joined: Wed Nov 28, 2007 3:06 am

Post by joecanadian »

Correct me if I am wrong. But I think this is fine a normal error. Something they do the first reg is supposed fail Thats sorta how they weed out the rest sorta a trick they did to well I have no idea I am getting the feeling early on when the first workarounds came out that in the wireshark dumps it did this funny thing. I would have to read back up on it or someone with more time will but I would ignor it. Turn your logs off save some wear and tear only turn them on when there are issues!
vicos wrote:Any one have an Idea of why i get this output when patching chan_sip?

The text leading up to this was:
--------------------------
|--- old/channels/chan_sip.c 2009-08-13 10:24:40.000000000 -0700
|+++ new/channels/chan_sip.c 2009-08-22 13:47:29.000000000 -0700
--------------------------
File to patch: channels/chan_sip.c
patching file channels/chan_sip.c
Hunk #1 succeeded at 8413 (offset -122 lines).
Hunk #2 FAILED at 11562.
1 out of 2 hunks FAILED -- saving rejects to file channels/chan_sip.c.rej

the command I run was : patch -l -p0 < chan_sip.patch

Thanks
It had to be said
MST
magicJack Apprentice
Posts: 28
Joined: Mon Nov 02, 2009 11:35 pm

Post by MST »

It is wrong.

Hunk #2 FAILED at 11562. - not a good sign. It needs to be like #hunk1
MST
mufon
Dan isn't smart enough to hire me
Posts: 296
Joined: Fri Jan 25, 2008 9:50 am
Location: HIghland Village, Texas
Contact:

Post by mufon »

I would like to just point out a couple of things that will make your MJ to Asterisk life better.

Use extensions.ael and extensions.lua. Delete extenisons.conf. DON'T USE IT!

Strip your binaries after compile.

Why do all of you make it so hard when it is so simple?

PATCHES? We don't need no stinkin' PATCHES!
"Looking for a new job. I have worked for Adelphia, Enron, Health South, Worldcom, and most recently British Petroleum."
mykroft
MagicJack User
Posts: 47
Joined: Sun Oct 19, 2008 12:28 am

Post by mykroft »

mufon wrote:I would like to just point out a couple of things that will make your MJ to Asterisk life better.

Use extensions.ael and extensions.lua. Delete extenisons.conf. DON'T USE IT!

Strip your binaries after compile.

Why do all of you make it so hard when it is so simple?

PATCHES? We don't need no stinkin' PATCHES!
Ignore this person - deleting your extensions.conf file will render your asterisk system unusable......

Myk
mykroft
MagicJack User
Posts: 47
Joined: Sun Oct 19, 2008 12:28 am

Post by mykroft »

joecanadian wrote:Correct me if I am wrong. But I think this is fine a normal error. Something they do the first reg is supposed fail Thats sorta how they weed out the rest sorta a trick they did to well I have no idea I am getting the feeling early on when the first workarounds came out that in the wireshark dumps it did this funny thing. I would have to read back up on it or someone with more time will but I would ignor it. Turn your logs off save some wear and tear only turn them on when there are issues!
vicos wrote:Any one have an Idea of why i get this output when patching chan_sip?

The text leading up to this was:
--------------------------
|--- old/channels/chan_sip.c 2009-08-13 10:24:40.000000000 -0700
|+++ new/channels/chan_sip.c 2009-08-22 13:47:29.000000000 -0700
--------------------------
File to patch: channels/chan_sip.c
patching file channels/chan_sip.c
Hunk #1 succeeded at 8413 (offset -122 lines).
Hunk #2 FAILED at 11562.
1 out of 2 hunks FAILED -- saving rejects to file channels/chan_sip.c.rej

the command I run was : patch -l -p0 < chan_sip.patch

Thanks
It had to be said
The patch for your correct version of asterisk will patch CLEAN - no errors or warnings.....

Myk
mufon
Dan isn't smart enough to hire me
Posts: 296
Joined: Fri Jan 25, 2008 9:50 am
Location: HIghland Village, Texas
Contact:

Post by mufon »

Mykroft, you are wrong.

I won't start a pissing contest here, it was never my intent. You don't need extensions.conf and you don't use it when you want to use advanced features. Do some study mykroft after removing the foot from your mouth.

I've been doing this a long time, and I know exactly what I'm doing and I am exactly right. You won't and can't prove me wrong. Forgive me for trying to steer some of you into smarter not harder thinking.

Show some respect and I might show you how the professionals do this.

Patching is a last resort, not first. Imagine patching dozens of systems every time an upgrade gets handed down.

Like I said before, this is soooooo easy!

PATCHES? We ain't gotta do no stinking PATCHES!
"Looking for a new job. I have worked for Adelphia, Enron, Health South, Worldcom, and most recently British Petroleum."
oliverda
magicJack Apprentice
Posts: 19
Joined: Thu Oct 09, 2008 10:08 pm

Post by oliverda »

mufon wrote:I would like to just point out a couple of things that will make your MJ to Asterisk life better.

Use extensions.ael and extensions.lua. Delete extenisons.conf. DON'T USE IT!

Strip your binaries after compile.

Why do all of you make it so hard when it is so simple?

PATCHES? We don't need no stinkin' PATCHES!
Can you give us a detailed description on how to do this? Please!
mufon
Dan isn't smart enough to hire me
Posts: 296
Joined: Fri Jan 25, 2008 9:50 am
Location: HIghland Village, Texas
Contact:

Post by mufon »

oliverda wrote:
mufon wrote:I would like to just point out a couple of things that will make your MJ to Asterisk life better.

Use extensions.ael and extensions.lua. Delete extenisons.conf. DON'T USE IT!

Strip your binaries after compile.

Why do all of you make it so hard when it is so simple?

PATCHES? We don't need no stinkin' PATCHES!
Can you give me a detailed description on how to do this? Please!
I will. Let me sanitise my extensions.ael and extenisions.lua and I will post them with comment. Everything else is pure asterisk, UNPATCHED, surviving upgrade.

Keep in mind extensions.conf is depracated, using extensions.ael as the dialplan. Extensions.lua we use for fixing the auth problem.

Interestingly much of the MJ code is written in LUA! Go figure...
"Looking for a new job. I have worked for Adelphia, Enron, Health South, Worldcom, and most recently British Petroleum."
root
MagicJack User
Posts: 37
Joined: Thu Apr 17, 2008 4:50 pm
Location: Aspen, Colorado
Contact:

Post by root »

extensions.conf has been deprecated since asterisk 1.4.x

It has been retained for backward compatibility only. Extensions.ael is the preferred dialplan with extensions.lua as an adjunct where asterisk is compiled with lua.
There are 10 different kinds of people in the world. There are those who understand binary, and those who don't.

MagicJack on TRS80 Model 1 16K Extended Basic
mykroft
MagicJack User
Posts: 47
Joined: Sun Oct 19, 2008 12:28 am

Post by mykroft »

Most stock FreePBX 1.4.x distros do not use the new .lua and and .ael

so just telling someone to remove their extensions.conf will kill their system.

Correct me if I am wrong but isnt the .lua and .ael standard for 1.6.x? and not 1.4.x?

I looked into 4 different 1.4.x distros before writing this replay and none of them have the above mentioned files - so again killing the extensions.conf without knowing what the .lua and .ael files are and what they do will kill most ppls installs that use freepbx......

So you need to be more specific before telling someone to do that, 2 years ago i would have just followed your advice and deleted the file and hosed my system.


BTW, the orig version of this patch was designed for 1.4.x not 1.6.x
mufon
Dan isn't smart enough to hire me
Posts: 296
Joined: Fri Jan 25, 2008 9:50 am
Location: HIghland Village, Texas
Contact:

Post by mufon »

Fair enough mykroft, and I did not intend to take this discussion outside of technical and intellectual realm. I would hope no one reading this discussion would delete or modify anything without full understanding of every detail explained in these discussions. Indeed these are advanced topics not for general consumption.

I will spell this out as clearly as I can. All information I post will pertain as closely as possible to the latest asterisk release, derivations (derivatives) of asterisk are not supported.

We are all friends here, let's enjoy!
"Looking for a new job. I have worked for Adelphia, Enron, Health South, Worldcom, and most recently British Petroleum."
Stormwind
MagicJack Newbie
Posts: 2
Joined: Thu Mar 18, 2010 9:27 am
Location: Texas

Post by Stormwind »

I will. Let me sanitise my extensions.ael and extenisions.lua and I will post them with comment. Everything else is pure asterisk, UNPATCHED, surviving upgrade.

Keep in mind extensions.conf is depracated, using extensions.ael as the dialplan. Extensions.lua we use for fixing the auth problem.

Interestingly much of the MJ code is written in LUA! Go figure...
Hi Mufon,

Would you be willing to share your Lua code for Asterisk MagicJack support without patching the code or mjproxy? I'd like to keep using rpm's to keep Asterisk up to date, so avoiding patching the C code would be great. I can help clean it up if you'd like.

Thanks!
- Jason
jaminmc
MagicJack Newbie
Posts: 5
Joined: Wed Mar 24, 2010 5:56 pm

Post by jaminmc »

Ok, I am using a Trixbox with 2.8.0.3, and it had Asterisk 1.6.0.22-samy-r60 from doing a "yum update". I then tried to get the source to it to do the chan_sip.c patch, and it turns out that it was already there. Sweet!!! After I spent hours trying to figure it out... I am using the useragent of "MagicJack/1.75.502c (SJ Labs)", which is the one that the MAC version uses. I have only ever hooked it up to my mac.

Anyways, my problem is that no matter what I do for my register string, or other settings, the DID for my magic jack comes in a just the letter "s".

I've tried:
E800555121201:[email protected]:5070/E800555121201
E800555121201:[email protected]:5070/8005551212
E800555121201:[email protected]:5070/18005551212
E800555121201:[email protected]:5070/4321
They all give me a "__FROM_DID=s"
I even tried running it through mjproxy, just in case there was something wrong with the patched chan_sip.so, and I got the same exact

Code: Select all

-- Executing [s@from-trunk:1] Set("SIP/mj-in-0000001f", "__FROM_DID=s") in new stack
. I only have the 1 magic jack, but if I get another one, then there will be no way to figure out which one the call come from... Unless I use a different proxy or something. I tried the Nashville, and Atlanta proxy's and the were both the same. (Mine came using Atlanta by default when I got my number)

Is there something up with magic jack, that is causing this? Or is it some trixbox code that is messed up? I can't even compile the source code for Asterisk 1.6.0.22-samy-r60, but I can for the previous version. Although I am a little squeamish to install the older version over the newest version...


Here is my wireshark of the registration(With personal info removed):

Code: Select all

REGISTER sip:proxy1.Nashville.talk4free.com:5070 SIP/2.0
Via: SIP/2.0/UDP 8.8.8.8:5060;branch=z9hG4bK72412c97;rport
Max-Forwards: 70
From: <sip:[email protected]>;tag=as6e2580a4
To: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 102 REGISTER
User-Agent: MagicJack/1.75.502c (SJ Labs)
Expires: 120
Contact: <sip:[email protected]>
Event: registration
Content-Length: 0

OPTIONS sip:proxy1.Nashville.talk4free.com SIP/2.0
Via: SIP/2.0/UDP 8.8.8.8:5060;branch=z9hG4bK38fafcf0;rport
Max-Forwards: 70
From: "Unknown" <sip:[email protected]>;tag=as5dc11a07
To: <sip:proxy1.Nashville.talk4free.com>
Contact: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 102 OPTIONS
User-Agent: MagicJack/1.75.502c (SJ Labs)
Date: Wed, 24 Mar 2010 18:05:31 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0

SIP/2.0 502 Bad Gateway
Via: SIP/2.0/UDP 8.8.8.8:5060;branch=z9hG4bK38fafcf0;rport
To: <sip:proxy1.Nashville.talk4free.com>
From: "Unknown"<sip:[email protected]>;tag=as5dc11a07
Call-ID: [email protected]
CSeq: 102 OPTIONS
User-Agent: ENSR3.2.1.4-IS14
Content-Length: 0

SIP/2.0 200 OK
Via: SIP/2.0/UDP 8.8.8.8:5060;branch=z9hG4bK72412c97;rport
Contact: <sip:[email protected]>;expires=120
To: <sip:[email protected]>;tag=4c7b31f4-co36942-INS014
From: <sip:[email protected]>;tag=as6e2580a4
Call-ID: [email protected]
CSeq: 102 REGISTER
User-Agent: ENSR3.2.1.4-IS14-RMRG0-RG900-EP3513831
Content-Length: 0
jaminmc
MagicJack Newbie
Posts: 5
Joined: Wed Mar 24, 2010 5:56 pm

Post by jaminmc »

Looks like there is something wrong with Trixbox. Even though it works with any other sip trunk I have installed, MJ seems to not like the request for a DID. I don't know if it is because the host name is sip.Mdyomain.net, or what. I installed PBX in a Flash on a VM Fusion, and used the EXACT same settings in my trunk, and what do you know, the DID was correct!

This got me looking at other distro's, and now I am planning on checking out Elastix.
jaminmc
MagicJack Newbie
Posts: 5
Joined: Wed Mar 24, 2010 5:56 pm

Post by jaminmc »

I must say, I love Elastix. I just might keep it :)
jaminmc
MagicJack Newbie
Posts: 5
Joined: Wed Mar 24, 2010 5:56 pm

DTMF Not working!

Post by jaminmc »

Magicjack works great for calls! But, try to call anyone that you have to push numbers for, and it doesn't work :(.. I tried it with dtmfmode=inbound, auto, info, and rfc2833. No matter what the setting, I don't get any tones from my magicjack trunk. Now, when I use my callwithus trunk, that has rfc2833 set on it, and call my office phone, it works great. It even works with my ipkal incoming number (Going through google voice too)

So I guess Magicjack doesn't support DTMF?

I haven't tried it on the magicjack itself. I actually haven't plugged it into my computer since I pulled my credentials off of it.
Post Reply