Diversion information

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Diversion information

kostenftw
When calls are forwarded they have a diversion header, containing information about the forwarded route. why cant i get this information i keep getting 0 or NULL values my code is something like this to display the diversion header.

   
        $var(RDNIS)=$di;
        $var(PRIV)=$dip;

        if (method=="INVITE")
        {
                xlog("L_DBG","\n RDNIS = $var(RDNIS) \n");
                xlog("L_DBG","\n PRIVACY = $var(PRIV) n");

                if (lookup("location"))
                {
                        t_relay();
                        exit;
                };


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Diversion information

Bogdan-Andrei Iancu-2
Hello Mike,

Please post the SIP request you receive (make an ngrep capture), so we can check it.

BTW, try to run in full debug mode (debug=4) and check for the logs when the INVITE is handled - maybe you get some hints on why you get the vars NULL.

Regards,
Bogdan
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 04.04.2014 10:58, Mike Claudi Pedersen wrote:
When calls are forwarded they have a diversion header, containing information about the forwarded route. why cant i get this information i keep getting 0 or NULL values my code is something like this to display the diversion header.

   
        $var(RDNIS)=$di;
        $var(PRIV)=$dip;

        if (method=="INVITE")
        {
                xlog("L_DBG","\n RDNIS = $var(RDNIS) \n");
                xlog("L_DBG","\n PRIVACY = $var(PRIV) n");

                if (lookup("location"))
                {
                        t_relay();
                        exit;
                };



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Diversion information

Bogdan-Andrei Iancu-2
I see the Diversion hdr is present in a 3xx reply -> are you using the $di in failure route or so ?

Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 04.04.2014 12:59, Mike Claudi Pedersen wrote:
i cant seem to see why. even in debug mode...
i have the siptrace attached


2014-04-04 11:54 GMT+02:00 Bogdan-Andrei Iancu <[hidden email]>:
Hello Mike,

Please post the SIP request you receive (make an ngrep capture), so we can check it.

BTW, try to run in full debug mode (debug=4) and check for the logs when the INVITE is handled - maybe you get some hints on why you get the vars NULL.

Regards,
Bogdan
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 04.04.2014 10:58, Mike Claudi Pedersen wrote:
When calls are forwarded they have a diversion header, containing information about the forwarded route. why cant i get this information i keep getting 0 or NULL values my code is something like this to display the diversion header.

   
        $var(RDNIS)=$di;
        $var(PRIV)=$dip;

        if (method=="INVITE")
        {
                xlog("L_DBG","\n RDNIS = $var(RDNIS) \n");
                xlog("L_DBG","\n PRIVACY = $var(PRIV) n");

                if (lookup("location"))
                {
                        t_relay();
                        exit;
                };



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




--
Med venlig hilsen
ipnordic A/S

Mike Claudi Pedersen
Tekniker

Telefon: 79301033
www.ipnordic.dk


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Diversion information

Bogdan-Andrei Iancu-2
As the Diversion hdr is in a negative reply, it will be visible only in onreply_route (as $di) or in failure route (as $(<reply>di)

To better understand this, please read about routing blocks:
    http://www.opensips.org/Documentation/Script-Routes-1-10
and about variables:
    http://www.opensips.org/Documentation/Script-CoreVar-1-10

Regards
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 04.04.2014 13:53, Mike Claudi Pedersen wrote:
I actually don't know. but where would i be able to see $di.. in which route from the default cfg


2014-04-04 12:43 GMT+02:00 Bogdan-Andrei Iancu <[hidden email]>:
I see the Diversion hdr is present in a 3xx reply -> are you using the $di in failure route or so ?

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 04.04.2014 12:59, Mike Claudi Pedersen wrote:
i cant seem to see why. even in debug mode...
i have the siptrace attached


2014-04-04 11:54 GMT+02:00 Bogdan-Andrei Iancu <[hidden email]>:
Hello Mike,

Please post the SIP request you receive (make an ngrep capture), so we can check it.

BTW, try to run in full debug mode (debug=4) and check for the logs when the INVITE is handled - maybe you get some hints on why you get the vars NULL.

Regards,
Bogdan
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 04.04.2014 10:58, Mike Claudi Pedersen wrote:
When calls are forwarded they have a diversion header, containing information about the forwarded route. why cant i get this information i keep getting 0 or NULL values my code is something like this to display the diversion header.

   
        $var(RDNIS)=$di;
        $var(PRIV)=$dip;

        if (method=="INVITE")
        {
                xlog("L_DBG","\n RDNIS = $var(RDNIS) \n");
                xlog("L_DBG","\n PRIVACY = $var(PRIV) n");

                if (lookup("location"))
                {
                        t_relay();
                        exit;
                };



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




--
Med venlig hilsen
ipnordic A/S

Mike Claudi Pedersen
Tekniker

Telefon: 79301033
www.ipnordic.dk




--
Med venlig hilsen
ipnordic A/S

Mike Claudi Pedersen
Tekniker

Telefon: 79301033
www.ipnordic.dk


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Diversion information

kostenftw
okay.. if i want to make an exception that only handles calls with diversion info i should do it in one of those routes ? right now i'm handling all of my calls in the same route
Reply | Threaded
Open this post in threaded view
|

Re: Diversion information

Bogdan-Andrei Iancu-2
Hello Mike,

Once again, it depends in what kind of SIP messages you get the
"diversion info" - if you get it into a requests, you can handle it in
the main route; but if you get in replies, you need to to do it in
failure route or reply route.

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 07.04.2014 10:53, kostenftw wrote:

> okay.. if i want to make an exception that only handles calls with diversion
> info i should do it in one of those routes ? right now i'm handling all of
> my calls in the same route
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Diversion-information-tp7590569p7590604.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Diversion information

Bogdan-Andrei Iancu-2
In reply to this post by kostenftw
Once again, if you get the Diversion header in the 300 reply, you can access it from fsilutr route via $(<reply>di) variable.

Regards,
Bogdan


Sent from Samsung Mobile


-------- Original message --------
From: Mike Claudi Pedersen
Date:07/04/2014 13:37 (GMT+02:00)
To: Bogdan-Andrei Iancu
Subject: Re: [OpenSIPS-Users] Diversion information

i have tried to call the variable $di from various routes now, they are all returning NULL? im not usre if it is my test setup that is failing but i have 2 test numbers 1000 and 1001.. on 1001 i have a permanent forward to 1000 and i then call 1001 from 1000, and get redirected to 1000.. shouldnt this generate a diversion header. when i trace it, it sure looks like its being generated, but i simply cant call this value from anywhere i only wanna use it for the purpose of showing the original caller in case of redirected calls.



2014-04-07 11:25 GMT+02:00 Mike Claudi Pedersen <[hidden email]>:
first time i encounter any diversion info is when i get the 302 moved temporarily, and the next sip message is an invite? so i would assume that it is a request ? 


2014-04-07 11:16 GMT+02:00 Bogdan-Andrei Iancu <[hidden email]>:

Hello Mike,

Once again, it depends in what kind of SIP messages you get the "diversion info" - if you get it into a requests, you can handle it in the main route; but if you get in replies, you need to to do it in failure route or reply route.


Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 07.04.2014 10:53, kostenftw wrote:
okay.. if i want to make an exception that only handles calls with diversion
info i should do it in one of those routes ? right now i'm handling all of
my calls in the same route



--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Diversion-information-tp7590569p7590604.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users






--
Med venlig hilsen
ipnordic A/S

Mike Claudi Pedersen
Tekniker

Telefon: 79301033
www.ipnordic.dk



--
Med venlig hilsen
ipnordic A/S

Mike Claudi Pedersen
Tekniker

Telefon: 79301033
www.ipnordic.dk

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Diversion information

Bogdan-Andrei Iancu-2
In reply to this post by kostenftw
That's a typo - I ment failure route :) .


Sent from Samsung Mobile


-------- Original message --------
From: Mike Claudi Pedersen
Date:08/04/2014 08:10 (GMT+01:00)
To: Bogdan-Andrei Iancu
Subject: Re: [OpenSIPS-Users] Diversion information

what exactly do you mean with fsilutr ? i cant seem to find that route and the could you given an exact example of the syntax of the $di variable when i need to call it, im not sure what you mean by $(<reply>di) what could be where <reply> is?. sorry for the trouble i'm relatively new to this, and trying to do a school project on openSIPS


2014-04-07 13:08 GMT+02:00 Bogdan-Andrei Iancu <[hidden email]>:
Once again, if you get the Diversion header in the 300 reply, you can access it from fsilutr route via $(<reply>di) variable.

Regards,
Bogdan


Sent from Samsung Mobile


-------- Original message --------
From: Mike Claudi Pedersen
Date:07/04/2014 13:37 (GMT+02:00)
To: Bogdan-Andrei Iancu
Subject: Re: [OpenSIPS-Users] Diversion information

i have tried to call the variable $di from various routes now, they are all returning NULL? im not usre if it is my test setup that is failing but i have 2 test numbers 1000 and 1001.. on 1001 i have a permanent forward to 1000 and i then call 1001 from 1000, and get redirected to 1000.. shouldnt this generate a diversion header. when i trace it, it sure looks like its being generated, but i simply cant call this value from anywhere i only wanna use it for the purpose of showing the original caller in case of redirected calls.



2014-04-07 11:25 GMT+02:00 Mike Claudi Pedersen <[hidden email]>:
first time i encounter any diversion info is when i get the 302 moved temporarily, and the next sip message is an invite? so i would assume that it is a request ? 


2014-04-07 11:16 GMT+02:00 Bogdan-Andrei Iancu <[hidden email]>:

Hello Mike,

Once again, it depends in what kind of SIP messages you get the "diversion info" - if you get it into a requests, you can handle it in the main route; but if you get in replies, you need to to do it in failure route or reply route.


Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 07.04.2014 10:53, kostenftw wrote:
okay.. if i want to make an exception that only handles calls with diversion
info i should do it in one of those routes ? right now i'm handling all of
my calls in the same route



--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Diversion-information-tp7590569p7590604.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users






--
Med venlig hilsen
ipnordic A/S

Mike Claudi Pedersen
Tekniker

Telefon: 79301033
www.ipnordic.dk



--
Med venlig hilsen
ipnordic A/S

Mike Claudi Pedersen
Tekniker

Telefon: 79301033
www.ipnordic.dk



--
Med venlig hilsen
ipnordic A/S

Mike Claudi Pedersen
Tekniker

Telefon: 79301033
www.ipnordic.dk

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users