[OpenSIPS-Users] B2BUA "From" Header & Caller-ID Question

Brett Woollum brett at woollum.com
Tue Oct 12 19:59:00 CEST 2010


Hi Anca, 

Does this mean that I would need to make the changes after I call B2B_INIT_REQUEST instead of before? If that's the case it sounds like I might want to call B2B_INIT_REQUEST very early in the script... 

Thanks 


Brett Woollum 
Brett at Woollum.com 


----- Original Message ----- 
From: "Anca Vamanu" <anca at opensips.org> 
To: users at lists.opensips.org 
Sent: Tuesday, October 12, 2010 2:37:55 AM GMT -08:00 US/Canada Pacific 
Subject: Re: [OpenSIPS-Users] B2BUA "From" Header & Caller-ID Question 

Hi Brett, 

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. 
So you have to change the header on the generated one, in local route. 

Regards, 
Anca 


On 10/12/2010 10:24 AM, Brett Woollum wrote: 


In addition, the uac_replace_from(display,uri); function does not seem to work either. I tested this function by putting: 

uac_replace_from("TEST", "sip:12345 at 1.2.3.4" ); 

immediately above the call to B2B_INIT_REQUEST and the outbound "From:" header remains unchanged (incorrect). 


Brett Woollum 
Brett at Woollum.com 


----- Original Message ----- 
From: "Brett Woollum" <brett at woollum.com> 
To: "users-request" <users at lists.opensips.org> 
Sent: Monday, October 11, 2010 11:53:39 PM GMT -08:00 US/Canada Pacific 
Subject: [OpenSIPS-Users] B2BUA "From" Header & Caller-ID Question 


Hello, 

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: 

xlog("This is an external call..."); 
avp_db_query("select id from subscriber where username=\"$fU\" AND domain=\"1.2.3.4\"", "$avp(s:subscriber_id)"); 
if(is_avp_set("$avp(s:subscriber_id)")){ 
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)"); 
remove_hf("From"); 
append_hf("From: \"$avp(s:external_cid_name)\" <sip:$avp(s:external_cid_uri)@$avp(s:external_cid_uri_domain)> ;tag=$ft\r\n"); 
} 

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. 

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? 

Any ideas are greatly appreciated! 


Brett Woollum 
Brett at Woollum.com 


_______________________________________________ Users mailing list Users at lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users _______________________________________________
Users mailing list Users at lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users 

-- 
Anca Vamanu www.voice-system.ro 
_______________________________________________ Users mailing list Users at lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20101012/74a66aa6/attachment.htm 


More information about the Users mailing list