[OpenSIPS-Users] UAC and Dialplan mixing Informations between transactions

Antonio Anderson Souza antonio at voicetechnology.com.br
Fri May 28 14:49:22 CEST 2010


Hi Bogdan,

Which is the best way to check the dialplan output? Compare if input and
output are equals after dp_translate [1], or dp_translate function returns
something [2]?

[1] -----------------------------------------
  if ( $avp(s:pre_to_id) != null ) {
    dp_translate("$avp(s:pre_to_id)", "$tU/$var(pre_to_user)")
    if ( $tU != $var(pre_to_user)) {
      $var(s:to) = $var(pre_to_user);
      uac_replace_to("$var(pre_to_user)","sip:$var(pre_to_user)@$td") ;
      xlog("L_INFO", "PreRouting to TO: $rm gw:[$si:$sp] ruri:[$ru]
from:[$fu] to:[$tu] sourceip:[$si] callid:[$ci]\n");
    }
  }


[2] -----------------------------------------
  if ( $avp(s:pre_to_id) != null ) {
    if ( dp_translate("$avp(s:pre_to_id)", "$tU/$var(pre_to_user)")) {
      $var(s:to) = $var(pre_to_user);
      uac_replace_to("$var(pre_to_user)","sip:$var(pre_to_user)@$td") ;
      xlog("L_INFO", "PreRouting to TO: $rm gw:[$si:$sp] ruri:[$ru]
from:[$fu] to:[$tu] sourceip:[$si] callid:[$ci]\n");
    }
  }

Thank you very much,

Antonio Anderson Souza
Voice Technology
http://www.antonioams.com


On Fri, May 28, 2010 at 9:40 AM, Antonio Anderson Souza <
antonio at voicetechnology.com.br> wrote:

> Hi Bogdan,
>
> I'm not checking the dialplan return, follow bellow the script snippet.
>
>   if ( $avp(s:pre_to_id) != null ) {
>     dp_translate("$avp(s:pre_to_id)", "$tU/$var(pre_to_user)");
>     $var(s:to) = $var(pre_to_user);
>     uac_replace_to("$var(pre_to_user)","sip:$var(pre_to_user)@$td") ;
>     xlog("L_INFO", "PreRouting to TO: $rm gw:[$si:$sp] ruri:[$ru]
> from:[$fu] to:[$tu] sourceip:[$si] callid:[$ci]\n");
>   }
>
> I'll change the script to check the dp_translate return before execute
> uac_replace_to, and I'll send a feedback to the list.
>
> Thank you very much,
>
>
> Antonio Anderson Souza
> Voice Technology
> http://www.antonioams.com
>
>
> On Fri, May 28, 2010 at 3:33 AM, Bogdan-Andrei Iancu <
> bogdan at voice-system.ro> wrote:
>
>> Hi Antonio,
>>
>> how do you pass the information (output of dp_translate) to the
>> uac_replace_to() ? Are you also checking all the time the return code of
>> dp_translate to be sure there is an output?
>>
>> Regards,
>> Bogdan
>>
>> Antonio Anderson Souza wrote:
>> > Dear All,
>> >
>> > I'm using the Opensips 1.6.1 with dialplan and uac module to rewrite
>> > the From and To, in such cases.
>> >
>> > I need to make a deeper analyzes, but what's happening the
>> > uac_replace_to change informations between different transactions, for
>> > example:
>> >
>> > Incoming Invite A
>> > from: 551122334455 at 123.123.123
>> > to: 666555566778899 at 123.123.124
>> >
>> > Dialplan A:
>> > matchs: 6665555(.*)
>> > subst:/2
>> >
>> > Outgoing Invite A
>> > from: 551122334455 at 123.123.123
>> > to: 66778899 at 123.123.124
>> >
>> > Incoming Invite B
>> > from: 551122334455 at 222.222.222.222 <mailto:551122334455 at 222.222.222.222
>> >
>> > to: 8885577665544 at 222.222.222.223 <mailto:8885577665544 at 222.222.222.223
>> >
>> >
>> > Dialplan B:
>> > matchs: 88855(.*)
>> > subst:/2
>> >
>> > Outgoing Invite B
>> > from: 551122334455 at 222.222.222.222 <mailto:551122334455 at 222.222.222.222
>> >
>> > to: 66778899 at 222.222.222.223 <mailto:66778899 at 222.222.222.223>
>> >
>> > The To User of Outgoing Invite B should be  77665544 instead of
>> 66778899.
>> >
>> > Does anybody already faced something like that? As I saw some commits
>> > regarding uac, and dialplan in 1.6.2, I'm thinking to update to 1.6.2
>> > to see if it's fix this problem, what do you think?
>> >
>> > If some one could share your opinion with me, I'll very grateful.
>> >
>> > Best regards,
>> >
>> > Antonio Anderson Souza
>> > Voice Technology
>> > http://www.antonioams.com
>> > ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at lists.opensips.org
>> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> >
>>
>>
>> --
>> Bogdan-Andrei Iancu
>> 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/20100528/23987bc6/attachment.htm 


More information about the Users mailing list