[Asterisk-Dev] chan_sip.c patch for QSC (sip-provider) SIP2.0 401 Unauthorized on Server: Sip EXpress router

asterisk-dev at mindmirror.de asterisk-dev at mindmirror.de
Tue Jul 12 11:24:43 MST 2005


 Hello list...
My German sip provider qsc.de has sip registration trouble with cvs version 

 qsc.patch from www.heise.de  works fine for bristuffed Asterisk 1.07 and 1.09 :-) my sip line works



digging around i've found that code already in cvs, but with a little diffrence
qop=\"%s\",  instead of qop=auth, changing it gives me an compile error

chan_sip.c: In function `build_reply_digest':
chan_sip.c:7893: warning: too many arguments for format
(stops here)

is there an option that i could use asterisk-cvs with qsc? some sip debug below :-(


 thanks 
 jens

sunny greetings from Berlin


qsc.patch from www.heise.de :
--- asterisk/channels/chan_sip.c 2005-05-17 14:11:58.000000000 +0200
+++ asterisk/channels/chan_sip.c 2005-05-17 14:11:58.000000000 +0200
                     
}
}
}
- strncat(a, "a=silenceSupp:off - - - -\r\n", sizeof(a) - strlen(a) - 1);

+/* strncat(a, "a=silenceSupp:off - - - -\r\n", sizeof(a) - strlen(a) - 1); */
if (strlen(m) < sizeof(m) - 2)
strncat(m, "\r\n", sizeof(m) - strlen(m) - 1);
if (strlen(m2) < sizeof(m2) - 2)
                     
md5_hash(resp_hash,resp);
/* XXX We hard code our qop to "auth" for now. XXX */
if (!ast_strlen_zero(p->qop))

- snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\", qop=\"%s\", cnonce=\"%s\", nc=%s",p->authname,p->realm,uri,p->nonce,resp_hash, p->opaque, "auth", cnonce, "00000001");

+ snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\", qop=auth, cnonce=\"%s\", nc=%s",p->authname,p->realm,uri,p->nonce,resp_hash, p->opaque, cnonce, "00000001");
else
snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\"",p->authname,p->realm,uri,p->nonce,resp_hash, p->opaque);




some sip debug

Jul 12 15:14:06 NOTICE[32600]: chan_sip.c:4587 sip_reregister: -- Re-registration for 01234567 at sip.qsc.de
11 headers, 0 lines
Reliably Transmitting (no NAT) to 213.148.136.2:5060:
REGISTER sip:sip.qsc.de SIP/2.0
Via: SIP/2.0/UDP 212.202.47.11:5060;branch=xyzabcde
From: <sip:01234567 at sip.qsc.de>;tag=as614f0a8c
To: <sip:01234567 at sip.qsc.de>
Call-ID: xyzabcde at 192.168.111.43
CSeq: 102 REGISTER
User-Agent: Asterisk PBX
Expires: 120
Contact: <sip:11 at 212.202.47.11>
Event: registration
Content-Length: 0

---
Urgent handler
<-- SIP read from 213.148.136.2:5060:
SIP/2.0 401 Unauthorized
From: <sip:01234567 at sip.qsc.de>;tag=as614f0a8c
To: <sip:01234567 at sip.qsc.de>;tag=7ee2a592
CSeq: 102 REGISTER
Call-ID: xyzabcde at 192.168.111.43
Via: SIP/2.0/UDP 212.202.47.11:5060;branch=xyzabcde;rport=5060
Server: Sip EXpress router (0.10.99-dev0 (i386/linux))
Warning: 392 213.148.130.46:5060 "Noisy feedback tells: pid=6069 req_src_ip=213.148.136.66 req_src_port=12971 in_u
ri=sip:213.148.130.46:5060;user=phone out_uri=sip:213.148.130.46:5060;user=phone via_cnt==1"
WWW-Authenticate: Digest realm="qsc.de", nonce="xyz", qop="auth"
Content-Length: 0
--- (10 headers 0 lines)---
Responding to challenge, registration to domain/host name sip.qsc.de
12 headers, 0 lines
Reliably Transmitting (no NAT) to 213.148.136.2:5060:
REGISTER sip:sip.qsc.de SIP/2.0
Via: SIP/2.0/UDP 212.202.47.11:5060;branch=xyzfghij
From: <sip:01234567 at sip.qsc.de>;tag=as6ce1b699
To: <sip:01234567 at sip.qsc.de>
Call-ID: xyzabcde at 192.168.111.43
CSeq: 103 REGISTER
User-Agent: Asterisk PBX
Authorization: Digest username="01234567", realm="qsc.de", algorithm=MD5, uri="sip:sip.qsc.de", nonce="42d3cfc4
615d7....", response="cba52...", opaque="", qop="auth", cnonce="5e4
895a2", nc=00000001
Expires: 120
Contact: <sip:11 at 212.202.47.11>
Event: registration
Content-Length: 0




More information about the asterisk-dev mailing list