[OpenSIPS-Users] inbounts calls problems

pjgonzalez pgonzalez at dgtec.net.do
Thu Jan 22 22:11:27 CET 2009


Thanks a lot.

all is ok, and very good.

i will rewrite  my script.



Iñaki Baz Castillo wrote:
> 
> El Jueves, 22 de Enero de 2009, pjgonzalez escribió:
>> The user has 3 form to receive his inbount calls base on the following
>> preference:
>>
>> When the user is online:
>>
>> he can select one of the following state:
>>
>> 1-Receive his calls on his softphone.
>> 2-Forward his calls to another number on PSTN.
>>
>> when user is offline:
>>
>> sent his calls to voicemail.
> 
> 
> The problem is that you are using:
>   if(!lookup("location")){
> and later select if you want the INVITE arrives to the registered user or
> to a 
> PSTN number.
> 
> But when a user is registered behind NAT and you do:
>   lookup("location")
> then $du variavle is set containing the public IP of the registered
> contact. 
> $du is the **REAL** destination of the request, even if you later modify
> the 
> RURI.
> 
> A workaround would be modifying $du if the user wants to receive the call
> in 
> the PSTN number.
> But a more ellegant way is using "is_registered()" function that just
> returns 
> true or false but doesn't set $du and doesn't modify $ru. This is:
> 
> - INVITE received.
> - Do "is_registered()".
> - If true: route[13]
> - If false: voicemail
> 
> in route[13]:
> 
> - If the user wants to receive the INVITE then do: lookup("location").
> - If he prefers to receive in the PSTN phone then replace the RURI with
> the 
> PSTN URI.
> 
> Regards.
> 
> PD: I suggest you to read about the $du variable in the OpenSIPS wiki 
> (pseudo-variables section).
> 
> 
> -- 
> Iñaki Baz Castillo
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://n2.nabble.com/inbounts-calls-problems-tp2197805p2200202.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.




More information about the Users mailing list