sangoma / switchy

async FreeSWITCH cluster control
https://switchy.readthedocs.io/en/latest/
Mozilla Public License 2.0
69 stars 18 forks source link

set_orig_cmd doesn't support P- headers #66

Closed SteveAyre closed 7 years ago

SteveAyre commented 7 years ago

set_orig_cmd accepts a dict of xheaders. However it adds the X- prefix. This means it cannot set other headers such as P-Served-User (this gets sent as X-P-Served-User) or headers without any prefix.

vodik commented 7 years ago

@tgoodlet poke

SteveAyre commented 7 years ago

Currently the code looks for the sip_h_X- prefix 'in' name, if that is true it'll use the key as the variable name otherwise add the sip_h_X- prefix.

Perhaps it would be better to test name.startswith('siph') instead (which is more generic, correct and faster)? If that's not set add the sip_h_X- prefix as now. That should be backwards compatible but allow setting any header name with the siph prefix in the key.

SteveAyre commented 7 years ago

Raised pull request https://github.com/sangoma/switchy/pull/67

goodboy commented 7 years ago

@SteveAyre great idea. We should probably even just get rid of the sip_h_X case eventually - expect the user to be explicit about using an x header.

vodik commented 7 years ago

Closed with #67, no?