Hi, it would be great if TM implements RFC 3326 by adding a Reason header in CANCEL. I explain the use cases:
1) Parallel forking:
- alice calls bob through Proxy.
- Proxy does parallel forking to two locations from which bob is registered (bob1 and bob2).
- Both phones ring. After a while bob2 answers.
- Proxy generates a CANCEL for bob1 and includes a header: Reason: SIP ;cause=200 ;text="Call completed elsewhere"
- By inspecting such header (cause=200) bob1 device decides not to include this call in the list of "missed calls".
2) Propagating CANCEL + Reason from an application server or PBX.
- alice calls bob through PBX.
- The PBX "forkes" (no need to really fork as it's a B2BUA/UAC and could just generate two different INVITE), and calls to bob's SIP phone and bob's mobile (through a PSTN gateway).
- The INVITE to bob's SIP phone is sent to bob's inbound Proxy. The Proxy routes the request to the location of bob.
- Bob human was out so answers the call in his mobile.
- The PBX sends a CANCEL to Proxy including the header: Reason: SIP ;cause=200 ;text="Call completed elsewhere"
- Such CANCEL arrives to Proxy. As CANCEL is hop by hop the Proxy generates its own CANCEL but due to local policy (i.e. the CANCEL comes from the trusted PBX) it *propagates* the Reason header.
- Again bob's SIP phone receives the CANCEL with such Reason header and decides not to include this call in the list of "missed calls".
This is very useful feature IMHO as bob won't waste time by calling to all of those non real "missed" calls.
At implementation level I would consider the following:
- Case 1 doesn't require parameters or script decissions (IMHO) so it's safe to add Reason header in a CANCEL when cancelling a branch (in parallel forking).
- Case 2 requires a local policy as it wouldn't be safe to propagate any Reason header coming in a CANCEL from any sender (imagine you receive a malicius call at 5 o'clock in the night and the hacker added "Reason" header to the CANCEL so you don't find that call in the missed calls list of the phone).
- This local policy could be implemented as follows:
a) Enabling a flag in t_relay() that only makes sense for CANCEL rather than INVITE, so:
if (is_method("CANCEL")) { if ($si == MY_APPLICATION_SERVER_IP) # Allow propagating "Reason" header. t_relay(0x12); else t_relay(); }
or a explicit flag:
if (is_method("CANCEL")) { if ($si == MY_APPLICATION_SERVER_IP) setflag(FLAG_ALLOW_CANCEL_REASON); t_relay(); }
As a side note, Asterisk does implement this Reason header when calls to various phones for the same call. Also, this feature is implemented in OpenSIPS TM module (case 1 is already implemented and case 2 will be implemented soon).
Do you consider feasible implementing it? opinnions? I would like to try it by myself, but being the serious TM module I would like to know your opinnions first :)
Regards.
Hi,
I'm using kamailio release 3.0 (from git branch3 of sip router) and I'm trying to store a double value in my mysql database:
I discovered that existing code only allow 2 decimal digit precision in file "db_ut.c":
ret = snprintf(_s, *_l, "%-10.2f", _v);
I don't clearly understand the reason, but would like to know if you wouldn't mind extending it? I would need 7 digits.
Regards, Aymeric MOIZARD / ANTISIP amsip - http://www.antisip.com osip2 - http://www.osip.org eXosip2 - http://savannah.nongnu.org/projects/exosip/
El Miércoles, 10 de Febrero de 2010, Aymeric Moizard escribió:
Hi,
Hi, please don't press "Reply" over other non related mail when creating a new topic, as your mail contains a header "In-Reply-To" and my mail client (and any other ordering mails by threads) holds your mail in a non related thread.
Please create a new mail from scratch (button "New mail") when starting a new topic.
Thanks.
Hello,
On 2/10/10 5:08 PM, Aymeric Moizard wrote:
Hi,
I'm using kamailio release 3.0 (from git branch3 of sip router) and I'm trying to store a double value in my mysql database:
I discovered that existing code only allow 2 decimal digit precision in file "db_ut.c":
ret = snprintf(_s, *_l, "%-10.2f", _v);
I don't clearly understand the reason,
the pseudo-variables have support only for integer or string values (no doubles in cfg operations).
Double is used internally only for contact q value, and I guess that has 2 digits precision. It is fine for me to increase the precision. I cannot think now of any drawback.
Cheers, Daniel
but would like to know if you wouldn't mind extending it? I would need 7 digits.
Regards, Aymeric MOIZARD / ANTISIP amsip - http://www.antisip.com osip2 - http://www.osip.org eXosip2 - http://savannah.nongnu.org/projects/exosip/
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
On Wed, 10 Feb 2010, Daniel-Constantin Mierla wrote:
Hello,
On 2/10/10 5:08 PM, Aymeric Moizard wrote:
Hi,
I'm using kamailio release 3.0 (from git branch3 of sip router) and I'm trying to store a double value in my mysql database:
I discovered that existing code only allow 2 decimal digit precision in file "db_ut.c":
ret = snprintf(_s, *_l, "%-10.2f", _v);
I don't clearly understand the reason,
the pseudo-variables have support only for integer or string values (no doubles in cfg operations).
I'm using double in modules I'm working on.
Double is used internally only for contact q value, and I guess that has 2 digits precision. It is fine for me to increase the precision. I cannot think now of any drawback.
I tried to compile with 7 digit and it's working fine for my module. However, I haven't tested anything else.
Tks, Aymeric MOIZARD / ANTISIP amsip - http://www.antisip.com osip2 - http://www.osip.org eXosip2 - http://savannah.nongnu.org/projects/exosip/
Cheers, Daniel
but would like to know if you wouldn't mind extending it? I would need 7 digits.
Regards, Aymeric MOIZARD / ANTISIP amsip - http://www.antisip.com osip2 - http://www.osip.org eXosip2 - http://savannah.nongnu.org/projects/exosip/
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
-- Daniel-Constantin Mierla eLearning class for Kamailio 3.0.0
On 2/10/10 8:50 PM, Aymeric Moizard wrote:
I'm using kamailio release 3.0 (from git branch3 of sip router) and I'm trying to store a double value in my mysql database:
I discovered that existing code only allow 2 decimal digit precision in file "db_ut.c":
ret = snprintf(_s, *_l, "%-10.2f", _v);
I don't clearly understand the reason,
the pseudo-variables have support only for integer or string values (no doubles in cfg operations).
I'm using double in modules I'm working on.
Double is used internally only for contact q value, and I guess that has 2 digits precision. It is fine for me to increase the precision. I cannot think now of any drawback.
I tried to compile with 7 digit and it's working fine for my module. However, I haven't tested anything else.
I did a grep and the only module using double via db api is usrloc (the others are db drivers). So it is easy to check and test.
Cheers, Daniel
Hi Inaki,
I have 1) in my to-do, maybe others have it too (which would be great if they do it first :-) ). For 2) there is an option to propagate headers from invite to cancel via ac_extra_headers tm parameter, I guess it is easy to extend the functionality to get headers from received cancel as well.
Cheers, Daniel
When I looked
On 2/10/10 1:03 PM, Iñaki Baz Castillo wrote:
Hi, it would be great if TM implements RFC 3326 by adding a Reason header in CANCEL. I explain the use cases:
- Parallel forking:
alice calls bob through Proxy.
Proxy does parallel forking to two locations from which bob is registered
(bob1 and bob2).
Both phones ring. After a while bob2 answers.
Proxy generates a CANCEL for bob1 and includes a header: Reason: SIP ;cause=200 ;text="Call completed elsewhere"
By inspecting such header (cause=200) bob1 device decides not to include
this call in the list of "missed calls".
- Propagating CANCEL + Reason from an application server or PBX.
alice calls bob through PBX.
The PBX "forkes" (no need to really fork as it's a B2BUA/UAC and could just
generate two different INVITE), and calls to bob's SIP phone and bob's mobile (through a PSTN gateway).
- The INVITE to bob's SIP phone is sent to bob's inbound Proxy. The Proxy
routes the request to the location of bob.
Bob human was out so answers the call in his mobile.
The PBX sends a CANCEL to Proxy including the header: Reason: SIP ;cause=200 ;text="Call completed elsewhere"
Such CANCEL arrives to Proxy. As CANCEL is hop by hop the Proxy generates
its own CANCEL but due to local policy (i.e. the CANCEL comes from the trusted PBX) it *propagates* the Reason header.
- Again bob's SIP phone receives the CANCEL with such Reason header and
decides not to include this call in the list of "missed calls".
This is very useful feature IMHO as bob won't waste time by calling to all of those non real "missed" calls.
At implementation level I would consider the following:
- Case 1 doesn't require parameters or script decissions (IMHO) so it's safe
to add Reason header in a CANCEL when cancelling a branch (in parallel forking).
- Case 2 requires a local policy as it wouldn't be safe to propagate any
Reason header coming in a CANCEL from any sender (imagine you receive a malicius call at 5 o'clock in the night and the hacker added "Reason" header to the CANCEL so you don't find that call in the missed calls list of the phone).
- This local policy could be implemented as follows:
a) Enabling a flag in t_relay() that only makes sense for CANCEL rather than INVITE, so:
if (is_method("CANCEL")) { if ($si == MY_APPLICATION_SERVER_IP) # Allow propagating "Reason" header. t_relay(0x12); else t_relay(); }
or a explicit flag:
if (is_method("CANCEL")) { if ($si == MY_APPLICATION_SERVER_IP) setflag(FLAG_ALLOW_CANCEL_REASON); t_relay(); }
As a side note, Asterisk does implement this Reason header when calls to various phones for the same call. Also, this feature is implemented in OpenSIPS TM module (case 1 is already implemented and case 2 will be implemented soon).
Do you consider feasible implementing it? opinnions? I would like to try it by myself, but being the serious TM module I would like to know your opinnions first :)
Regards.