[asterisk-users] * and mj
Jeff Jones
jeff.jjones at gmail.com
Wed Sep 1 11:15:43 CDT 2010
Hello all,
Has anyone have magicjack working with their asterisk? I had patched
chan_sip.c with some code that allows asterisk to do the md5 hash that mjmd5
proxy does. * shows that it is registered with magicjack, but incoming calls
are not even hitting my * box and outgoing calls get congestion. Here is my
relevant configs. I did do a ton of google searching, but it all points to
it should work. And I am stuck. I know my existing dial plan internally
works, as it already works with my GV and ipkall. Any links or suggestions
would be greatly appreciated.
Thanks.
A little snip of sip show peers
magicjack/Exxxxxxxxxx01 67.91.177.70 5070 OK (55 ms)
I get this in the CLI
-- Executing [12486323130 at home-sip-int-in:1]
Dial("SIP/jjonesip-00000006", "SIP/xxxxxxxxxxx at magicjack,30,r") in new stack
== Using SIP RTP CoS mark 5
== Using UDPTL CoS mark 5
-- Called xxxxxxxxxxx at magicjack
-- Got SIP response 480 "Temporarily Unavailable" back from 67.91.177.70
-- SIP/magicjack-00000007 is circuit-busy
Sip.conf
[general]
useragent=MagicJack/2.0.554f (SJ Labs) ; incase they look at
the UA of sip client
register =>
Exxxxxxxxxx01:xxxxxxxxxxxxxxxxxxx at proxy1.detroit.talk4free.com:5070/1100 at hom
e-sip-int-in
[magicjack]
context=home-sip-int-in
username=Exxxxxxxxxx01
authuser=Exxxxxxxxxx01
type=friend
secret=xxxxxxxxxxxxxxxxxxxx
port=5070
nat=no
insecure=port,invite
;host=67.106.133.198 ; idk was in a howto
host=proxy1.detroit.talk4free.com
;host=67.91.177.70 ; detroit proxy
;host=vms03.detroit.talk4free.com
;host=67.91.177.77 ; vms03.detroitproxy
useragent=MagicJack/2.0.554f (SJ Labs)
fromuser=Exxxxxxxxxx01
fromdomain=talk4free.com
dtmfmode=rfc2833
;dtmfmode=inband
qualify=2000
canreinvite=no
disallow=all
allow=ulaw
t38pt_udptl = no
And the code I used to patch chan_sip.c
--- 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
@@ -8535,6 +8535,32 @@
ast_md5_hash(a2_hash, a2);
snprintf(resp, sizeof(resp), "%s:%s:%s", a1_hash, usednonce,
a2_hash);
ast_md5_hash(resp_hash, resp);
+
+
+ /* To a Magicjack domain */
+ if (strstr(uri,"talk4free.com"))
+ {
+ char callid[256];
+ char newnonce[256];
+ char *c;
+ int i;
+ ast_copy_string(callid, p->callid, sizeof(callid));
+ ast_copy_string(newnonce, p->nonce, sizeof(newnonce));
+
+ strcat(newnonce, "_");
+ c = newnonce + strlen(newnonce);
+ char hex[2];
+ hex[1] = 0;
+ for (i = 0; i < 8; i++) {
+ hex[0] = newnonce[i];
+ int x = strtol(hex, NULL, 16);
+ *c++ = callid[x];
+ }
+ *c++ = 0;
+
+ snprintf(resp,sizeof(resp),"%s:%s:%s", a1_hash, newnonce,
a2_hash);
+ ast_md5_hash(resp_hash, resp);
+ }
}
good_response = keys[K_RESP].s &&
@@ -11658,6 +11684,31 @@
snprintf(resp,sizeof(resp),"%s:%s:%s", a1_hash, p->nonce,
a2_hash);
ast_md5_hash(resp_hash, resp);
+ /* To a Magicjack domain */
+ if (strstr(uri,"talk4free.com"))
+ {
+ char callid[256];
+ char newnonce[256];
+ char *c;
+ int i;
+ ast_copy_string(callid, p->callid, sizeof(callid));
+ ast_copy_string(newnonce, p->nonce, sizeof(newnonce));
+
+ strcat(newnonce, "_");
+ c = newnonce + strlen(newnonce);
+ char hex[2];
+ hex[1] = 0;
+ for (i = 0; i < 8; i++) {
+ hex[0] = newnonce[i];
+ int x = strtol(hex, NULL, 16);
+ *c++ = callid[x];
+ }
+ *c++ = 0;
+
+ snprintf(resp,sizeof(resp),"%s:%s:%s", a1_hash, newnonce,
a2_hash);
+ ast_md5_hash(resp_hash, resp);
+ }
+
/* only include the opaque string if it's set */
if (!ast_strlen_zero(p->opaque)) {
snprintf(opaque, sizeof(opaque), ", opaque=\"%s\"", p->opaque);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100901/8270d823/attachment.htm
More information about the asterisk-users
mailing list