[INOC-DBA] net2phone and the Cisco 7960 phone

Martin J. Levy mahtin at mahtin.com
Tue Aug 12 14:11:02 PDT 2003


John,

You are correct!  The magic here is the "User-Agent:".  Here is a perl script that waits for the response from the proxy and prints it out.  When you say your an ATA box it works, but when your a "CSCO/4" (Cisco 7960) it does not work.  A good response looks like this (IP's and account # removed)...

SIP/2.0 407 Unauthorized
Via: SIP/2.0/UDP A.B.C.D:5060
From: <sip:831xxxyyyy at sip.net2phone.com;user=phone>
To: <sip:831xxxyyyy at sip.net2phone.com;user=phone>;tag=3f3947e8-11996
Call-ID: 1060718568msgto831xxxyyyy at A.B.C.D
CSeq: 101 REGISTER
Contact: "net2phone" <sip:66.33.146.12:5060>
User-Agent: Cisco ATA 186  v2.16 ata18x (030509a)
Proxy-Authenticate:  Digest realm="net2phone",nonce="FEFE5EFF1C2B6A56E1C1111AE1E91ED8"
Content-Length: 0

Once I knew what to look for I could find examples of good responses via Google.  I knew that Richard had played around with this earlier, but it's doomed to "fail". :-(

Now... how do I get this to work?  I know I can't patch the Cisco binary to change the string, but I can write a quick proxy in perl to do this.  :-)  I wonder if it will work?

Martin

-------------------------
#!/usr/bin/perl

use Socket;

#
# register_sip_phone ip_address_of_phone, ip_address_of_server, phone_number, user_agent
#
#
sub register_sip_phone {
        my $server_ip = shift;
        my $local_ip = shift;
        my $sip_phone_number = shift;
        my $user_agent = shift;

        my $tm, $call_id, $sip_message, $sip_reply, $port;

        $tm = time();
        $call_id = $tm ."msgto$sip_phone_number";

        my $sip_message="REGISTER sip:sip.net2phone.com SIP/2.0
Via: SIP/2.0/UDP $local_ip:5060
From: <sip:$sip_phone_number\@sip.net2phone.com;user=phone>
To: <sip:$sip_phone_number\@sip.net2phone.com;user=phone>
Call-ID: $call_id\@$local_ip
Date: Mon, 11 Aug 2003 23:59:59 GMT
CSeq: 101 REGISTER
User-Agent: $user_agent
Contact: <sip:$sip_phone_number\@$local_ip:5060;user=phone>
Content-Length: 0
Expires: 6000


";

        $port = 5060;

        $proto = getprotobyname('udp');
        socket(SOCKET, PF_INET, SOCK_DGRAM, $proto) || warn "socket $!\n";

        $paddr = sockaddr_in($port, $iaddr);
        bind(SOCKET, $paddr) || warn "bind $!\n";

        $phone_iaddr = inet_aton($server_ip);
        $phone_paddr = sockaddr_in($port, $phone_iaddr);

        send(SOCKET, $sip_message, 0, $phone_paddr) || warn "send $host $!\n";
        recv(SOCKET, $sip_reply, 2048, 0);

        printf "\n%s\n", $sip_reply;
}

sub main
{
        my $user_agent = "CSCO/4";
        my $user_agent = "Cisco ATA 186  v2.16 ata18x (030401a)";
        my $user_agent = "Cisco ATA 186  v2.16 ata18x (030509a)";

        register_sip_phone('66.33.146.12', 'A.B.C.D', '831xxxyyyy', $user_agent);
}

main();
exit(0);

---------------------------------------------------------------------------------
At 11:32 AM 8/12/2003 -0700, John Todd wrote:
>Martin -
>  While I cannot find reference to it, I seem to recall somewhere that someone tried getting Asterisk to work with net2phone, but it didn't work until they changed the User-Agent: string to say something like "User-Agent: Cisco ATA 186  v2.16 ata18x (030401a)" and then the service worked.  I cannot say with 100% certainty that this was the case, but that's what I seem to recall.  In other words, I think net2phone is incompatible with 79xx phones by artificial design.  Anyone may feel fre to correct this assertion if you have anything resembling proof - my memory is certainly capable of being flawed on this subject due to SIP overload.
>
>
>Previous discussion on inoc-dba:
>https://www.pch.net/pipermail/inoc-dba/2003-May/000557.html
>
>net2phone comments:
>http://web.net2phone.com/partnerships/distributors/product/broadband/
>
>JT
>
>
>At 7:24 AM -0700 8/12/03, Martin J. Levy wrote:
>>
>>I played around with trying to get the Cisco phone to register with net2phone.  Alas it didn't.  I can see the REGISTER packets going to sip.net2phone.com, but the response is just a 401 error and no further REGISTER packet, with the MD5'ed password is being sent.
>>
>>[debug snipped]
>>
>>...it has the "WWW-Authenticate:" response which kicks the phone into sending the md5'ed password.
>>
>>So... what's up with net2phone and or the Cisco 7960?  I'm running P0S3-04-3-00.
>>
>>I know the Net2Phone service works with an ATA186 or plenty of other boxes.
>>
>>The terse response from Net2Phone is shown below. :-)
>>
>>Thanks in advance,
>>
>>Martin
>>
>>----------------------------------------------------------------------
>> >From: billing at net2phone.com
>> >Subject: Re: 8314398346 -- Other [Case Num: 38015]
>>>To: net2phone at mahtin.com
>>>Date: Tue, 12 Aug 2003 06:47:32 -0400
>>>
>>>Dear Mr. Levy,
>>>
>>>Net2Phone services will not work with the Cisco 7960 SIP phone.
>>>
>>>Sincerely,
>>>
>>>Allen
>> >the Net2Phone Team
>_______________________________________________
>inoc-dba mailing list
>inoc-dba at pch.net
>https://www.pch.net/mailman/listinfo.cgi/inoc-dba



More information about the inoc-dba mailing list