[SR-Users] Trying to drop invite 200ok reply in onreply_route

Daniel-Constantin Mierla miconda at gmail.com
Mon Dec 13 12:45:37 CET 2010



On 12/3/10 4:40 PM, nikita wrote:
> [...]
>> You will send the BYE before the 200ok is sent to caller, so it will
>> get rejected most probably.
> To avoid that issue, I have tried to use :
>
> onreply_route {
> #!ifdef WITH_MEDIA_PROXY
>          if (is_method("INVITE")&&  status == "200") {
>                  use_media_proxy();
>                  if($rc) {
>                          xlog("L_ERR", "invite reply error $rc \n");
>                          t_reply("480","Temporarily Unavailable");
>                          drop();
>                  }
>          }
> #!endif
> }
>
> And I came across something odd :
> The t_reply("480","Temporarily Unavailable"); send a 480 reply to the
> caller who reply ACK.
> But it also send CANCEL to the callee, which is too late because the
> callee have already sent his 200OK.
>
> I'm trying to do the same thing with the dlg_bye("callee"); but I'm
> having a problem here too, the following route :
>
> onreply_route {
> #!ifdef WITH_MEDIA_PROXY
>          if (is_method("INVITE")&&  status == "200") {
>                  use_media_proxy();
>                  if($rc<  0) {
>                          xlog("L_ERR", "invite reply error $rc \n");
>                          if (dlg_get("$ci", "$tt", "$ft"))
>                          {
>                                  xlog("L_ERR", "dlg  found \n");
>                                  dlg_bye("callee");
>                          }
>
>                  }
>          }
> #!endif
> }
>
> generate me that error :
>
> Dec  3 15:49:06 uServer-SIP /usr/local/sbin/kamailio[10084]: ERROR:
> dialog [dlg_req_within.c:105]: no contact available
> Dec  3 15:49:06 uServer-SIP /usr/local/sbin/kamailio[10084]: ERROR:
> dialog [dlg_req_within.c:246]: failed to create dlg_t
>
> I think I have set correctly my dialog flag in my "route {}" route
> because if I comment the "setflag" line I have a dialog not found error
> instead.
>
> For information, dlg_bye("caller") doesn't give me that error message
> and send a bye request to the caller (which like you have said, isn't
> what I'm looking for).
>
> I digged a little in the source code of the contact module but I haven't
> found why my dlg_cell only contain the caller contact ... I will try to
> investigate further this weekend.
the dialog structure is not fully completed, since callee contact comes 
in 200 OK, still it is not yet handled by dialog module, so that's why 
you get error when trying to send BYE to callee.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
http://www.asipto.com




More information about the sr-users mailing list