Reading custom SIP headers
Hello, I have a SIP Provider that add custom headers to sip . I tried to see them using app info, but they do not appear, but with sofia trace I can see them. For example the provider gives me a header named: Price: 0.25 Gateway: foo The upper case letter is part of the name, and both Price and Gateway are different headers. I tried also to read them using ${variable_sip_Gateway} and ${sip_Gateway}, but the variables are empty. How can I read the extra sip headers ? Thanks, Ido
Use the info dialplan application on one of the calls coming in to see how they actually show up as chan vars On 4/9/14 10:59 AM, "ik" <idokan@gmail.com> wrote:
Hello,
I have a SIP Provider that add custom headers to sip . I tried to see them using app info, but they do not appear, but with sofia trace I can see them.
For example the provider gives me a header named: Price: 0.25 Gateway: foo
The upper case letter is part of the name, and both Price and Gateway are different headers.
I tried also to read them using ${variable_sip_Gateway} and ${sip_Gateway}, but the variables are empty.
How can I read the extra sip headers ?
Thanks, Ido
_________________________________________________________________________ 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-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Ken http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org irc.freenode.net #freeswitch Twitter: @FreeSWITCH
On Wed, Apr 9, 2014 at 7:08 PM, Ken Rice <krice@freeswitch.org> wrote:
Use the info dialplan application on one of the calls coming in to see how they actually show up as chan vars
Thanks for the reply, but as I wrote, I already tried to use info, and it did not gave me the variables. I can only see them on sofia's trace.
On 4/9/14 10:59 AM, "ik" <idokan@gmail.com> wrote:
Hello,
I have a SIP Provider that add custom headers to sip . I tried to see them using app info, but they do not appear, but with sofia trace I can see them.
For example the provider gives me a header named: Price: 0.25 Gateway: foo
The upper case letter is part of the name, and both Price and Gateway are different headers.
I tried also to read them using ${variable_sip_Gateway} and ${sip_Gateway}, but the variables are empty.
How can I read the extra sip headers ?
Thanks, Ido
------------------------------ _________________________________________________________________________ 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-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Ken
*http://www.FreeSWITCH.org <http://www.FreeSWITCH.org> http://www.ClueCon.com <http://www.ClueCon.com> http://www.OSTAG.org <http://www.OSTAG.org> *irc.freenode.net #freeswitch Twitter: @FreeSWITCH
_________________________________________________________________________ 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-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
sip_h_Gateway On 9 Apr 2014 20:20, "ik" <idokan@gmail.com> wrote:
On Wed, Apr 9, 2014 at 7:08 PM, Ken Rice <krice@freeswitch.org> wrote:
Use the info dialplan application on one of the calls coming in to see how they actually show up as chan vars
Thanks for the reply, but as I wrote, I already tried to use info, and it did not gave me the variables. I can only see them on sofia's trace.
On 4/9/14 10:59 AM, "ik" <idokan@gmail.com> wrote:
Hello,
I have a SIP Provider that add custom headers to sip . I tried to see them using app info, but they do not appear, but with sofia trace I can see them.
For example the provider gives me a header named: Price: 0.25 Gateway: foo
The upper case letter is part of the name, and both Price and Gateway are different headers.
I tried also to read them using ${variable_sip_Gateway} and ${sip_Gateway}, but the variables are empty.
How can I read the extra sip headers ?
Thanks, Ido
------------------------------ _________________________________________________________________________ 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-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Ken
*http://www.FreeSWITCH.org <http://www.FreeSWITCH.org> http://www.ClueCon.com <http://www.ClueCon.com> http://www.OSTAG.org <http://www.OSTAG.org> *irc.freenode.net #freeswitch Twitter: @FreeSWITCH
_________________________________________________________________________ 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-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ 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-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
If they are actually ³Price² and ³Gateway² you are doing it wrong, they should be either X- or P- headers since they are private headers. Else you will have to hack the code to get access to them On 4/9/14 1:16 PM, "ik" <idokan@gmail.com> wrote:
On Wed, Apr 9, 2014 at 7:08 PM, Ken Rice <krice@freeswitch.org> wrote:
Use the info dialplan application on one of the calls coming in to see how they actually show up as chan vars
Thanks for the reply, but as I wrote, I already tried to use info, and it did not gave me the variables. I can only see them on sofia's trace.
On 4/9/14 10:59 AM, "ik" <idokan@gmail.com <http://idokan@gmail.com> > wrote:
Hello,
I have a SIP Provider that add custom headers to sip . I tried to see them using app info, but they do not appear, but with sofia trace I can see them.
For example the provider gives me a header named: Price: 0.25 Gateway: foo
The upper case letter is part of the name, and both Price and Gateway are different headers.
I tried also to read them using ${variable_sip_Gateway} and ${sip_Gateway}, but the variables are empty.
How can I read the extra sip headers ?
Thanks, Ido
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <http://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-users mailing list FreeSWITCH-users@lists.freeswitch.org <http://FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Ken http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org irc.freenode.net #freeswitch Twitter: @FreeSWITCH
How about we not hack the code and make vendors actually fix their obviously broken stuff? -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED) On Apr 9, 2014, at 1:25 PM, Ken Rice <krice@freeswitch.org> wrote:
If they are actually “Price” and “Gateway” you are doing it wrong, they should be either X- or P- headers since they are private headers. Else you will have to hack the code to get access to them
On 4/9/14 1:16 PM, "ik" <idokan@gmail.com> wrote:
Of course this is the proper way to do this... I was not suggestion this is a patch that should go into tree On 4/9/14 4:15 PM, "Brian West" <brian@freeswitch.org> wrote:
How about we not hack the code and make vendors actually fix their obviously broken stuff? -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com
T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)
On Apr 9, 2014, at 1:25 PM, Ken Rice <krice@freeswitch.org> wrote:
If they are actually ³Price² and ³Gateway² you are doing it wrong, they should be either X- or P- headers since they are private headers. Else you will have to hack the code to get access to them
On 4/9/14 1:16 PM, "ik" <idokan@gmail.com> wrote:
_________________________________________________________________________ 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-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Ken http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org irc.freenode.net #freeswitch Twitter: @FreeSWITCH
It it does then we need an NDLB flag (for those not in the know NDLB is No Device Left Behind) -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED) On Apr 9, 2014, at 4:19 PM, Ken Rice <krice@freeswitch.org> wrote:
Of course this is the proper way to do this... I was not suggestion this is a patch that should go into tree
On 4/9/14 4:15 PM, "Brian West" <brian@freeswitch.org> wrote:
How about we not hack the code and make vendors actually fix their obviously broken stuff? -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com
T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)
Am Mittwoch, den 09.04.2014, 18:42 -0500 schrieb Brian West:
It it does then we need an NDLB flag (for those not in the know NDLB is No Device Left Behind)
Sorry, considering that /any/ header that are not recognised by a particular software solution and that does not begin with "X-" or "P-" to be of any use is what IMHO requires a NDLB flag. X-Headers are a RFC 822 (from 1982!) legacy. By now, considering only "X-" headers as potentially meaningful would require FS to implement /every possible/ standardized extension to the SIP RFCs, which is virtually impossible today. E.g. I am quite certain, that you do /not/ implement RFC 4412 ("Resource-Priority") nor was FS able to support a custom extension with the necessary data do process it. For that reason (or more for the problem of migrating a "well known" X-Header to a "standards" header) the IETF finally deprecated the usage of "X-" and "P-" prefixes in RFC 6648/BCP 178 and RFC 5727/BCP 67. Until recently one could write but not read non-X-, non-P- and not known headers. Fortunately, now there seems to be a patch (FS-6075) in HEAD, which allows the parsing of arbitrary headers at least for SIP invites. So please have a look at the most recent git version of FS, Ido. Cheers, David -- David Dahlberg Fraunhofer FKIE, Dept. Communication Systems (KOM) | Tel: +49-228-9435-845 Fraunhoferstr. 20, 53343 Wachtberg, Germany | Fax: +49-228-856277
On Thu, Apr 10, 2014 at 10:45 AM, Dahlberg, David < david.dahlberg@fkie.fraunhofer.de> wrote:
Am Mittwoch, den 09.04.2014, 18:42 -0500 schrieb Brian West:
It it does then we need an NDLB flag (for those not in the know NDLB is No Device Left Behind)
Sorry, considering that /any/ header that are not recognised by a particular software solution and that does not begin with "X-" or "P-" to be of any use is what IMHO requires a NDLB flag.
X-Headers are a RFC 822 (from 1982!) legacy. By now, considering only "X-" headers as potentially meaningful would require FS to implement /every possible/ standardized extension to the SIP RFCs, which is virtually impossible today. E.g. I am quite certain, that you do /not/ implement RFC 4412 ("Resource-Priority") nor was FS able to support a custom extension with the necessary data do process it.
For that reason (or more for the problem of migrating a "well known" X-Header to a "standards" header) the IETF finally deprecated the usage of "X-" and "P-" prefixes in RFC 6648/BCP 178 and RFC 5727/BCP 67.
Until recently one could write but not read non-X-, non-P- and not known headers. Fortunately, now there seems to be a patch (FS-6075) in HEAD, which allows the parsing of arbitrary headers at least for SIP invites. So please have a look at the most recent git version of FS, Ido.
I have found that RFC as well (that;s why I haven't talked first with the provider), but now I have talked with the provider, and they "fixed" it for me: 707649a6-3901-472c-9962-7008fa068289 variable_sip_h_X-Gateway: [10] 707649a6-3901-472c-9962-7008fa068289 variable_sip_h_X-Price: [0.5]
Cheers, David
Thank you :) Ido
-- David Dahlberg
Fraunhofer FKIE, Dept. Communication Systems (KOM) | Tel: +49-228-9435-845 Fraunhoferstr. 20, 53343 Wachtberg, Germany | Fax: +49-228-856277 _________________________________________________________________________ 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-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Well know headers can be dealt with, Its the ones that aren’t, and getting all headers would be problematic and time consuming and probably a performance hit. sofia.c /* Loop thru unknown Headers Here so we can do something with them */ for (un = sip->sip_unknown; un; un = un->un_next) { It can be done, its just someone needs to write the additional if statement to gather the headers they care about. Patches welcome. -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED) On Apr 10, 2014, at 2:45 AM, Dahlberg, David <david.dahlberg@fkie.fraunhofer.de> wrote:
Am Mittwoch, den 09.04.2014, 18:42 -0500 schrieb Brian West:
It it does then we need an NDLB flag (for those not in the know NDLB is No Device Left Behind)
Sorry, considering that /any/ header that are not recognised by a particular software solution and that does not begin with "X-" or "P-" to be of any use is what IMHO requires a NDLB flag.
X-Headers are a RFC 822 (from 1982!) legacy. By now, considering only "X-" headers as potentially meaningful would require FS to implement /every possible/ standardized extension to the SIP RFCs, which is virtually impossible today. E.g. I am quite certain, that you do /not/ implement RFC 4412 ("Resource-Priority") nor was FS able to support a custom extension with the necessary data do process it.
For that reason (or more for the problem of migrating a "well known" X-Header to a "standards" header) the IETF finally deprecated the usage of "X-" and "P-" prefixes in RFC 6648/BCP 178 and RFC 5727/BCP 67.
Until recently one could write but not read non-X-, non-P- and not known headers. Fortunately, now there seems to be a patch (FS-6075) in HEAD, which allows the parsing of arbitrary headers at least for SIP invites. So please have a look at the most recent git version of FS, Ido.
Cheers, David
Since FS-6075 was commited, there is a setting to get all SIP headers, so this should already work on master. /Peter torsdagen den 10:e april 2014 skrev Brian West <brian@freeswitch.org>:
Well know headers can be dealt with, Its the ones that aren't, and getting all headers would be problematic and time consuming and probably a performance hit.
sofia.c /* Loop thru unknown Headers Here so we can do something with them */ for (un = sip->sip_unknown; un; un = un->un_next) {
It can be done, its just someone needs to write the additional if statement to gather the headers they care about.
Patches welcome.
-- Brian West brian@freeswitch.org <javascript:;> FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com
T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)
On Apr 10, 2014, at 2:45 AM, Dahlberg, David < david.dahlberg@fkie.fraunhofer.de <javascript:;>> wrote:
Am Mittwoch, den 09.04.2014, 18:42 -0500 schrieb Brian West:
It it does then we need an NDLB flag (for those not in the know NDLB is No Device Left Behind)
Sorry, considering that /any/ header that are not recognised by a particular software solution and that does not begin with "X-" or "P-" to be of any use is what IMHO requires a NDLB flag.
X-Headers are a RFC 822 (from 1982!) legacy. By now, considering only "X-" headers as potentially meaningful would require FS to implement /every possible/ standardized extension to the SIP RFCs, which is virtually impossible today. E.g. I am quite certain, that you do /not/ implement RFC 4412 ("Resource-Priority") nor was FS able to support a custom extension with the necessary data do process it.
For that reason (or more for the problem of migrating a "well known" X-Header to a "standards" header) the IETF finally deprecated the usage of "X-" and "P-" prefixes in RFC 6648/BCP 178 and RFC 5727/BCP 67.
Until recently one could write but not read non-X-, non-P- and not known headers. Fortunately, now there seems to be a patch (FS-6075) in HEAD, which allows the parsing of arbitrary headers at least for SIP invites. So please have a look at the most recent git version of FS, Ido.
Cheers, David
I actually recall that one, its a little bit of a blur as that was after I pulled the trigger and poked at every single JIRA to get people moving on issues so we can clear some of them out. -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED) On Apr 10, 2014, at 1:20 PM, Peter Olsson <peter@olssononline.se> wrote:
Since FS-6075 was commited, there is a setting to get all SIP headers, so this should already work on master.
/Peter
participants (6)
-
Brian West
-
Dahlberg, David
-
ik
-
Ken Rice
-
Nelson Luiz Ferraz de Camargo Penteado
-
Peter Olsson