registration successful, but dialing fails

2010-08-09
2013-05-09
  • slowmotion85
    slowmotion85
    2010-08-09

    hello everyone
    i installed opensips 1.6.0 on debian lenny, where i already have asterisk running with a real time database fetched from mysql.

    i also configured opensips to use a mysql database.

    after starting opensips, my two hard sip phones and & softphone on a local network are registering fine, although the "opensips" database is empty!! so maybe i don't understand where does opensips look for registering users. my sip.conf in asterisk contains the info, but it's commented so that asterisk uses the mysql database. i also tried to shut down asterisk, and try to register users with opensips, that also worked fine! (users are registered)

    another issue is, opensips isn't seeing the extensions i have defined for asterisk. so when i dial an extension, i always get a "call failed: not found"

    can anyone help on this issue plz?

    thank you

     
  • slowmotion85
    slowmotion85
    2010-08-09

    i just ran some other tests concerning the first problem (registered users). apparently, opensips is accepting to register any user that tries to register with it!!!

     
  • slowmotion85
    slowmotion85
    2010-08-09

    UPDATE
    i can call users, but i have to call them using their sip names, not their asterisk defined extensions. can anyone help on how i can make opensips "see" the extensions?

    on the other hand, i'm still having the registration problem. i also tried registering with an incorrect password, and registration was successful

     
  • Hi,

    If you do not do authentication for incoming registrations and calls, anybody can register or make calls through your opensips - you need to enable authentication and to populate the subscriber table with your users

    Regarding the asterisk extensions, there is no automagic way of making opensips to see the asterisk extensions, but you can configure the extensions (over real users in opensips) using aliases - see the aliases_db module - this module is used in the default opensips cfg.

    Regards,
    Bogdan

     
  • slowmotion85
    slowmotion85
    2010-08-10

    hi bogdan
    i resolved the registration module this morning, as u said the authentication wasn't enabled!!

    about the extensions, is there a way to tell opensips to route calls to asterisk if opensips can't find the dialed sip name? this way, if i dial with the asterisk extension, opensips won't find a match in the users database, therefore forwards it to asterisk, and asterisk recognises the extension

    thanks for your help

     
  • You can change the user location logic - if the user is not registered with opensips, instead of doing "404 not found", you can send the call to Asterisk:

    if (!lookup("location")) {
        rewritehostport("Asterisk_IP:Asterisk_port");
    }

    regards,
    Bogdan

     
  • slowmotion85
    slowmotion85
    2010-08-10

    hi bogdan, and thanks again for your help
    i managed to route the calls to asterisk by using this script:
    if ($rU=~"\*)
    {
    strip(1);
    rewritehostport("ASTERISK_IP:ASTERISK_PORT");
                            t_relay();
                            exit;
    }

    works like a charm, the only problem is, i think my asterisk has gone crazy lol
    it's receiving extensions, but unable to dial them "everyone is congested or busy"
    anyway, the problem is in asterisk now, so that's a progress :)
    thanks bogdan

     
  • slowmotion85
    slowmotion85
    2010-08-11

    hi again bogdan
    so the problem was simple, asterisk was looking in the wrong database for sip users. so the old table (before integrating opensips) contained ip addresses to communicate directly to the phones. so i fixed this, and created a VIEW in mysql so that information regarding registered users can be viewed by asterisk.

    so this solved the issue "cannot create a sip channel", but i'm facing another problem:
    my configuration is like this:
    asterisk and opensips running on the same server. i also created a local network. on this network, i have two hardphones, and another machine on which i have two softphones.
    so all the phones register with OpenSIPS, and if i dial an extension that begins with a star-key, the call is automatically forwarded to asterisk. the problem is that calls fail when the callee is a hardphone. note that i can call from the hardphones to softphones, from softphones to softphones, but i can't call the hardphones. i get this message in asterisk:

    Got SIP response 480 "Temporarily Unavailable" back from 192.168.0.1
        - SIP/right-00000013 is circuit-busy

    so my  guess is that OpenSIPS is rejecting the call.
    any insight on this? thank you