[OpenSIPS-Users] opensips 487 respose

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Mar 26 12:51:01 CET 2010


Hi Rajib,

rajib deka wrote:
> Hi Bogdan,
>  
> I have used the following to add the header to '487 reply' but I am 
> not getting it on the other end. Is something wrong with the script.
>  
> onreply_route[1] {
>         if(t_check_status("487")) {
>                 cache_fetch("local", "dst",$avp(s:dst));
>                 append_hf("OS-LB-GW: $avp(s:dst)\r\n");
>                 xlog("487 at reply route");
>         }
> }
does your xlog pops up in syslog? if not, try to put an xlog in the 
beginning of the route to see if it is triggered . Also be sure you have 
the t_on_reply() armed for the call.

> failure_route[1] {
>         if(t_check_status("487")) {
>                 cache_fetch("local", "dst",$avp(s:dst));
>                 append_hf("OS-LB-GW: $avp(s:dst)\r\n");
>                 xlog("request terminated");
>         }
this will not work as in failure route you process the request and not 
the reply, so you add to the wrong message. See
             http://www.opensips.org/Resources/DocsCoreRoutes16#toc3

Regards,
Bogdan
>  
>  
> SIP/2.0 487 Request Terminated
> Via: SIP/2.0/UDP 172.42.173.241:5060;branch=z9hG4bK15d71bf9;rport=5060
> From: "15012" <sip:15012 at 172.42.173.241 
> <mailto:sip%3A15012 at 172.42.173.241>>;tag=as26742360
> To: <sip:15000 at 172.42.173.241:5070 
> <http://sip:15000@172.42.173.241:5070>>;tag=0f79c926a81c7a4b8accb9b5fcafd151-c141
> Call-ID: 5d5f8bce5345208e206f9213508cc5fc at 172.42.173.241 
> <mailto:5d5f8bce5345208e206f9213508cc5fc at 172.42.173.241>
> CSeq: 102 INVITE
> Server: Servion SIP Proxy
> Content-Length: 0
>
> Regards
> Rajib
>
> On Thu, Mar 25, 2010 at 7:08 PM, rajib deka <rajibdk at gmail.com 
> <mailto:rajibdk at gmail.com>> wrote:
>
>     Yes :), CANCEL message send by asterisk to cancel the INVITE.
>     Thank you.
>      
>     Regards
>     Rajib 
>
>     On Thu, Mar 25, 2010 at 6:55 PM, Bogdan-Andrei Iancu
>     <bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>> wrote:
>
>         you mean the 487 in for INVITE that was cancelled and not for
>         the CANCEL
>         itself ;).
>
>         if, you can use the onreply_route for the INVITE transaction
>         and use
>         "status" keyword to check the code -> append_hf()
>
>
>         Regards,
>         Bogdan
>
>         rajib deka wrote:
>         > Hi Bogdan,
>         >
>         > My situation as follows
>         >
>         > asterisk -> opensips -> SIP trunk
>         > I am receiving 487 at asterisk from opensips for CANCEL. I
>         want to add
>         > a header to 487 from opensips reply or failure route, so
>         that i can
>         > parse it in asterisk to get the header.
>         >
>         > Regards
>         > Rajib
>         > On Thu, Mar 25, 2010 at 4:15 PM, Bogdan-Andrei Iancu
>         > <bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>
>         <mailto:bogdan at voice-system.ro
>         <mailto:bogdan at voice-system.ro>>> wrote:
>         >
>         >     Hi Rajib,
>         >
>         >     is this 487 reply received? if so, use onreply_route +
>         append_hf("Foo:
>         >     bar \r\n");
>         >
>         >     Regards,
>         >     Bogdan
>         >
>         >     rajib deka wrote:
>         >     > Hi List,
>         >     >
>         >     > is it possible to add a header to '487' response. I
>         tried the
>         >     same in
>         >     > on_reply and failure route but I am not getting it at
>         the UAC end.
>         >     > Regards
>


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list