Page 1 of 3

Posted: Sat Aug 22, 2009 7:54 am
by VaHam
lowno wrote:How do you patch the chan_sip.so?
There are many different ways but below is to the best of my recollection the way I did it.

22 Aug 2009 - Edited Instructions to fix a bug and make them more general purpose

1) {login to your Asterisk box using the 'root' account - you can use putty to do this remotly}

2) {Backup the original version of chan_sip:}
{Hint: you can copy the following commands to the clip board, one at a time, and then right click on the putty window and the command will be copied there. Then just hit enter to execute the command in putty}

cp -p /usr/src/asterisk/channels/chan_sip.c /usr/src/asterisk/channels/chan_sip.c.b4patch
cp -p /usr/src/asterisk/channels/chan_sip.c.orig /usr/src/asterisk/channels/chan_sip.c.orig.b4patch
cp -p /usr/src/asterisk/channels/chan_sip.so /usr/src/asterisk/channels/chan_sip.so.b4patch
cp -p /usr/lib/asterisk/modules/chan_sip.so /usr/lib/asterisk/modules/chan_sip.so.b4patch
mv /usr/src/asterisk/channels/chan_sip.c.orig /usr/src/asterisk/channels/chan_sip.c.orig.b4patch

{used mv here to rename the chan_sip.c.orig if there was one so it won't interfer with the application of the patch later on}

3) {Navigate to the Asterisk source directory where chan_sip.c is located}

cd /usr/src/asterisk/channels

4) {highlight the patch text from the webpage here and copy the text to your clipboard}

5) {open a blank text file named chan_sip_mj_patch.txt}

cat > chan_sip_mj_patch.txt

6) {right click the mouse on the putty window to paste the text into the open chan_sip_mj_patch.txt}

7) {use the keyboard command below to close and save the chan_sip_mj_patch.txt file}
{Edit: 22 Aug 2009 - After pasting the text into putty hit return once before the Cntrl-d to eliminate the unexpected end in middle of line warning during patch}

Cntrl-D

8) {Apply the patch}
{Edit: 22 Aug 2009 modified the patch command to assist with tab vs. spaces in patch file}

patch -l <chan_sip_mj_patch.txt

9) {move up one level to the asterisk source directory}

cd ..

10) {Compile your new chan_sip.so...saving a copy of the compilation messages to /tmp/make.all}
{Edit: If you have problems with the following command on your distro then just use the plain make command.}

make all 2>&1|tee /tmp/make.all

{If no errors during the compilation then stop asterisk and install the new chan_sip.so}

11) {stop asterisk}

/usr/sbin/asterisk -rx "stop gracefully"

12) {Copy the new chan_sip.so to the asterisk modules directory}

cp -p /usr/src/asterisk/channels/chan_sip.so /usr/lib/asterisk/modules/chan_sip.so

13) {Restart Asterisk}

/usr/sbin/asterisk

Posted: Sat Aug 22, 2009 10:40 am
by lowno
Wow, thanks a ton VaHam. I appreciate the detailed instructions.

Posted: Sat Aug 22, 2009 11:56 am
by VaHam
lowno wrote:Wow, thanks a ton VaHam. I appreciate the detailed instructions.
Your welcome let us know how you make out!

Posted: Sat Aug 22, 2009 2:53 pm
by bent
Hi!
To pagemen
I think the first part of patch (check_auth) is not need, it's used only for incoming authentications with your peers.
And there is a little bug in code: variable newnonce is longer than necessary, it's need cut :)

Code: Select all

for (i = 0; i < 8; i++) {
                       hex[0] = newnonce[i];
                       int x = strtol(hex, NULL, 16);
                       *c++ = callid[x];
                       }
*c++ = 0;
^^^^^^^
Now working on incoming/outgoing calls w/o mjproxy.

Posted: Sat Aug 22, 2009 3:14 pm
by lowno
I am working on it as per the instructions, I am currently stuck with at the following error in terminal:

File to patch: chan_sip.c
patching file chan_sip.c
Hunk #1 FAILED at 8535.
patch unexpectedly ends in middle of line
Hunk #2 FAILED at 11683.
2 out of 2 hunks FAILED -- saving rejects to file chan_sip.c.rej

I am trying to do this on my trixbox distro that has asterisk 1.4.22. Trixbox doesn't include sources, so I downloaded the sources from digium.

I'll keep hacking away at it.

Could someone possible post their recompiled chan_sip.so for 1.4.22?

