本文整理汇总了Python中KSR.is_BYE方法的典型用法代码示例。如果您正苦于以下问题:Python KSR.is_BYE方法的具体用法?Python KSR.is_BYE怎么用?Python KSR.is_BYE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KSR
的用法示例。
在下文中一共展示了KSR.is_BYE方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ksr_route_withindlg
# 需要导入模块: import KSR [as 别名]
# 或者: from KSR import is_BYE [as 别名]
def ksr_route_withindlg(self, msg):
if KSR.siputils.has_totag()<0 :
return 1;
# sequential request withing a dialog should
# take the path determined by record-routing
if KSR.rr.loose_route()>0 :
if self.ksr_route_dlguri(msg)==-255 :
return -255;
if KSR.is_BYE() :
# do accounting ...
KSR.setflag(FLT_ACC);
# ... even if the transaction fails
KSR.setflag(FLT_ACCFAILED);
elif KSR.is_ACK() :
# ACK is forwarded statelessly
if self.ksr_route_natmanage(msg)==-255 :
return -255;
elif KSR.is_NOTIFY() :
# Add Record-Route for in-dialog NOTIFY as per RFC 6665.
KSR.rr.record_route();
self.ksr_route_relay(msg);
return -255;
if KSR.is_ACK() :
if KSR.tm.t_check_trans() >0 :
# no loose-route, but stateful ACK;
# must be an ACK after a 487
# or e.g. 404 from upstream server
self.ksr_route_relay(msg);
return -255;
else:
# ACK without matching transaction ... ignore and discard
return -255;
KSR.sl.sl_send_reply(404, "Not here");
return -255;