Hey 侯旭光,
please keep SR-Users in CC so others can share in some assistance and
benefit from a solution.
On 04.03.2011 08:29, 侯旭光 wrote:
> I did trace the dialog in the initial REQUEST
>
> my script:
> ...
> modparam("dialog","dlg_flag","4")
> ...
> route{
>
> if (is_method("INVITE")){
> dlg_setflag("2");
> dlg_manage();
> ...
> if(avp_db_load("$ruri/username","$avp(s:busyforward)"))
> {
> setflag(26);
> t_on_failure(FAIL_ONE);
> }
> ...
> }
> failure_route[FAIL_ONE]{
> ...
> if(isflagset(26)&&t_check_status("486"))
> {
> $ru=$avp(s:busyforward);
> append_branch();
> dlg_setflag("2");
> avp_delete("$avp(s:busyforward)");
> resetflag("26");
> lookup("location");
> route(RELAY);
> }
> ...
> }
> route[RELAY]{
> if(!t_relay()){
> sl_reply_error();
> }
> }
> #----------------------------------------------------------------------#
>
> Is anything wrong?
You set flag 2 but showed flag 4 to be modparam'ed to the dialog flag.
Is that intentional?
Anyways, since you are doing dlg_manage() in the INVITE transaction, you
should still be fine. Just for the sake of debugging, can you set flag 4
in your 'is_method("INVITE")' block and see if it makes a difference? I
have no in-depth experience with on demand dialog tracking as we use the
dialog flag exclusively.
By the way, I see no calls to set_dlg_profile() in your route logic. Is
this really an excerpt of the configuration you are having trouble with?
Cheers,
--Timo
>
> 2011/3/3 Timo Reimann <timo.reimann(a)1und1.de>:
>> Hi,
>>
>>
>> On 03.03.2011 14:47, 侯旭光 wrote:
>>> set_dlg_profile() function carshed in failure_route when I need do the
>>> call-forwarding.
>>>
>>> When in busy-call-forward or no-answer-forward mode ,it'll run into
>>> the failure_route.But at the time , the route_type of the dialog is
>>> FAILURE_ROUTE and the get_current_dialog() return NULL,
>>>
>>> then the set_dlg_profile() function won't work.
>>>
>>> How can I set dialog profile in the busy or no-answer call-forwarding ?
>>>
>>> CRITIAL dialog [dlg_profile.c]: BUG - dialog not found in non
> REQUEST route
>>> ERROR dialog [dialog.c] : failed to set profile
>>
>> I think you did not track the dialog in the first place, i.e., when the
>> initial request associated to the dialog you seek to profile was
> processed.
>>
>> Are you using dlg_flag, and if so, have you enabled it in REQUEST_ROUTE?
>> If you want to track dialogs on demand instead, try calling dlg_manage()
>> prior to calling set_dlg_profile(). I'm not sure if this is the most
>> elegant approach for your use case but it might at least work.
>>
>>
>> Cheers,
>>
>> --Timo