[OpenSIPS-Users] Dialog creation problem

ASHWINI NAIDU ashwini.naidu at gmail.com
Thu Apr 2 09:10:13 CEST 2009


yes i do call the call_control function on the first invite.


Here is the piece ot code
#-------------------------Dialog Params---------------------------
modparam("dialog", "db_url", "mysql://opensips:opensipsrw@localhost
/opensips")
modparam("dialog", "db_mode", 1)
modparam("dialog", "dlg_flag", 5)

#---------------Call Control---------------------
modparam("call_control", "disable", 0)
modparam("call_control", "signaling_ip_avp", "$avp(s:signaling_ip)")

route{
    #^M
    # -- 1 -- Request Validation ^M
    #^M
    if (!mf_process_maxfwd_header("10")) {^M
        sl_send_reply("483","Too Many Hops");^M
        exit;^M
    };^M
    if (msg:len >=  2048 ) {^M
        sl_send_reply("513", "Message too big");^M
        exit;^M
    };^M
    #^M
    # -- 2 -- Routing Preprocessing^M
    #^M
    ## Record-route all except Register^M
    ## Mark packets with nat=yes^M
    ## This mark will be used to identify the request in the loose   ^M
    ## route section^M
    if(!is_method("REGISTER")){^M
        if(nat_uac_test("19")){^M
            record_route(";nat=yes");^M
        } else {^M
            record_route();^M
        };^M
    };^M

    ##Loose_route packets^M
    if (has_totag()) {^M
        #sequential request withing a dialog should^M
        # take the path determined by record-routing^M
        if (loose_route()) {^M
#---------------------------RADIUS
LOGING----------------------------------------#
                if(method=="BYE") {
        #               #Account BYE transactions
                        log(1,"\nFLAG IS SET TO 2\n");
                        setflag(1);
                        ## for free radius logging
                        setflag(3);
                        setflag(20);     # For sip trace;
                };

#------------------------END OF RADIUS
LOGING------------------------------------#


            #Check authentication of re-invites^M
            if(method=="INVITE" && (!allow_trusted())) { ^M
                if (!proxy_authorize("","subscriber")) {^M
                   proxy_challenge("","1");^M
                   exit;^M
                } else if (!check_from()) {^M
                   sl_send_reply("403", "Forbidden, use From=ID");^M
                   exit;^M
                };^M
            };^M
            if(method=="BYE" || method=="CANCEL") {^M
                 unforce_rtp_proxy();
                 #end_media_session();^M
            };^M
            ##Detect requests in the dialog behind NA, flag with 6^M
            if(nat_uac_test("19") || search("^Route:.*;nat=yes")){^M
                append_hf("P-hint: LR|fixcontact,setflag6\r\n");^M
                fix_contact();^M
                setbflag(6);^M
            };^M
            route(1);^M
        } else {^M
            sl_send_reply("404","Not here");^M
        }^M
        exit;^M
    }^M
    #CANCEL processing^M
    if (is_method("CANCEL")) {^M
        if (t_check_trans()) {^M
            unforce_rtp_proxy();
            #end_media_session(); ^M
            t_relay();^M
        };   ^M
            exit;^M
      }^M
    t_check_trans();^M
    # ^M
    # -- 3 -- Determine Request Target^M
    #^M
    if (method=="REGISTER") {^M
    log(1,"--------REGISTER LOOP IN MAIN ROUTE\n");^M
        route(2);^M
    } else {^M
         if ((method=="INVITE" && !has_totag())) {
                setflag(5);
                # you need to call this function at the first INVITE
                $var(retcode) = call_control();
                switch ($var(retcode)) {

                case -1:
                       # Not enough credit (prepaid call)
                       xlog("L_INFO", "Call control: not enough credit for
prepaid call\n");
                       acc_rad_request("402");
                       sl_send_reply("402", "Not enough credit");
                       exit;
                       break;
                case -2:
                       # Locked by call in progress (prepaid call)
                       xlog("L_INFO", "Call control: prepaid call locked by
another call in progress\n");
                       acc_rad_request("403");
                       sl_send_reply("403", "Call locked by another call in
progress");
                       exit;
                       break;

                case 1:
                       # Call with a limit under callcontrol management
(either prepaid or postpaid)
                        break;

                case 2:
                        xlog("L_INFO", "Call control: Inside 2 for post
paid\n");
                       # Call with no limit
                        break;

               default:
                       # Internal error (message parsing, communication,
...)
                       xlog("L_INFO", "Call control: internal server
error\n");
                       acc_rad_request("500");
                       sl_send_reply("500", "Internal server error");
                       exit;
                }
         }
        route(3);^M
    };^M
}


But how can i change the permissions for mi_connector. Please mention if i
have to add or modify anything in the code

On Thu, Apr 2, 2009 at 12:28 PM, Dan Pascu <dan at ag-projects.com> wrote:

> On Thursday 02 April 2009, ASHWINI NAIDU wrote:
> > hi all,
> >    I have installed opensips-1.5 with cdrtool-6.7.5 and call controller
> > working with it. when a prepaid call is made the real time call cut-off
> > doesn't happen when the balance tends to nil or low. i get the
> > following warning on opensips
> >
> > *WARNING:call_control:postprocess_request: dialog to trace controlled
> > call was not created. discarding callcontrol.*
> >
> > The following errors w.r.t call controller
> >
> > *Mar 30 15:01:08 debian call-control[6468]: error: failed to end
> > dialog: OpenSIPS command did timeout
> >
> > Mar 30 15:02:13 debian call-control[6468]: error: failed to end dialog:
> > :dlg_end_dlg:*
>
> The opensips unix datagram mi interface is not available or you do not
> have the rights to use it.
>
> >
> > can any one help me out with this problem. How i can create a dialog.
>
> The dialog is created automatically for you by t_relay(), if you loaded
> the dialog module and configured it.
> Do you call call_control() on the 1st INVITE (and only then)?
>
> --
> Dan
>



-- 
Thanking You,
Ashwini BR Naidu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090402/87b4b5ed/attachment.htm 


More information about the Users mailing list