[OpenSIPS-Users] Problem on handing prefixed contact number from Cisco GW

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Apr 4 20:36:39 CEST 2011


Hi Joel,

On 04/01/2011 03:29 PM, joel.oliveira wrote:
> Hi all,
>
> Having fought this problem for almost 2 days now. I have the next topology
> on my system:
>
> Client (Softphone Eyebeam) ->  Opensips 1.6.4-notls with virtual-ip ->  Cisco
> Media GW ->  PSTN
>
> When I place a call from a Client to a number on the PSTN, I prefix the
> callee number with a number and deliver it to the the Cisco GW via dynamic
> routing module.
> (e.g. Client 5555 calls 6666, Opensips adds 44 and delivers the call to
> Cisco making the callee number 446666).
>
> Until now there is no problem, the problem starts when Cisco responses to
> the Invite, with the 180 Ringing and the 200 OK with the Contact header with
> the prefixed number 446666. Well, I don't want my client to see the prefixed
> number so I need to change the Contact header of the returning SIP message
> before delivering it to the client.
>
> I tryed changing the Contact header on the reply_route but unfortenately
> there is no way to access the $ct variable on the reply_route. I also tryed
> to have a b2b logic in it, but after testing it I continued to received the
> prefixed number in the Contact header.
>
> Does anybody has crossed the same problem as me? If so, does anyone has any
> idea on how to solve my problem? Don't get me wrong but the calls are
> delivered all right, it's only a matter of information that I don't want to
> show to my end-user.
>
> My Opensips script is available here:
> http://pastebin.com/qFvfZru5
>
> Thanks in Advance,
> Joel Oliveira

I see in your script you tried to remove and add a new contact hdr - did 
it work? Did you end up in with the xlogs() showing that the script 
execution goes into the "if" block?

Also, I see the condition:
if($((avp(s:ct_gw){uri.username}){s.substr,5,4}) == )

But the ct_gw AVP is never set :(....and there is no right side in the 
condition :)

maybe you could try to "catch" the contacts with username part in 
onreply route as:
         if ( $(ct.fields(uri){uri.username})=="" ) {.....}
See:
     http://www.opensips.org/Resources/DocsCoreVar16#toc21

Regards,
Bogdan

-- 
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"




More information about the Users mailing list