[Freeswitch-users] Set From User in SIP request

jeremy ardley jeremy.ardley at gmail.com
Mon Jan 12 05:19:31 MSK 2015


I tried your suggestions and variants on them without much luck.

I can set the user name on the B leg no problem butI can't set the user
number. However the non-standard header

Remote-Party-ID:

does contain my requested user number so I know that the requested user
number is being passed to the B leg. I also checked the logs and saw the
variables

effective_caller_id_name
effective_caller_id_number
origination_caller_id_number

Are being set and exported.

The relevant stanza from my dial-plan is

  <extension name="AU_national">
    <condition field="${toll_allow}" expression="domestic"/>
    <condition field="destination_number" expression="^(0[23478]\d{8})$">
      <action application="set"
data="effective_caller_id_number=${outbound_caller_id_number}"/>
      <action application="set"
data="effective_caller_id_name=${outbound_caller_id_name}"/>
      <action application="set"
data="origination_caller_id_number=${outbound_caller_id_number}"/>
      <action application="bridge"
data="sofia/gateway/${default_gateway}/$1"/>
    </condition>
  </extension>

(I tried with export instead of set but it made no difference)

Is there any other parameters or settings I could use to force the
default from-user to my variable one?

On 11/01/15 19:45, Dušan Dragić wrote:
> Use user_data to get the user variables
> https://freeswitch.org/confluence/display/FREESWITCH/mod_commands#mod_commands-user_data.
>
> Example, where outbound_caller_id_name/number are your did number and
> account code (you can use whatever var you want):
> <action application="export"
> data="origination_caller_id_name=${user_data(${user_name}@${domain_name}
> var outbound_caller_id_name)}"/>
> <action application="export"
> data="origination_caller_id_number=${user_data(${user_name}@${domain_name}
> var outbound_caller_id_number)}"/>
>
> For the second part, I'm not aware of of any standard mechanism in fs
> to remove the quotes (is your provider really this broken?).
> Maybe try with sip_invite_full_from channel var. I haven't tried it,
> but based on the name I'm guessing that you'll have to generate a full
> From: field including unique tag value (;tag=xxx) manually.
>
> On 11 January 2015 at 02:08, jeremy ardley <jeremy.ardley at gmail.com> wrote:
>> Hi,
>>
>> I have a DID provider with multiple incoming numbers. I can send outgoing
>> calls on particular DID numbers by sending a SIP request with the From
>> header formatted as
>>
>> From: dddddddddd <sip:dddddddd at sip.provider.com>;tag=yyy
>>
>> Where the From name is the DID in full national number form (10 digit) and
>> the From user is the 8 digit account number. Each unique DID has a matching
>> unique account number.
>>
>> I have internal extensions mapped to different DID numbers.
>>
>> I need a mechanism to feed different DID number and account number pairs to
>> the gateway for each outgoing call. I hope to do  that via the internal
>> extension xml files e.g.
>>
>> <include>
>>   <user id="200">
>>     <params>
>>       <param name="password" value="xxxxxx"/>
>>       <param name="vm-password" value="200"/>
>>     </params>
>>     <variables>
>>       <variable name="toll_allow" value="domestic,international,local"/>
>>       <variable name="accountcode" value="200"/>
>>       <variable name="user_context" value="default"/>
>>       <variable name="effective_caller_id_name" value="Michael J Fox"/>
>>       <variable name="effective_caller_id_number" value="200"/>
>>       <variable name="outbound_caller_id_name" value="0000000001"/>
>>       <variable name="outbound_caller_id_number" value="0000000001"/>
>>       <variable name="outbound_caller_from_user" value="01234567"/>
>>       <variable name="callgroup" value="techsupport"/>
>>     </variables>
>>   </user>
>> </include>
>>
>> The question is how to pass the new variable outbound_caller_from_user to
>> the gateway and get it substituted in the user field of the SIP From header?
>>
>> I have a secondary issue in that I can set the outbound DID part of the From
>> Header but it has quotes around it
>>
>> From: "dddddddddd" <sip:dddddddd at sip.provider.com>;tag=yyy
>>
>> Which is undesirable and it would be helpful to suppress that in Freeswitch
>> itself.
>>
>> Thanks,
>>
>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>
>




Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list