yes i do call the call_control function on the first invite.<br><br><br>Here is the piece ot code<br>#-------------------------Dialog Params---------------------------<br>modparam("dialog", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")<br>
modparam("dialog", "db_mode", 1)<br>modparam("dialog", "dlg_flag", 5)<br><br>#---------------Call Control---------------------<br>modparam("call_control", "disable", 0)<br>
modparam("call_control", "signaling_ip_avp", "$avp(s:signaling_ip)")<br><br>route{<br> #^M<br> # -- 1 -- Request Validation ^M<br> #^M<br> if (!mf_process_maxfwd_header("10")) {^M<br>
sl_send_reply("483","Too Many Hops");^M<br> exit;^M<br> };^M<br> if (msg:len >= 2048 ) {^M<br> sl_send_reply("513", "Message too big");^M<br> exit;^M<br>
};^M<br> #^M<br> # -- 2 -- Routing Preprocessing^M<br> #^M<br> ## Record-route all except Register^M<br> ## Mark packets with nat=yes^M<br> ## This mark will be used to identify the request in the loose ^M<br>
## route section^M<br> if(!is_method("REGISTER")){^M<br> if(nat_uac_test("19")){^M<br> record_route(";nat=yes");^M<br> } else {^M<br> record_route();^M<br>
};^M<br> };^M<br><br> ##Loose_route packets^M<br> if (has_totag()) {^M<br> #sequential request withing a dialog should^M<br> # take the path determined by record-routing^M<br> if (loose_route()) {^M<br>
#---------------------------RADIUS LOGING----------------------------------------#<br> if(method=="BYE") {<br> # #Account BYE transactions<br> log(1,"\nFLAG IS SET TO 2\n");<br>
setflag(1);<br> ## for free radius logging<br> setflag(3);<br> setflag(20); # For sip trace;<br> };<br><br>#------------------------END OF RADIUS LOGING------------------------------------#<br>
<br><br> #Check authentication of re-invites^M<br> if(method=="INVITE" && (!allow_trusted())) { ^M<br> if (!proxy_authorize("","subscriber")) {^M<br>
proxy_challenge("","1");^M<br> exit;^M<br> } else if (!check_from()) {^M<br> sl_send_reply("403", "Forbidden, use From=ID");^M<br>
exit;^M<br> };^M<br> };^M<br> if(method=="BYE" || method=="CANCEL") {^M<br> unforce_rtp_proxy();<br> #end_media_session();^M<br>
};^M<br> ##Detect requests in the dialog behind NA, flag with 6^M<br> if(nat_uac_test("19") || search("^Route:.*;nat=yes")){^M<br> append_hf("P-hint: LR|fixcontact,setflag6\r\n");^M<br>
fix_contact();^M<br> setbflag(6);^M<br> };^M<br> route(1);^M<br> } else {^M<br> sl_send_reply("404","Not here");^M<br> }^M<br>
exit;^M<br> }^M<br> #CANCEL processing^M<br> if (is_method("CANCEL")) {^M<br> if (t_check_trans()) {^M<br> unforce_rtp_proxy();<br> #end_media_session(); ^M<br> t_relay();^M<br>
}; ^M<br> exit;^M<br> }^M<br> t_check_trans();^M<br> # ^M<br> # -- 3 -- Determine Request Target^M<br> #^M<br> if (method=="REGISTER") {^M<br> log(1,"--------REGISTER LOOP IN MAIN ROUTE\n");^M<br>
route(2);^M<br> } else {^M<br> if ((method=="INVITE" && !has_totag())) {<br> setflag(5);<br> # you need to call this function at the first INVITE<br> $var(retcode) = call_control();<br>
switch ($var(retcode)) {<br><br> case -1:<br> # Not enough credit (prepaid call)<br> xlog("L_INFO", "Call control: not enough credit for prepaid call\n");<br>
acc_rad_request("402");<br> sl_send_reply("402", "Not enough credit");<br> exit;<br> break;<br> case -2:<br>
# Locked by call in progress (prepaid call)<br> xlog("L_INFO", "Call control: prepaid call locked by another call in progress\n");<br> acc_rad_request("403");<br>
sl_send_reply("403", "Call locked by another call in progress");<br> exit;<br> break;<br><br> case 1:<br> # Call with a limit under callcontrol management (either prepaid or postpaid)<br>
break;<br><br> case 2:<br> xlog("L_INFO", "Call control: Inside 2 for post paid\n");<br> # Call with no limit<br> break;<br>
<br> default:<br> # Internal error (message parsing, communication, ...)<br> xlog("L_INFO", "Call control: internal server error\n");<br> acc_rad_request("500");<br>
sl_send_reply("500", "Internal server error");<br> exit;<br> } <br> }<br> route(3);^M<br> };^M<br>}<br><br><br>But how can i change the permissions for mi_connector. Please mention if i have to add or modify anything in the code<br>
<br><div class="gmail_quote">On Thu, Apr 2, 2009 at 12:28 PM, Dan Pascu <span dir="ltr"><<a href="mailto:dan@ag-projects.com">dan@ag-projects.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Thursday 02 April 2009, ASHWINI NAIDU wrote:<br>
> hi all,<br>
> I have installed opensips-1.5 with cdrtool-6.7.5 and call controller<br>
> working with it. when a prepaid call is made the real time call cut-off<br>
> doesn't happen when the balance tends to nil or low. i get the<br>
> following warning on opensips<br>
><br>
> *WARNING:call_control:postprocess_request: dialog to trace controlled<br>
> call was not created. discarding callcontrol.*<br>
><br>
> The following errors w.r.t call controller<br>
><br>
> *Mar 30 15:01:08 debian call-control[6468]: error: failed to end<br>
> dialog: OpenSIPS command did timeout<br>
><br>
> Mar 30 15:02:13 debian call-control[6468]: error: failed to end dialog:<br>
</div>> :dlg_end_dlg:*<br>
<br>
The opensips unix datagram mi interface is not available or you do not<br>
have the rights to use it.<br>
<div class="im"><br>
><br>
> can any one help me out with this problem. How i can create a dialog.<br>
<br>
</div>The dialog is created automatically for you by t_relay(), if you loaded<br>
the dialog module and configured it.<br>
Do you call call_control() on the 1st INVITE (and only then)?<br>
<br>
--<br>
<font color="#888888">Dan<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Thanking You,<br>Ashwini BR Naidu<br>