Posted: Sat Aug 22, 2009 4:44 pm
by pagemen
bent wrote:Hi!
To pagemen
I think the first part of patch (check_auth) is not need, it's used only for incoming authentications with your peers.
And there is a little bug in code: variable newnonce is longer than necessary, it's need cut :)

Code: Select all

for (i = 0; i < 8; i++) {
                       hex[0] = newnonce[i];
                       int x = strtol(hex, NULL, 16);
                       *c++ = callid[x];
                       }
*c++ = 0;
^^^^^^^
Now working on incoming/outgoing calls w/o mjproxy.
First part is necessary or you'll see "Got 200 OK on REGISTER that isn't a register" warning message in log -- basically, server accepts our new md5 hash and return "200 OK" but Asterisk still checks the value against old routine thus thinks the return value is wrong.

And thanks for pointing out "*c++ = 0" part, will update the first post later. Seems that one works because the complier initializes all elements in the char array with '\0'...

Posted: Sat Aug 22, 2009 5:00 pm
by bent
pagemen wrote:
First part is necessary or you'll see "Got 200 OK on REGISTER that isn't a register" warning message in log -- basically, server accepts our new md5 hash and return "200 OK" but Asterisk still checks the value against old routine thus thinks the return value is wrong.
About message "Got 200..." see, for example: http://forum.voxilla.com/asterisk-suppo ... 23269.html

I noticed magicjack not required auth on Registry, only on Invite.

Posted: Sat Aug 22, 2009 5:02 pm
by pagemen
lowno wrote:I am working on it as per the instructions, I am currently stuck with at the following error in terminal:

File to patch: chan_sip.c
patching file chan_sip.c
Hunk #1 FAILED at 8535.
patch unexpectedly ends in middle of line
Hunk #2 FAILED at 11683.
2 out of 2 hunks FAILED -- saving rejects to file chan_sip.c.rej

I am trying to do this on my trixbox distro that has asterisk 1.4.22. Trixbox doesn't include sources, so I downloaded the sources from digium.

I'll keep hacking away at it.

Could someone possible post their recompiled chan_sip.so for 1.4.22?
Seems that you have some problem when retrieving the patch. Also please notice that, the original code using TAB for indent while the forum converts all TABs to spaces when posting the code, and the patch might fail when you c/p directly from the post. Try to use "patch -l" instead of "patch" when applying it.

Posted: Sat Aug 22, 2009 5:15 pm
by pagemen
bent wrote:
pagemen wrote:
First part is necessary or you'll see "Got 200 OK on REGISTER that isn't a register" warning message in log -- basically, server accepts our new md5 hash and return "200 OK" but Asterisk still checks the value against old routine thus thinks the return value is wrong.
About message "Got 200..." see, for example: http://forum.voxilla.com/asterisk-suppo ... 23269.html

I noticed magicjack not required auth on Registry, only on Invite.
I'm not familar with * code, so whatever :) Anyway, is there any side effect by adding the first part? if not, maybe we can just leave it there?

Posted: Sat Aug 22, 2009 5:31 pm
by lowno
Thanks for the tip. i think it patched correctly. I fixed the tabs, then tried it with the "patch -l". I received the following response, but no error;s or anything like that.

patching file chan_sip.c
Hunk #1 succeeded at 8907 (offset 372 lines).
patch unexpectedly ends in middle of line
Hunk #2 succeeded at 11803 with fuzz 1 (offset 120 lines).

I am stuck at the compiling part now. I went up a directory and ran "make all 2>&1|tee /tmp/make.all", but get the following response:
make: *** No rule to make target `all'. Stop.

Thanks for all the help. I really appreciate it. I am trying to find a solution via google, sometimes it is a lot faster to just ask the experts.
pagemen wrote:
lowno wrote:I am working on it as per the instructions, I am currently stuck with at the following error in terminal:

File to patch: chan_sip.c
patching file chan_sip.c
Hunk #1 FAILED at 8535.
patch unexpectedly ends in middle of line
Hunk #2 FAILED at 11683.
2 out of 2 hunks FAILED -- saving rejects to file chan_sip.c.rej

I am trying to do this on my trixbox distro that has asterisk 1.4.22. Trixbox doesn't include sources, so I downloaded the sources from digium.

I'll keep hacking away at it.

Could someone possible post their recompiled chan_sip.so for 1.4.22?
Seems that you have some problem when retrieving the patch. Also please notice that, the original code using TAB for indent while the forum converts all TABs to spaces when posting the code, and the patch might fail when you c/p directly from the post. Try to use "patch -l" instead of "patch" when applying it.

Posted: Sat Aug 22, 2009 6:12 pm
by bent
I am stuck at the compiling part now. I went up a directory and ran "make all 2>&1|tee /tmp/make.all", but get the following response:
make: *** No rule to make target `all'. Stop.
Try simple "make".
I'm not familar with * code, so whatever Smile Anyway, is there any side effect by adding the first part? if not, maybe we can just leave it there?
No any side effect, except for extra code :)

