sip - MjSIP/AsteriskNOW 403 Forbidden - Wrong Password -
i struggling mjsip , right have problem registring sip client sip registrar (asterisknow distro : freepbx + asterisk + centos).
to perform register transaction used extendedinvitedialog class , extendedinvitedialoglistener interface, send first message request() , detect server's answer ondlgaltresponse() , answer ackwithanswer(). here's source code of ondlgaltresponse(invitedialog arg0, string arg1, int code, string arg3, string arg4, message resp) :
if (code==401){ if (resp.haswwwauthenticateheader()) { nonce = resp.getwwwauthenticateheader().getnonceparam(); realm = resp.getwwwauthenticateheader().getrealmparam(); authorizationheader ah = new authorizationheader("digest"); message.setcseqheader(message.getcseqheader().incsequencenumber()); viaheader vh=message.getviaheader(); string newbranch = sipprovider.pickbranch(); vh.setbranch(newbranch); message.removeviaheader(); message.addviaheader(vh); ah.addusernameparam(username); ah.addalgorithparam("md5"); ah.addrealmparam(realm); ah.addnonceparam(nonce); ah.adduriparam(uri); // string qop_options = resp.getwwwauthenticateheader().getqopoptionsparam(); // qop = (qop_options != null) ? "auth" : null; // ah.addqopparam(qop); digestauthentication x=new digestauthentication(resp.gettransactionmethod(), ah, null, passwd); string response = x.getresponse(); ah.addresponseparam(response); if (x.checkresponse()) log.d("mysip","check"); message.setauthorizationheader(ah); arg0.ackwithanswer(message); } }
and debug message :
notice[1595]chan_sip.c27725 handle_request_register : registration 'x' failed 'y' - wrong password
the checkresponse() not return true after generating response nonce parameter , given password ! sure username/secret combination correct asterisk's cli. md5 secret not activated : secret still stored plain text in sip.conf. problem md5 or server's extension ? should manually modify sip.conf file ? need create sip trunk ?
hopefully asterisk 403 forbidden chan_sip.c:27829 wrong password errors.
i've setup asterisk 11.4.0 on linux mint using outdated steps freepbx site. went except couldn't connect clients worked fine raspberry pi incrediblepbx version. kept changing think off using web interface , watching dreadful sip traces.
finally decided check @ cli level
sip show users
there nothing there, nada. changes freepbx doing dummy configuration files. copied on data asterisk , started working.
Comments
Post a Comment