0

I just installed Kamailio in one server and Asterisk in another. Asterisk loads it sipusers info from database which is in Kamailio server.

I don't know how to go further. How can I authenticate Asterisk users through Kamailio. I am trying to authenticate using a sipphone. But no luck.

I am missing alot here. I know we can add users using the following command

kamctl add username password

But I already have users in asterisk realtime db. Is there any difference? Awaiting your reply,

Thanks in advance,

Kasinath Kottukkal
  • 2,471
  • 4
  • 22
  • 28

2 Answers2

2

It is very hard to answer this question correctly.

For anderstand answer you need read info about how sip works and how authentificate in openser/kamailio/opensips work.

Most valuable probably will be kamailio turtorials page

But also you have read sip RFC and general info about asterisk(for example ORelly's "Asterisk the Future of telephony book"

There are no way give you more correct answer, becuase you not specify what exactly you want to get.

For general load balancing setup you need authentificate user on kamailio(user have kamailio ip in UA's) after that forward call to asterisk.

For use kamailio as main point(trunk) for multiple asterisk you need create authorization for your asterisk box and put that info in both kamailio(usualy subscribers table) and asterisk.

arheops
  • 15,544
  • 1
  • 21
  • 27
  • Hey, Thanks for your comment. I can authorize sip accounts in asterisk now. Do I need to add the same sip user and it secret key in Kamailio database? And after that what should I do with Kamailio? I had been following Kamailio's tutorials section for a while but can't work it out. – Kasinath Kottukkal Jan 14 '14 at 05:25
  • That depend of what exactly you need get. Kamailio REQUIRE understanding of SIP one *EXPERT* level – arheops Jan 14 '14 at 05:40
  • I setup Kamailio following this article. >> http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb. I added couple of user in Kamailio and I can see them in subscriber database. But if I try to configure it in Zoiper(softphone) it is not able to authenticate.: 401 Unauthorized. – Kasinath Kottukkal Jan 14 '14 at 07:42
  • You need also support in kamailio.conf – arheops Jan 14 '14 at 16:20
0

Also make sure that your password is not too long , as there is some md5/ha1 challenge that doesn't like passwords to be extremely long.

kamailio_4.3.1 64bit form source

Mir Dunaev
  • 21
  • 3
  • Had my password 32 chars long, and the challenge kept failing (was able to see it through debug messages). Reduced password to 11 chars and it authenticated successfully. – Mir Dunaev Aug 25 '15 at 13:24
  • Also, my error was 401, so I don't know how relevant my answer is. – Mir Dunaev Aug 25 '15 at 13:35
  • Another one. Also make sure that the ***kamcrtl*** config file (in the same directory as kamailio.cfg) has `SIP_DOMAIN` set to the domain that you use to connect your softphone to the kamailio proxy. This way next time when you use `kamcrtl add`, your new user would have correct realm. Realm is used by both: your softphone and kamailio to generate HA1 digest; this digest then used instead of the actual password. P.S make sure to delete old users form _subscriber_ SQL table. – Mir Dunaev Aug 25 '15 at 13:44
  • UPDATE: Just found out that column that stores password in SQL subscriber table has `varchar(25)` which means that any passwords that are longer than 25 chars would be truncated. – Mir Dunaev Aug 25 '15 at 13:53