Module: sip-router Branch: master Commit: a3fe154263bd4c94e53c55ea7af42cf6e1952cd5 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a3fe1542...
Author: Miklos Tirpak miklos@iptel.org Committer: Miklos Tirpak miklos@iptel.org Date: Fri Jul 10 15:58:17 2009 +0200
tm: check whether or not 100 response has already been sent
- Do not send the 100 Trying response when it has already been sent The script writer can do it for example before t_relay().
---
modules/tm/t_funcs.c | 5 +++-- modules/tm/t_suspend.c | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/tm/t_funcs.c b/modules/tm/t_funcs.c index aa7d1f4..33d141d 100644 --- a/modules/tm/t_funcs.c +++ b/modules/tm/t_funcs.c @@ -342,8 +342,9 @@ int t_relay_to( struct sip_msg *p_msg , struct proxy_l *proxy, int proto,
/* INVITE processing might take long, particularly because of DNS look-ups -- let upstream know we're working on it */ - if (p_msg->REQ_METHOD==METHOD_INVITE && (t->flags&T_AUTO_INV_100)) - { + if (p_msg->REQ_METHOD==METHOD_INVITE && (t->flags&T_AUTO_INV_100) + && (t->uas.status < 100) + ) { DBG( "SER: new INVITE\n"); if (!t_reply( t, p_msg , 100 , cfg_get(tm, tm_cfg, tm_auto_inv_100_r))) diff --git a/modules/tm/t_suspend.c b/modules/tm/t_suspend.c index f05e7eb..c8527a5 100644 --- a/modules/tm/t_suspend.c +++ b/modules/tm/t_suspend.c @@ -65,7 +65,9 @@ int t_suspend(struct sip_msg *msg,
/* send a 100 Trying reply, because the INVITE processing will probably take a long time */ - if (msg->REQ_METHOD==METHOD_INVITE && (t->flags&T_AUTO_INV_100)) { + if (msg->REQ_METHOD==METHOD_INVITE && (t->flags&T_AUTO_INV_100) + && (t->uas.status < 100) + ) { if (!t_reply( t, msg , 100 , "trying -- your call is important to us")) DBG("SER: ERROR: t_suspend (100)\n");