Same headers in a SIP message
Hi List, I faced a problem with FS, concerning SIP messages with multiple same headers (for example, Diversion headers). FS wasn't able to manage those headers, and only the first one was taken in account by FS. After some searches in mod_sofia.c, I've made a patch, giving the ability to FS to display and manage multiple SIP Diversion headers (or other headers) You can find it here : http://jira.freeswitch.org/browse/FS-5411 But, I'm facing a new problem : FS is able to *read* some identical headers and display them as "Diversion", "Diversion-1", "Diversion-2", etc... , but it's not able to *write* some identical headers Here is an extract of my test dialplan <condition field="${sip_h_Diversion}"
expression="\+(\d+).*;reason=(\w+);privacy=(\w+);counter=(\d{1})" break="never"> <action application="log" data="LOG Modifying first Diversion" /> * <action application="set" data="sip_h_Diversion=<sip:+$1>;reason=$2;privacy=$3;counter=$4" /> * </condition> <condition field="${sip_h_Diversion-1}" expression="\+(\d+).*;reason=(\w+);privacy=(\w+);counter=(\d{1})" break="never"> <action application="log" data="LOG Modifying second Diversion-1" /> * <action application="set" data="sip_h_Diversion=<sip:+$1>;reason=$2;privacy=$3;counter=$4" /> *</condition>
You can see that I'm trying to write two Diversion headers, because what I'd like to obtain is something like that : INVITE sip:+123456789@fsbox.domain
From: .... To : .... ........ Diversion: <sip:+987654321@domain.com
;reason=unavailable;privacy=off;counter=1 Diversion: <sip:+258147369@domain.com ;reason=do-not-disturb;privacy=off;counter=1
But what I really obtain is : INVITE sip:+123456789@fsbox.domain
From: .... To : .... ........ Diversion: <sip:+987654321@domain.com
;reason=unavailable;privacy=off;counter=1 *Diversion-1*: <sip:+258147369@domain.com ;reason=do-not-disturb;privacy=off;counter=1
So, FS automatically write the second Diversion header with a "-1" at the end ... And it's really frustrating ! Moreover, I don't want to use a FS function to make every SIP headers copied automatically from A-leg to B-leg, because some of my SIP providers don't support every header, and I have to only send essential ones. Do you have any idea / question / answer to help me, please ? Perhaps my patch may be corrected, but I don't know how... Thanks a lot, * Bien cordialement, Best Regards, **Kevin MATHY* * * --
Kevin, Well you could start by opening a JIRA, Secondly if your providers toss a fit about headers they don't understand then I would have to say they are broken and should be beat with a copy of RFC3261 carved in slate. Thanks, Brian On May 13, 2013, at 4:12 AM, Kevin Mathy <k.mathy@hexanet.fr> wrote:
So, FS automatically write the second Diversion header with a "-1" at the end ... And it's really frustrating !
Moreover, I don't want to use a FS function to make every SIP headers copied automatically from A-leg to B-leg, because some of my SIP providers don't support every header, and I have to only send essential ones.
Do you have any idea / question / answer to help me, please ? Perhaps my patch may be corrected, but I don't know how...
Thanks a lot,
Bien cordialement, Best Regards,
Kevin MATHY
Hi Brian, I've already opened a JIRA, and I'm waiting for improvement from other devs... Concerning my providers, the fact is not that they'll refuse messages with unknown headers, but that they'll not interpret those headers, so they'll miss some informations (here, divert informations) But, I agree with you for the solution to beat them with RFC3261 :-) * Bien cordialement, Best Regards, **Kevin MATHY* * * 2013/5/14 Brian West <brian@freeswitch.org>
Kevin, Well you could start by opening a JIRA, Secondly if your providers toss a fit about headers they don't understand then I would have to say they are broken and should be beat with a copy of RFC3261 carved in slate.
Thanks, Brian
On May 13, 2013, at 4:12 AM, Kevin Mathy <k.mathy@hexanet.fr> wrote:
So, FS automatically write the second Diversion header with a "-1" at the end ... And it's really frustrating !
Moreover, I don't want to use a FS function to make every SIP headers copied automatically from A-leg to B-leg, because some of my SIP providers don't support every header, and I have to only send essential ones.
Do you have any idea / question / answer to help me, please ? Perhaps my patch may be corrected, but I don't know how...
Thanks a lot,
Bien cordialement, Best Regards,
Kevin MATHY
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
--
Opening a Jira doesn't automagically get what you want done, you should probably put a bounty on it or take this chance to learn how to modify the source and contribute patches. Its how I got started way back when first started using Asterisk. /b On May 14, 2013, at 7:06 AM, Kevin Mathy <k.mathy@hexanet.fr> wrote:
Hi Brian,
I've already opened a JIRA, and I'm waiting for improvement from other devs... Concerning my providers, the fact is not that they'll refuse messages with unknown headers, but that they'll not interpret those headers, so they'll miss some informations (here, divert informations)
But, I agree with you for the solution to beat them with RFC3261 :-)
Bien cordialement, Best Regards,
Kevin MATHY
Was: Same headers in a SIP message On Tue, 14 May 2013 07:40:28 -0500 Brian West <brian@freeswitch.org> wrote:
Opening a Jira doesn't automagically get what you want done, you should probably put a bounty on it or take this chance to learn how to modify the source and contribute patches.
Doesn't always help. http://jira.freeswitch.org/browse/FS-4811 I added that in December and it still languishes. I am not even sure if the patches I supplied will apply cleanly any more. I was hoping to have a NetBSD package built and in the NetBSD package system by now. I need these changes though. NetBSD developers are stickier than most about correctness and portability. We have many platforms that it needs to compile on. In fact, I have dropped the xmlrpc code altogether due to the total brokenness of that code. That brings up another question that I have been asking. Is there any way to get diffs between the original package imported into FS and the current version? I have actually toyed with the idea of creating my own xmlrpc library and maybe I can include changes that FS needs so that you can go back to depending on a third party for xmlrpc. -- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:darcy@Vex.Net Voip: sip:darcy@Vex.Net
Hi Brian, Maybe I didn't understand what exactly is a JIRA, but I've already published a patch on http://jira.freeswitch.org/browse/FS-5411 adding the possibility to manage more than one Diversion header in FS. So, I think the first thing to be done is to validate my patch, and then, try to find a solution for the problem due to this patch... I'm sorry, but I don't use to publish patch, particularly for FS, and maybe I don't do it right. Of course I'm listening to any advice. Thanks * Bien cordialement, Best Regards, **Kevin MATHY* * * 2013/5/14 Brian West <brian@freeswitch.org>
Opening a Jira doesn't automagically get what you want done, you should probably put a bounty on it or take this chance to learn how to modify the source and contribute patches.
Its how I got started way back when first started using Asterisk.
/b
On May 14, 2013, at 7:06 AM, Kevin Mathy <k.mathy@hexanet.fr> wrote:
Hi Brian,
I've already opened a JIRA, and I'm waiting for improvement from other devs... Concerning my providers, the fact is not that they'll refuse messages with unknown headers, but that they'll not interpret those headers, so they'll miss some informations (here, divert informations)
But, I agree with you for the solution to beat them with RFC3261 :-)
Bien cordialement, Best Regards,
Kevin MATHY
--
As Anthony asks, Does it change the current behavior, maybe we could use the array variables feature? https://wiki.freeswitch.org/wiki/Dialplan_ARRAYS On May 15, 2013, at 1:45 AM, Kevin Mathy <k.mathy@hexanet.fr> wrote:
Hi Brian,
Maybe I didn't understand what exactly is a JIRA, but I've already published a patch on http://jira.freeswitch.org/browse/FS-5411 adding the possibility to manage more than one Diversion header in FS. So, I think the first thing to be done is to validate my patch, and then, try to find a solution for the problem due to this patch...
I'm sorry, but I don't use to publish patch, particularly for FS, and maybe I don't do it right. Of course I'm listening to any advice.
Thanks
Bien cordialement, Best Regards,
Kevin MATHY
Hi All, I'm answering late, but was working on something else... We've tried to look inside sofia module source code, and tried to find where sip headers are **really** written; but, we've just found how to set some variables (like sip_h_Diversion-1, etc... ) Now, what we'd like to know is : where in sofia source code, or anywhere else, may we write sip headers using variables we have set before ? We saw some lines with something like "add_header_string" methods, we don't really know and where we can use it... Just for resume what we'd like to do : with some variables named sip_h_Diversion, sip_h_Diversion-1, sip_h_Diversion-2, we want to write multiple SIP Diversion headers as below : Diversion: [sip_h_Diversion VALUE] Diversion: [sip_h_Diversion-1 VALUE] Diversion: [sip_h_Diversion-2 VALUE] Thanks for your help, and if you need further informations, feel free to ask me. * Bien cordialement, Best Regards, **Kevin MATHY* * * 2013/5/15 Brian West <brian@freeswitch.org>
As Anthony asks, Does it change the current behavior, maybe we could use the array variables feature? https://wiki.freeswitch.org/wiki/Dialplan_ARRAYS
On May 15, 2013, at 1:45 AM, Kevin Mathy <k.mathy@hexanet.fr> wrote:
Hi Brian,
Maybe I didn't understand what exactly is a JIRA, but I've already published a patch on http://jira.freeswitch.org/browse/FS-5411 adding the possibility to manage more than one Diversion header in FS. So, I think the first thing to be done is to validate my patch, and then, try to find a solution for the problem due to this patch...
I'm sorry, but I don't use to publish patch, particularly for FS, and maybe I don't do it right. Of course I'm listening to any advice.
Thanks
Bien cordialement, Best Regards,
Kevin MATHY
--
participants (3)
-
Brian West
-
D'Arcy J.M. Cain
-
Kevin Mathy