Posted: Sat Aug 22, 2009 6:23 pm
by lowno
So I realized that the distro didn't have a compiler. Ran yum install gcc-c++ to get the compiler. The ran the make and got a gagillion errors. I would post it the output, but it would seriously annoy anyone looking at this thread. I think I may give up on this one.

Thanks for all the help guys.
bent wrote:
I am stuck at the compiling part now. I went up a directory and ran "make all 2>&1|tee /tmp/make.all", but get the following response:
make: *** No rule to make target `all'. Stop.
Try simple "make".
I'm not familar with * code, so whatever Smile Anyway, is there any side effect by adding the first part? if not, maybe we can just leave it there?
No any side effect, except for extra code :)

Posted: Sun Aug 23, 2009 4:52 pm
by VaHam
lowno wrote:So I realized that the distro didn't have a compiler. Ran yum install gcc-c++ to get the compiler. The ran the make and got a gagillion errors. I would post it the output, but it would seriously annoy anyone looking at this thread. I think I may give up on this one.

Thanks for all the help guys.
bent wrote:
I am stuck at the compiling part now. I went up a directory and ran "make all 2>&1|tee /tmp/make.all", but get the following response:
make: *** No rule to make target `all'. Stop.
Try simple "make".
I'm not familar with * code, so whatever Smile Anyway, is there any side effect by adding the first part? if not, maybe we can just leave it there?
No any side effect, except for extra code :)
I am a linux newbie but the makefile which gives instructions for make may be the problem. The reason for running make from /usr/src/asterisk is because that is where the makefile is stored at least in my distro. Could there be some cross up between your original makefile and one which would be appropriate for the new 1.4.22 asterisk version?

Posted: Mon Aug 24, 2009 2:30 am
by completetech
I guess i am just a little slow when it comes to some Asterisk CLI.

I had this working. then I proceeded to clean up my AvantFax install by finishing configuring it. did a reboot and BAM... now the MJ's don't work.


I just dont get it.

i am getting a 400 response / congestion back!

anybody got a clue as to wtf happened?

I cant seem to find anything. so what I did is copy the old file back. then start all over with the last post of the first page of this thread. as it says it was updated.

I am running PIAF
Asterisk 1.4.21.2 and of course it has CentOS 5. on it.

thanks for the help! :?: :shock: :?: :shock:

Posted: Mon Aug 24, 2009 4:36 am
by VaHam
completetech wrote:I guess i am just a little slow when it comes to some Asterisk CLI.

I had this working. then I proceeded to clean up my AvantFax install by finishing configuring it. did a reboot and BAM... now the MJ's don't work.


I just dont get it.

i am getting a 400 response / congestion back!

anybody got a clue as to wtf happened?

I cant seem to find anything. so what I did is copy the old file back. then start all over with the last post of the first page of this thread. as it says it was updated.

I am running PIAF
Asterisk 1.4.21.2 and of course it has CentOS 5. on it.

thanks for the help! :?: :shock: :?: :shock:
The congestion error shows up when MJ is not getting authorized. Just a guess but sounds like during your cleanup you reverted to a old chan_sip.so perhaps.

The last post of the first page is a patch for Asterisk ver 1.4.15 and is updated as noted but still only applies for version 1.4.15. I am going to go add a second notice at the bottom of the post regarding that that post applies to version 1.4.15.

If your running Asterisk version 1.4.21.2 the updated patch for version 1.4.21 is in the first post of the thread. pagemen has been keeping the first post updated with fixes for the later versions there.

I don't think the patch for ver 1.4.15 could have been applied to ver 4.1.21.2 successfully. Didn't you get errors when applying the patch and recompiling?

How did you wind up with Asterisk version 1.4.21.2 as your Asterisk version in PIAF? My PIAF install admittedly was done many months ago, but has been updated to FreePBX 2.5.1.5 using the automated update features. The updates are all current and have only brought Asterisk up to version 1.4.15 on my system. Did you manually upgrade Asterisk outside of the FreePBX update system or something? The reason I ask is because the only reason I posted the patch for the older version is because I believe the very popular PIAF distro is not yet up to the latest version of Asterisk yet even with all current automatic updates applied.

