FS does not set response headers in channel variables
I call an extension in the trunk, pass some headers to it to validate some transactions. Trunk responses my invite with "SIP/2.0 480 Temporarily Unavailable" (not user response) with some headers like below: recv 906 bytes from udp/[dst.dst.dst.dst]:8090 at 05:02:33.558626: ------------------------------------------------------------------------ SIP/2.0 480 Temporarily Unavailable From: ""<sip:TCAPI_User@dst.dst.dst.dst:8090>;tag=8SN0g1DmHy0NF To: <sip:91001@dst.dst.dst.dst :8090>;tag=59f1478-33001dac-1f9a-50022-1f428f-b29b56e-1f428f Call-ID: 96685221-f5e9-1231-b1a5-000c29ae8315 CSeq: 54415412 INVITE Via: SIP/2.0/UDP src.src.src.src:5080;rport=5080;branch=z9hG4bKtScUQtUy9rgmp Supported: replaces Info: {"MerCode":"102"} Sign: Ley1/8cOufqkgd7JuGR7f+jiVxSRM= BillPaymentList: {"paymentID":"16596500682","result":"0"} Content-Length: 0 I run /event plain all in my fs console and no variable exists like info, sign and billpayment in channel variables. Any solution to catch response header?! I cannot define or change key of the headers. I should adapt to these keys!!!
Does it work if you prefix with X-, ie X-BillPaymentList not BillPaymentList X- is a prefix that is meant to be used on any user-defined headers. -Steve On 12 January 2014 05:36, Sayyed Mohammad Emami Razavi < emamirazavi@gmail.com> wrote:
I call an extension in the trunk, pass some headers to it to validate some transactions. Trunk responses my invite with "SIP/2.0 480 Temporarily Unavailable" (not user response) with some headers like below:
recv 906 bytes from udp/[dst.dst.dst.dst]:8090 at 05:02:33.558626: ------------------------------------------------------------------------ SIP/2.0 480 Temporarily Unavailable From: ""<sip:TCAPI_User@dst.dst.dst.dst:8090>;tag=8SN0g1DmHy0NF To: <sip:91001@dst.dst.dst.dst :8090>;tag=59f1478-33001dac-1f9a-50022-1f428f-b29b56e-1f428f Call-ID: 96685221-f5e9-1231-b1a5-000c29ae8315 CSeq: 54415412 INVITE Via: SIP/2.0/UDP src.src.src.src:5080;rport=5080;branch=z9hG4bKtScUQtUy9rgmp Supported: replaces Info: {"MerCode":"102"} Sign: Ley1/8cOufqkgd7JuGR7f+jiVxSRM= BillPaymentList: {"paymentID":"16596500682","result":"0"} Content-Length: 0
I run /event plain all in my fs console and no variable exists like info, sign and billpayment in channel variables. Any solution to catch response header?! I cannot define or change key of the headers. I should adapt to these keys!!!
_________________________________________________________________________ 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
Hello, it will ONLY work if you X- prefix your self SIP-Headers. Non-standard SIP headers should be preceded with an X-. 2014/1/12 Steven Ayre <steveayre@gmail.com>
Does it work if you prefix with X-, ie X-BillPaymentList not BillPaymentList
X- is a prefix that is meant to be used on any user-defined headers.
-Steve
On 12 January 2014 05:36, Sayyed Mohammad Emami Razavi < emamirazavi@gmail.com> wrote:
I call an extension in the trunk, pass some headers to it to validate some transactions. Trunk responses my invite with "SIP/2.0 480 Temporarily Unavailable" (not user response) with some headers like below:
recv 906 bytes from udp/[dst.dst.dst.dst]:8090 at 05:02:33.558626:
------------------------------------------------------------------------ SIP/2.0 480 Temporarily Unavailable From: ""<sip:TCAPI_User@dst.dst.dst.dst:8090>;tag=8SN0g1DmHy0NF To: <sip:91001@dst.dst.dst.dst :8090>;tag=59f1478-33001dac-1f9a-50022-1f428f-b29b56e-1f428f Call-ID: 96685221-f5e9-1231-b1a5-000c29ae8315 CSeq: 54415412 INVITE Via: SIP/2.0/UDP src.src.src.src:5080;rport=5080;branch=z9hG4bKtScUQtUy9rgmp Supported: replaces Info: {"MerCode":"102"} Sign: Ley1/8cOufqkgd7JuGR7f+jiVxSRM= BillPaymentList: {"paymentID":"16596500682","result":"0"} Content-Length: 0
I run /event plain all in my fs console and no variable exists like info, sign and billpayment in channel variables. Any solution to catch response header?! I cannot define or change key of the headers. I should adapt to these keys!!!
_________________________________________________________________________ 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
-- Mit freundlichen Grüßen *Karsten Horsmann*
Am Montag, den 13.01.2014, 10:47 +0100 schrieb Karsten Horsmann:
Hello,
it will ONLY work if you X- prefix your self SIP-Headers. Non-standard SIP headers should be preceded with an X-.
Both sentences are not true. "X-" header prefixes are now depricated by the IETF (RFC 6648/BCP 178). And you indeed CAN set non-X-headers with the FS and mod_sofia. The only problem seem to be, that a) headers set by api calls like hangup() (e.g. "Reason:" with namespace "Q.931" etc.) will be overwritten and b) you cannot access those variables, on incoming calls (i.e. if you have not set them on your own). The only limitation seems to be in mod_sofia (not in Sofia SIP as the Wiki claims). I do not have access to the git right now, but if I remember correctly, Sofia distinguishes between "known headers", including "x-headers" and "unknown headers" which are saved in a different struct. Mod_sofia already contains all the necessary functions to retrieve "unknown headers" as the module needs some of them itself. But IIRC the according functions are only ever invoked with constant strings, so there is definitely no easy way of reading them. Writing is possible though as I previously mentioned. Regards David -- David Dahlberg Fraunhofer FKIE, Dept. Communication Systems (KOM) | Tel: +49-228-9435-845 Fraunhoferstr. 20, 53343 Wachtberg, Germany | Fax: +49-228-856277
I've added a proposed patch here, that might solve what you're after: http://jira.freeswitch.org/browse/FS-6075. Please note that my patch has a small error, it sets the same variable twice, read through the comments if you want to test it. Would this do what you are requesting? /Peter 2014/1/20 Dahlberg, David <david.dahlberg@fkie.fraunhofer.de>
Am Montag, den 13.01.2014, 10:47 +0100 schrieb Karsten Horsmann:
Hello,
it will ONLY work if you X- prefix your self SIP-Headers. Non-standard SIP headers should be preceded with an X-.
Both sentences are not true. "X-" header prefixes are now depricated by the IETF (RFC 6648/BCP 178).
And you indeed CAN set non-X-headers with the FS and mod_sofia. The only problem seem to be, that
a) headers set by api calls like hangup() (e.g. "Reason:" with namespace "Q.931" etc.) will be overwritten and b) you cannot access those variables, on incoming calls (i.e. if you have not set them on your own).
The only limitation seems to be in mod_sofia (not in Sofia SIP as the Wiki claims). I do not have access to the git right now, but if I remember correctly, Sofia distinguishes between "known headers", including "x-headers" and "unknown headers" which are saved in a different struct. Mod_sofia already contains all the necessary functions to retrieve "unknown headers" as the module needs some of them itself. But IIRC the according functions are only ever invoked with constant strings, so there is definitely no easy way of reading them. Writing is possible though as I previously mentioned.
Regards David
-- 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
participants (5)
-
Dahlberg, David
-
Karsten Horsmann
-
Peter Olsson
-
Sayyed Mohammad Emami Razavi
-
Steven Ayre