Try doing this different. Set the effective_caller_id_number, remove the manual header insertion and bridge it differently.<div><br></div><div>Something like this:</div><div><br></div><div><span class="Apple-style-span" style="font-family: Verdana; "><div>
<font face="Verdana" size="2"><span>            $num = &quot;02222222&quot;;</span></font></div><div><font face="Verdana" size="2"><span>            $session-&gt;answer();</span></font></div><div><font face="Verdana" size="2"><span>            $session-&gt;setVariable(&quot;effective_caller_id_name&quot;, &quot;The Redirector&quot;);</span></font></div>
<div><font face="Verdana" size="2"><span>            $session-&gt;setVariable(&quot;effective_caller_id_number&quot;, &quot;<a href="mailto:sip%3A0123456789@q-loud.net" target="_blank">0123456789</a>&quot;);</span></font></div>
<div><font face="Verdana" size="2"><span>            $session-&gt;execute(&quot;bridge&quot;, &quot;{sip_from_uri=<a href="mailto:sip%3A01111111@q-loud.net" target="_blank">sip:01111111@q-loud.net</a>}sofia/gateway/mygateway/$num);</span></font></div>
</span></div><div><br clear="all"><br></div><div>/JM</div><div>
<br><br><div class="gmail_quote">2010/3/13 Roland Hänel <span dir="ltr">&lt;<a href="mailto:roland@haenel.me">roland@haenel.me</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><font face="Verdana" size="2">
<div><font face="Verdana" size="2"><span>Hello,</span></font></div>
<div><font face="Verdana" size="2"><span></span></font> </div>
<div><font face="Verdana" size="2"><span>I&#39;m developing a 
very simple call-through application using FreeSWITCH, but 
currently</span></font></div>
<div><font face="Verdana" size="2"><span>I&#39;m stuck because 
my provider requires me to send a &#39;P-Asserted-Identity&#39; 
header</span></font></div>
<div><font face="Verdana" size="2"><span>for outgoing calls 
if I want so signal an arbitrary caller ID in the &#39;From&#39; 
field.</span></font></div>
<div><font face="Verdana" size="2"><span></span></font> </div>
<div><font face="Verdana" size="2"><span>Setup is as 
follows:</span></font></div>
<div><font face="Verdana" size="2"><span>   - a-leg comes 
in from an external gateway</span></font></div>
<div><font face="Verdana" size="2"><span>   - dialplan 
dispatches the call to a perl handler script</span></font></div>
<div><font face="Verdana" size="2"><span>   - perl script 
looks like this (simplified as much as possible for this 
description):</span></font></div>
<div><font face="Verdana" size="2"><span></span></font> </div>
<div><font face="Verdana" size="2"><span>            $num = 
&quot;02222222&quot;;</span></font></div>
<div><font face="Verdana" size="2"><span>            
$session-&gt;answer();</span></font></div>
<div><font face="Verdana" size="2"><span>            
$session-&gt;setVariable(&quot;effective_caller_id_name&quot;, &quot;The 
Redirector&quot;);<br>            
$session-&gt;setVariable(&quot;sip_h_P-Asserted-Identity&quot;, 
&#39;&lt;<a href="mailto:sip%3A0123456789@q-loud.net" target="_blank">sip:0123456789@q-loud.net</a>&gt;&#39;);</span></font></div>
<div><font face="Verdana" size="2"><span>            
$session-&gt;execute(&quot;bridge&quot;, 
&quot;sofia/gateway/mygateway/$num);<br><br></span></font></div>
<div><font face="Verdana" size="2"><span>The problem is now 
that FreeSWITCH correctly insertes a P-Asserted-Identity header 
as</span></font></div>
<div><font face="Verdana" size="2"><span>set in the perl 
script. But there is already an existing P-Asserted-Identity header by 
default,</span></font></div>
<div><font face="Verdana" size="2"><span>so I end up with 
two of them. This is the outgoing INVITE (b-leg):</span></font></div>
<div><font face="Verdana" size="2"><span></span></font> </div>
<blockquote dir="ltr" style="margin-right:0px">
<div><font face="Verdana" size="2"><span>INVITE 
sip:02222222@x.x.x.x SIP/2.0<br>Via: SIP/2.0/UDP 
x.x.x.x:5080;rport;branch=z9hG4bKca3KS0cQj121N<br>Max-Forwards: 63<br>From: &quot;The 
Redirector&quot; &lt;<a href="mailto:sip%3A01111111@q-loud.net" target="_blank">sip:01111111@q-loud.net</a>&gt;;tag=DBSvZ9NZc750g<br>To: 
&lt;sip:02222222@x.x.x.x&gt;<br>Call-ID: 
ecc19564-a84d-122d-5aa2-00515343ab02<br>CSeq: 128071597 INVITE<br>Contact: 
&lt;sip:gw+mygateway@x.x.x.x:5080;transport=udp;gw=mygateway&gt;<br>User-Agent: 
FreeSWITCH-mod_sofia/1.0.trunk-16952M<br>Allow: INVITE, ACK, BYE, CANCEL, 
OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY<br>Supported: timer, 
precondition, path, replaces<br>Allow-Events: talk, refer<br>Privacy: 
none<br>Content-Type: application/sdp<br>Content-Disposition: 
session<br>Content-Length: 244<br>X-Port: 5060<br>X-FS-Support: 
update_display<br>P-Asserted-Identity: &quot;The Redirector&quot; 
&lt;<a href="mailto:sip%3A01111111@q-loud.net" target="_blank">sip:01111111@q-loud.net</a>&gt;<br>P-Asserted-Identity: 
&lt;<a href="mailto:sip%3A0123456789@q-loud.net" target="_blank">sip:0123456789@q-loud.net</a>&gt;</span></font></div>
<div> </div>
<div><font face="Verdana" size="2"><span>[... sdp 
...]</span></font></div></blockquote>
<p><span style="font-size:10pt;font-family:Verdana"><span>Numbers are:</span></span></p>
<p><span style="font-size:10pt;font-family:Verdana"><span>    01111111       - the original caller (a-leg &amp; 
b-leg From:)<br>    02222222       - the number redirected to (b-leg To:)<br>    
0123456789    - the number my provider needs in P-Asserted-Identity 
(&#39;redirector&#39;s number&#39;)</span></span></p>
<p><span style="font-size:10pt;font-family:Verdana"><span>So, the INVITE is correct, it includes my 
P-Asserted-Identity 0123456789<br>line, but unfortunately it already includes 
another P-Asserted-Identity 011111111<br>line, and that breaks the setup at my 
provider.</span></span></p>
<p><span style="font-size:10pt;font-family:Verdana"><span>I really appreciate any help.</span></span></p>
<p><span style="font-size:10pt;font-family:Verdana"><span>Greetings,<br>Roland</span></span></p>
<p><span style="font-size:10pt;font-family:Verdana"><span>--<br>Roland Haenel<br>QSC AG - <a title="http://www.qsc.de/" href="http://www.qsc.de/" target="_blank">http://www.qsc.de</a></span></span></p>
</font></div>
<div> </div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>