<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Hi Brett,<br>
<br>
The b2bua generates a new request with the info from the received one.
The problem is with the changes upon a request not being visible to the
following functions called from the script. <br>
So you have to change the header on the generated one, in local route.<br>
<br>
Regards,<br>
Anca<br>
<br>
<br>
On 10/12/2010 10:24 AM, Brett Woollum wrote:
<blockquote cite="mid:1553385795.4311286868252240.JavaMail.root@mail"
type="cite">
<style type="text/css">p { margin: 0; }</style>
<div
style="font-family: Arial,Helvetica,sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">In
addition, the uac_replace_from(display,uri); function does not seem to
work either. I tested this function by putting:<br>
<br>
<span
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">uac_replace_from("TEST",
<a class="moz-txt-link-rfc2396E" href="sip:12345@1.2.3.4">"sip:12345@1.2.3.4"</a>);</span><br>
<br>
immediately above the call to B2B_INIT_REQUEST and the outbound "From:"
header remains unchanged (incorrect).<br>
<br>
<div><span style="font-family: arial,helvetica,sans-serif;">Brett
Woollum</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"><a class="moz-txt-link-abbreviated" href="mailto:Brett@Woollum.com">Brett@Woollum.com</a></span><br>
</div>
<br>
<br>
----- Original Message -----<br>
From: "Brett Woollum" <a class="moz-txt-link-rfc2396E" href="mailto:brett@woollum.com"><brett@woollum.com></a><br>
To: "users-request" <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a><br>
Sent: Monday, October 11, 2010 11:53:39 PM GMT -08:00 US/Canada Pacific<br>
Subject: [OpenSIPS-Users] B2BUA "From" Header & Caller-ID Question<br>
<br>
<style>p { margin: 0; }</style>
<div
style="font-family: Arial,Helvetica,sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Hello,<br>
<br>
I have a working implementation of the B2BUA modules for OpenSIPS. One
problem I am having is that the B2BUA module doesn't seem to respect
the "From:" header that I updated before B2B_INIT was called (at the
end of the script). Before I call B2B_INIT, my script looks up the
correct caller-id from a database and replaces the "From:" header with
the new information. Here is that code:<br>
<br>
<span
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">xlog("This
is an external call...");</span><br
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">
<span
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">avp_db_query("select
id from subscriber where username=\"$fU\" AND domain=\"1.2.3.4\"",
"$avp(s:subscriber_id)");</span><br
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">
<span
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">if(is_avp_set("$avp(s:subscriber_id)")){
</span><br
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">
<span
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">
avp_db_query("select
external_cid_name,external_cid_uri,external_cid_uri_domain from cid
where subscriber_id=\"$avp(s:subscriber_id)\"",
"$avp(s:external_cid_name);$avp(s:external_cid_uri);$avp(s:external_cid_uri_domain)");</span><br
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">
<span
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">
remove_hf("From");</span><br
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">
<span
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">
append_hf("From: \"$avp(s:external_cid_name)\"
<a class="moz-txt-link-rfc2396E" href="sip:$avp(s:external_cid_uri)@$avp(s:external_cid_uri_domain)"><sip:$avp(s:external_cid_uri)@$avp(s:external_cid_uri_domain)></a>;tag=$ft\r\n");</span><br
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">
<span
style="font-family: Courier New,courier,monaco,monospace,sans-serif;">}</span><br>
<br>
The resulting "From": header is perfect (it includes the new caller-id
information) and works without problems when I don't use the B2BUA
module. It seems as though the B2BUA module (which is called last in
the script) does not respect the new header, and instead processes the
call using whatever was in $fu when the script started. Unfortunately
$fu is not writable, so I can't directly change it. <br>
<br>
What are some possible work-arounds to get the B2BUA module to create
the new call but include the "From:" header that I've updated earlier
in the script? <br>
<br>
Any ideas are greatly appreciated!<br>
<br>
<div><span style="font-family: arial,helvetica,sans-serif;">Brett
Woollum</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"><a class="moz-txt-link-abbreviated" href="mailto:Brett@Woollum.com">Brett@Woollum.com</a></span><br>
</div>
<br>
</div>
<br>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Anca Vamanu
<a class="moz-txt-link-abbreviated" href="http://www.voice-system.ro">www.voice-system.ro</a>
</pre>
</body>
</html>