Posted: Mon Aug 24, 2009 4:48 am
by completetech
i just run the updates as directed on pbxinaflash.com/forum

i have ver 1.4.21.2

I ran all the commands again and copied the entire part of the code.

I just dont get how it was just fine and now after a reboot it is toast!!!!

any ideas

I guess can you maybe walk me through it again like the idiot i am. maybe the lack of sleep is wtf the issue is. lol....

if you got a step by step idea that would be great!

Posted: Mon Aug 24, 2009 11:36 am
by VaHam
completetech wrote:i just run the updates as directed on pbxinaflash.com/forum

i have ver 1.4.21.2

I ran all the commands again and copied the entire part of the code.

I just dont get how it was just fine and now after a reboot it is toast!!!!

any ideas

I guess can you maybe walk me through it again like the idiot i am. maybe the lack of sleep is wtf the issue is. lol....

if you got a step by step idea that would be great!
I posted as close to step by step as I know of IN THIS POST EARLIER for applying the patch.

If you scroll back in the thread you can see my PBXIAF setup which works as well.

By the entire part of the code do you mean you tried it again with pagmen's code in the first post of this thread? Did you get any errors during the patch or recompile?

Posted: Mon Aug 24, 2009 2:32 pm
by pagemen
run "strings chan_sip.so | grep talk4free.com"
to check if the binary is patched or not.

Posted: Mon Aug 24, 2009 4:06 pm
by completetech
ok I will give that a try when i get back to the office where it is at.

if not then how should I start all over and re-patch it?

I would really love to get this going so that I can use a MJ as a specific trunk for something.

thanks a bunch guys for all of yer work in getting this going.

Posted: Mon Aug 24, 2009 8:21 pm
by VaHam
completetech wrote:ok I will give that a try when i get back to the office where it is at.

if not then how should I start all over and re-patch it?

I would really love to get this going so that I can use a MJ as a specific trunk for something.

thanks a bunch guys for all of yer work in getting this going.
chan_sip.so should be in two places if all is well.

/usr/src/asterisk/channels/chan_sip.so

and

/usr/lib/asterisk/modules/chan_sip.so

The latter is the one Asterisk uses at run time.

Posted: Mon Aug 24, 2009 8:43 pm
by completetech
so bad news is that it is located in both.

any quick run down of how to start all over and get it going again. I am a little lost here!

Posted: Mon Aug 24, 2009 9:48 pm
by completetech
VaHam wrote:
completetech wrote:i just run the updates as directed on pbxinaflash.com/forum

i have ver 1.4.21.2

I ran all the commands again and copied the entire part of the code.

I just dont get how it was just fine and now after a reboot it is toast!!!!

any ideas

I guess can you maybe walk me through it again like the idiot i am. maybe the lack of sleep is wtf the issue is. lol....

if you got a step by step idea that would be great!
I posted as close to step by step as I know of IN THIS POST EARLIER for applying the patch.

If you scroll back in the thread you can see my PBXIAF setup which works as well.

By the entire part of the code do you mean you tried it again with pagmen's code in the first post of this thread? Did you get any errors during the patch or recompile?
yes i re-ran it.

what I did was remove teh newly edited version. then started all over. I am still getting a error 400 and congestion

Posted: Mon Aug 24, 2009 11:04 pm
by pagemen
Quick checklist:

1. strings /usr/lib/asterisk/modules/chan_sip.so | grep talk4free.com

you should see an output of "talk4free.com" so you know the chan_sip.so is patched

2. Use mjmd5/mjproxy with ATA or softphone to check if the password is correct and unchanged

3. If both look good, post your configuration and see if someone can get a hint on it.

Posted: Mon Aug 24, 2009 11:12 pm
by completetech
I guess that from the few hours I had it working the password could have changed. I doubt it though. possible.

