Altering From Header in SIP Invite
Hi All, I'm having a little trouble with 'presentation numbers' with a new provider I'm in IOT with this week. I'm trying to recreate the following Invite as the calls pass through our dialplan to this provider but there are issues with trying to get a different CLI into the From and P-Asserted-Identity headers. When presenting a Freephone number (for example) we need to still present the regular number that would be used by this extension in the P-Asserted-Identity whilst passing the number we wish to have presented in the From header. Currently we are not using Gateways so we cannot resort to using <param name="caller-id-in-from" value="true"/> (although I expect this won't do what we need in this case) so I've looked at altering the channel variables sip_from_user,sip_full_from and sip_full_uri using set and export dial plan apps but none of these seem to have any effect so I guess these variables must be read only. I'm sure this must be simple, but can't for the life of me work out what I need to do. Below is an extract from an example header from the provider I am trying to recreate, I've also added a copy of the Dialplan extension I am using to test. If someone can tell me what I'm getting wrong I would really appreciate it. Thanks Rob INVITE sip:+445600005262@primarysip.barfoo.com;user=phone SIP/2.0 Max-Forwards: 69 Session-Expires: 3600;refresher=uac Min-SE: 600 Supported: timer, 100rel To: +445600000262 <sip:+445600005262@primarysip.barfoo.com;user=phone> From: <sip:+448000655262@uk.foo.bar.2.net;user=phone>;tag=12544 P-Asserted-Identity: <sip:+445600655262@uk.sdin.bt.net> Call-ID: 1347372978-13100@mgc-uk-998.n2<mailto:1347372978-13100@mgc-uk-998.n2> CSeq: 1 INVITE Allow: CANCEL, ACK, INVITE, BYE, OPTIONS, INFO, PRACK, UPDATE DIAL Plan: (attempting +445600655262 in P Asserted-Id and +448000655262 in from) have commented out some things that I have tried.) If you are worried about [sip_h_X-Gateway=4003:4] this is added to help our SBC forward calls to our different providers. <extension name="TC 25"> <condition field="destination_number" expression="^10125$"> <action application="set" data="effective_caller_id_name=_undef_"/> <action application="set" data="effective_caller_id_number=+445600005262 "/> <action application="set" data="dtmf_type=rfc2833"/> <action application="set" data="sip_cid_type=pid"/> <!--<action application="export" data=" sip_from_user =+448000655262"/> --> <!-- <action application="export" data="sip_h_from=<sip:+448000655262@primarysip.barfoo.com>;tag=${sip_from_tag} "/> --> <!-- <action application="export" data="sip_h_P-Asserted-Identity= +445600005262 <sip:+445600655262@172.17.7.4> "/> --> <action application="info"/> <action application="bridge" data="[sip_h_X-Gateway=4003:4]sofia/internal/+442920001199@pstn.tel" /> </condition> </extension> Rob Moore Telephony Systems Infrastructure Manager Aeriandi Aeriandi Ltd, Prama House, Banbury Road, Oxford, OX27HT E: rob.moore@aeriandi.com<mailto:rob.moore@aeriandi.com> W: www.aeriandi.com<http://www.aeriandi.com/> M: +44 (0)7766 838040 T: +44 (0) 845 108 0308 [Description: Description: Description: Description: Description: Description: Description: Description: cid:image002.png@01CC9E0C.20153A40]
Hi Everyone, For those who are interested I found a way around this issue. I'm not sure if this is the correct way to produce this result but it worked. The problem I had was that I could set the Freephone number I wished to present but the P asserted ID would overwrite this with the other standard number I was attempting to send. So to resolve the issue I had to disable all CID, use effective_caller_id_number to present my Freephone number (this adds the number to your from header) then I used sip_h_ to add the P-Asserted-Identity manually. <action application="set" data="effective_caller_id_number=+448000000262"/> <action application="export" data="sip_cid_type=none"/> <action application="export" data="sip_h_P-Asserted-Identity= <sip:+445600000262@fixsipbizzle.org> "/> Hope this helps anyone else who ever has to provide this unusual setup. From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Rob Moore Sent: 11 September 2012 19:11 To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Altering From Header in SIP Invite Hi All, I'm having a little trouble with 'presentation numbers' with a new provider I'm in IOT with this week. I'm trying to recreate the following Invite as the calls pass through our dialplan to this provider but there are issues with trying to get a different CLI into the From and P-Asserted-Identity headers. When presenting a Freephone number (for example) we need to still present the regular number that would be used by this extension in the P-Asserted-Identity whilst passing the number we wish to have presented in the From header. Currently we are not using Gateways so we cannot resort to using <param name="caller-id-in-from" value="true"/> (although I expect this won't do what we need in this case) so I've looked at altering the channel variables sip_from_user,sip_full_from and sip_full_uri using set and export dial plan apps but none of these seem to have any effect so I guess these variables must be read only. I'm sure this must be simple, but can't for the life of me work out what I need to do. Below is an extract from an example header from the provider I am trying to recreate, I've also added a copy of the Dialplan extension I am using to test. If someone can tell me what I'm getting wrong I would really appreciate it. Thanks Rob INVITE sip:+445600005262@primarysip.barfoo.com;user=phone SIP/2.0 Max-Forwards: 69 Session-Expires: 3600;refresher=uac Min-SE: 600 Supported: timer, 100rel To: +445600000262 <sip:+445600005262@primarysip.barfoo.com;user=phone> From: <sip:+448000655262@uk.foo.bar.2.net;user=phone>;tag=12544 P-Asserted-Identity: <sip:+445600655262@uk.sdin.bt.net> Call-ID: 1347372978-13100@mgc-uk-998.n2<mailto:1347372978-13100@mgc-uk-998.n2> CSeq: 1 INVITE Allow: CANCEL, ACK, INVITE, BYE, OPTIONS, INFO, PRACK, UPDATE DIAL Plan: (attempting +445600655262 in P Asserted-Id and +448000655262 in from) have commented out some things that I have tried.) If you are worried about [sip_h_X-Gateway=4003:4] this is added to help our SBC forward calls to our different providers. <extension name="TC 25"> <condition field="destination_number" expression="^10125$"> <action application="set" data="effective_caller_id_name=_undef_"/> <action application="set" data="effective_caller_id_number=+445600005262 "/> <action application="set" data="dtmf_type=rfc2833"/> <action application="set" data="sip_cid_type=pid"/> <!--<action application="export" data=" sip_from_user =+448000655262"/> --> <!-- <action application="export" data="sip_h_from=<sip:+448000655262@primarysip.barfoo.com>;tag=${sip_from_tag} "/> --> <!-- <action application="export" data="sip_h_P-Asserted-Identity= +445600005262 <sip:+445600655262@172.17.7.4> "/> --> <action application="info"/> <action application="bridge" data="[sip_h_X-Gateway=4003:4]sofia/internal/+442920001199@pstn.tel<mailto:sofia/internal/+442920001199@pstn.tel>" /> </condition> </extension> Rob Moore Telephony Systems Infrastructure Manager Aeriandi Aeriandi Ltd, Prama House, Banbury Road, Oxford, OX27HT E: rob.moore@aeriandi.com<mailto:rob.moore@aeriandi.com> W: www.aeriandi.com<http://www.aeriandi.com/> M: +44 (0)7766 838040 T: +44 (0) 845 108 0308 [Description: Description: Description: Description: Description: Description: Description: Description: cid:image002.png@01CC9E0C.20153A40]
Without throwing the provider under the bus it might be good to document this as a "known issue with a workaround." We would just need to add a provider page and link it here: http://wiki.freeswitch.org/wiki/SIP_Provider_Examples Thanks! -MC On Fri, Sep 14, 2012 at 4:46 AM, Rob Moore <Rob.Moore@aeriandi.com> wrote:
Hi Everyone,****
** **
For those who are interested I found a way around this issue. I’m not sure if this is the correct way to produce this result but it worked.****
** **
The problem I had was that I could set the Freephone number I wished to present but the P asserted ID would overwrite this with the other standard number I was attempting to send. ****
** **
So to resolve the issue I had to disable all CID, use effective_caller_id_number to present my Freephone number (this adds the number to your from header) then I used sip_h_ to add the P-Asserted-Identity manually.****
** **
<action application="set" data="effective_caller_id_number=+448000000262"/>****
<action application="export" data="sip_cid_type=none"/>****
<action application="export" data="sip_h_P-Asserted-Identity= <sip:+445600000262@fixsipbizzle.org> "/>* ***
** **
Hope this helps anyone else who ever has to provide this unusual setup.*** *
** **
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Rob Moore *Sent:* 11 September 2012 19:11 *To:* freeswitch-users@lists.freeswitch.org *Subject:* [Freeswitch-users] Altering From Header in SIP Invite****
** **
Hi All,****
** **
I’m having a little trouble with ‘presentation numbers’ with a new provider I’m in IOT with this week.****
** **
I’m trying to recreate the following Invite as the calls pass through our dialplan to this provider but there are issues with trying to get a different CLI into the From and P-Asserted-Identity headers.****
** **
When presenting a Freephone number (for example) we need to still present the regular number that would be used by this extension in the P-Asserted-Identity whilst passing the number we wish to have presented in the From header.****
** **
Currently we are not using Gateways so we cannot resort to using <param name="caller-id-in-from" value="true"/> (although I expect this won’t do what we need in this case) so I’ve looked at altering the channel variables sip_from_user,sip_full_from and sip_full_uri using set and export dial plan apps but none of these seem to have any effect so I guess these variables must be read only. ****
** **
I’m sure this must be simple, but can’t for the life of me work out what I need to do. ****
** **
Below is an extract from an example header from the provider I am trying to recreate, I’ve also added a copy of the Dialplan extension I am using to test.****
If someone can tell me what I’m getting wrong I would really appreciate it. ****
** **
Thanks****
** **
Rob****
** **
* *
*INVITE* sip:*+445600005262@primarysip.barfoo.com;user=phone* SIP/2.0****
*Max-Forwards:* 69****
*Session-Expires:* 3600;refresher=uac****
*Min-SE:* 600****
*Supported:* timer, 100rel****
*To:* +445600000262 *<sip:+445600005262@primarysip.barfoo.com;user=phone>* ****
*From:* *<sip:+448000655262@uk.foo.bar.2.net;user=phone>*;tag=12544****
*P-Asserted-Identity:* <sip:+445600655262@uk.sdin.bt.net>****
*Call-ID:* 1347372978-13100@mgc-uk-998.n2****
*CSeq:* 1 INVITE****
*Allow:* CANCEL, ACK, INVITE, BYE, OPTIONS, INFO, PRACK, UPDATE****
** **
** **
DIAL Plan: (attempting +445600655262 in P Asserted-Id and +448000655262in from) have commented out some things that I have tried.) ****
If you are worried about [sip_h_X-Gateway=4003:4] this is added to help our SBC forward calls to our different providers.****
** **
<extension name="TC 25">****
<condition field="destination_number" expression="^10125$">****
<action application="set" data="effective_caller_id_name=_undef_"/>****
<action application="set" data="effective_caller_id_number=+445600005262 "/>****
<action application="set" data="dtmf_type=rfc2833"/>****
<action application="set" data="sip_cid_type=pid"/>****
<!--<action application="export" data="sip_from_user= +448000655262"/> -->****
<!-- <action application="export" data="sip_h_from=<sip:+448000655262@primarysip.barfoo.com>;tag=${sip_from_tag} "/> -->****
<!-- <action application="export" data="sip_h_P-Asserted-Identity= +445600005262 < sip:+445600655262@172.17.7.4> "/> -->****
<action application="info"/>****
<action application="bridge" data="[sip_h_X-Gateway=4003:4]sofia/internal/+442920001199@pstn.tel" /> ** **
</condition>****
</extension> ****
** **
** **
Rob Moore****
Telephony Systems Infrastructure Manager****
*Aeriandi*
Aeriandi Ltd, Prama House, Banbury Road, Oxford, OX27HT ****
E: rob.moore@aeriandi.com**
W: www.aeriandi.com M: +44 (0)7766 838040**
T: +44 (0) 845 108 0308****
** **
[image: Description: Description: Description: Description: Description: Description: Description: Description: cid:image002.png@01CC9E0C.20153A40] ****
** **
_________________________________________________________________________ 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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
Oh certainly, It certainly wouldn't be a lynch job on them, it was just a very unusual setup they asked for . The provider was British Telecom (BT) on their IP Exchange platform. Can I just add a page or do I have to get a log on for the wiki? I'm currently writing up an article for our Tech blog at work that will give a summary of the tests passed during the week and why. Would be hand to post a link through to that for anyone looking to pass the BT IOT in the future. From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Collins Sent: 14 September 2012 17:39 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Altering From Header in SIP Invite Without throwing the provider under the bus it might be good to document this as a "known issue with a workaround." We would just need to add a provider page and link it here: http://wiki.freeswitch.org/wiki/SIP_Provider_Examples Thanks! -MC On Fri, Sep 14, 2012 at 4:46 AM, Rob Moore <Rob.Moore@aeriandi.com<mailto:Rob.Moore@aeriandi.com>> wrote: Hi Everyone, For those who are interested I found a way around this issue. I'm not sure if this is the correct way to produce this result but it worked. The problem I had was that I could set the Freephone number I wished to present but the P asserted ID would overwrite this with the other standard number I was attempting to send. So to resolve the issue I had to disable all CID, use effective_caller_id_number to present my Freephone number (this adds the number to your from header) then I used sip_h_ to add the P-Asserted-Identity manually. <action application="set" data="effective_caller_id_number=+448000000262<tel:%2B448000000262>"/> <action application="export" data="sip_cid_type=none"/> <action application="export" data="sip_h_P-Asserted-Identity= <sip:+445600000262<tel:%2B445600000262>@fixsipbizzle.org<http://fixsipbizzle.org>> "/> Hope this helps anyone else who ever has to provide this unusual setup. From: freeswitch-users-bounces@lists.freeswitch.org<mailto:freeswitch-users-bounces@lists.freeswitch.org> [mailto:freeswitch-users-bounces@lists.freeswitch.org<mailto:freeswitch-users-bounces@lists.freeswitch.org>] On Behalf Of Rob Moore Sent: 11 September 2012 19:11 To: freeswitch-users@lists.freeswitch.org<mailto:freeswitch-users@lists.freeswitch.org> Subject: [Freeswitch-users] Altering From Header in SIP Invite Hi All, I'm having a little trouble with 'presentation numbers' with a new provider I'm in IOT with this week. I'm trying to recreate the following Invite as the calls pass through our dialplan to this provider but there are issues with trying to get a different CLI into the From and P-Asserted-Identity headers. When presenting a Freephone number (for example) we need to still present the regular number that would be used by this extension in the P-Asserted-Identity whilst passing the number we wish to have presented in the From header. Currently we are not using Gateways so we cannot resort to using <param name="caller-id-in-from" value="true"/> (although I expect this won't do what we need in this case) so I've looked at altering the channel variables sip_from_user,sip_full_from and sip_full_uri using set and export dial plan apps but none of these seem to have any effect so I guess these variables must be read only. I'm sure this must be simple, but can't for the life of me work out what I need to do. Below is an extract from an example header from the provider I am trying to recreate, I've also added a copy of the Dialplan extension I am using to test. If someone can tell me what I'm getting wrong I would really appreciate it. Thanks Rob INVITE sip:+445600005262@primarysip.barfoo.com;user=phone SIP/2.0 Max-Forwards: 69 Session-Expires: 3600;refresher=uac Min-SE: 600 Supported: timer, 100rel To: +445600000262<tel:%2B445600000262> <sip:+445600005262@primarysip.barfoo.com;user=phone> From: <sip:+448000655262@uk.foo.bar.2.net;user=phone>;tag=12544 P-Asserted-Identity: <sip:+445600655262@uk.sdin.bt.net> Call-ID: 1347372978-13100@mgc-uk-998.n2<mailto:1347372978-13100@mgc-uk-998.n2> CSeq: 1 INVITE Allow: CANCEL, ACK, INVITE, BYE, OPTIONS, INFO, PRACK, UPDATE DIAL Plan: (attempting +445600655262<tel:%2B445600655262> in P Asserted-Id and +448000655262<tel:%2B448000655262> in from) have commented out some things that I have tried.) If you are worried about [sip_h_X-Gateway=4003:4] this is added to help our SBC forward calls to our different providers. <extension name="TC 25"> <condition field="destination_number" expression="^10125$"> <action application="set" data="effective_caller_id_name=_undef_"/> <action application="set" data="effective_caller_id_number=+445600005262<tel:%2B445600005262> "/> <action application="set" data="dtmf_type=rfc2833"/> <action application="set" data="sip_cid_type=pid"/> <!--<action application="export" data=" sip_from_user =+448000655262<tel:%2B448000655262>"/> --> <!-- <action application="export" data="sip_h_from=<sip:+448000655262@primarysip.barfoo.com>;tag=${sip_from_tag} "/> --> <!-- <action application="export" data="sip_h_P-Asserted-Identity= +445600005262<tel:%2B445600005262> <sip:+445600655262@172.17.7.4> "/> --> <action application="info"/> <action application="bridge" data="[sip_h_X-Gateway=4003:4]sofia/internal/+442920001199@pstn.tel<mailto:sofia/internal/+442920001199@pstn.tel>" /> </condition> </extension> Rob Moore Telephony Systems Infrastructure Manager Aeriandi Aeriandi Ltd, Prama House, Banbury Road, Oxford, OX27HT E: rob.moore@aeriandi.com<mailto:rob.moore@aeriandi.com> W: www.aeriandi.com<http://www.aeriandi.com/> M: +44 (0)7766 838040<tel:%2B44%20%280%297766%20838040> T: +44 (0) 845 108 0308 [Description: Description: Description: Description: Description: Description: Description: Description: cid:image002.png@01CC9E0C.20153A40] _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto: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<mailto: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 -- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
On 14/09/12 12:46, Rob Moore wrote:
Hope this helps anyone else who ever has to provide this unusual setup.
This does seem to be the only way of dealing with this setup. You may additionally want to look at doing the following, depending on the rest of your setup. Remove P-A-ID headers before adding custom header: <action application="unset" data="sip_h_P-Asserted-Identity"/> Honour Privacy/withheld-flag: <action application="unset" data="sip_h_Privacy"/> <action application="set" data="sip_h_Privacy=id"/> (some might also want to set Privacy:none explicitly when CLI may be released, but the absence of any Privacy flags should set this by default). Regards,
participants (3)
-
Michael Collins
-
Paul Cupis
-
Rob Moore