at this point I guess it is off to the router proxy add-on in order to get it to work. :(

Posted: Mon Aug 24, 2009 11:18 pm
by mykroft
completetech wrote:I guess that from the few hours I had it working the password could have changed. I doubt it though. possible.

at this point I guess it is off to the router proxy add-on in order to get it to work. :(
check your PM's - I can walk you thru this either via MSN or a MJ call - let me know

Posted: Thu Aug 27, 2009 12:06 am
by completetech
slightly off topic.... but now for some reason i can not do

areacode+NXXXXXX and have it allow me 7 digit dialing..

any idea?

Posted: Thu Aug 27, 2009 5:32 am
by mykroft
completetech wrote:slightly off topic.... but now for some reason i can not do

areacode+NXXXXXX and have it allow me 7 digit dialing..

any idea?
try 1|areacodeNXXNXXXX

or 1NXXNXXNXXXX

to force a 1 dial?

Posted: Thu Aug 27, 2009 8:06 am
by completetech
no i mean i want to dial seven digits.

i.e.... 222-2222

so my dial rule should look like

123+NXXXXXX
so that it passes
123-222-2222 when ?i dial 222-2222

but when i do that like I did before when it worked it will not let it pass

Posted: Thu Aug 27, 2009 4:13 pm
by mykroft
check your dial patterns on BOTH your trunks and outbound routes.

I dont use them on the trunks, i configure mine in the outbound routes so I can pick what trunk I need by how i dial

Posted: Thu Aug 27, 2009 9:54 pm
by completetech
i tried it that way and still get the message of your call can not be completed please try again later

Posted: Thu Aug 27, 2009 10:41 pm
by mykroft
I will try it when I get home

Posted: Fri Aug 28, 2009 3:06 pm
by DarwinPeru
lowno wrote:I am stuck at the compiling part now. I went up a directory and ran "make all 2>&1|tee /tmp/make.all", but get the following response:
make: *** No rule to make target `all'. Stop.
Sorry if my english is not good, but Iowno: where are you doing make all 2>&1|tee /tmp/make.all ???

You have eject that in : The asterisk source directory (/usr/src/asteriskxxxx)

bye

Thanks

Posted: Fri Aug 28, 2009 3:18 pm
by DarwinPeru
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.

now I can use my 5 MJ´s in the same time.

thanks

but....

I have a problem, I can´t to recive calls, I can make calls but I can´t recive calls, some one know why????????

my SIP:

register => ENUMBER01:[email protected]:5070/1234


[magicjack]
context=Gerente
username=ENUMBER01
type=friend
secret=XXXPASSWORDXXX
port=5070
nat=yes
insecure=very
host=proxy1.SanFrancisco.talk4free.com
fromuser=ENUMBER01
dtmfmode=inband
qualify=2500
dtmfmode=rfc2833
;disallow=all
;allow=g729


MY EXTENSIONS.CONF:

[Gerente]

exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@magicjack,30,tTr)
exten => _1NXXNXXXXXX,2,congestion()
exten => _1NXXNXXXXXX,102,busy()
exten => i,1,Hangup()
exten => t,1,Hangup()
exten => h,1,Hangup()


exten => 1234,1,Answer
exten => 1234,2,Dial(SIP/200,30,Ttr)
exten => 1234,3,Hangup()


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


Please Help me...

Thanks a lot from Lima Perú

Posted: Fri Aug 28, 2009 3:50 pm
by mykroft
On my inbound routes I had to add E and 01 to my DID number, dunno when MJ starting doing this - but it has changed....

Re: Thanks

Posted: Sat Aug 29, 2009 1:15 pm
by VaHam
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.

Posted: Fri Sep 04, 2009 7:16 am
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.

Re: Thanks

Posted: Fri Sep 04, 2009 2:28 pm
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

Problems with Registration

Posted: Sat Sep 05, 2009 1:33 am
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!

Posted: Sat Sep 05, 2009 2:21 pm
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.

Posted: Sun Sep 27, 2009 12:01 pm
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.

Patch not working for me...

Posted: Wed Oct 07, 2009 2:19 pm
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.

Re: Patch not working for me...

Posted: Thu Oct 08, 2009 5:01 am
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.

How did dtm get the new algorithm?

Posted: Thu Oct 08, 2009 8:59 am
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

Re: How did dtm get the new algorithm?

Posted: Thu Oct 08, 2009 9:24 am
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

Posted: Sat Oct 10, 2009 12:14 am
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

Posted: Sat Oct 10, 2009 4:34 am
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?

Posted: Sat Oct 10, 2009 4:50 pm
by vicos
well my version is plain asterisk 1.4.18.1 , don't know what the problem seems to be...


Thanks

Posted: Sun Oct 11, 2009 5:01 am
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?

Posted: Sun Oct 11, 2009 2:28 pm
by vicos
Well, I used the one in the first page, would the one in the bottom of the page work for me?


Thanks

Posted: Sun Oct 11, 2009 3:20 pm
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.