convert from tel: to sip: on To header

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

convert from tel: to sip: on To header

alain BIEUZENT

Hi All,

 

what is the best way to convert « tel: » format to « sip: » on a To header.

 

For exemple :

 

INVITE sip:+[hidden email];user=phone SIP/2.0

Via: SIP/2.0/UDP X.Y.Z.Z:5060;branch=z9hG4bKiqehr50040ilbvfkjfn0.1

To: <tel:+33999999999>

From: "De 0888888888"<sip:+[hidden email];user=phone>;tag=SDu2kba01-1653662573-1544626875515-

Call-ID: SDu2kba01-1317d56f03e5fc6d6dc2136c0254bed0-v300g00

CSeq: 293066302 INVITE

Max-Forwards: 67

Content-Length: 255

 

I want to convert : « To: <a href="tel:+33999999999">tel:+33999999999 » to « To: <a href="sip:33999999999@A.B.C.D:5060">sip:33999999999@...:5060 »
 
Thanks for your help

 

 

 


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

Re: convert from tel: to sip: on To header

alain BIEUZENT

Reply to myself, perhaps it can help someone

 

##### if we receive a call with "tel:" in To header we remove it

        $var(str) = 'tel:';

        $var(tu) = $tu;

        if ($(var(tu){s.index, $var(str)}) >=0)

        {

                $var(reg) = "/tel://g";

                $var(newtu) = $(var(tu){re.subst,$var(reg)});

                uac_replace_to("","sip:$var(newtu)@$Ri");

        }

 

De : Users <[hidden email]> au nom de Alain Bieuzent <[hidden email]>
Répondre à : OpenSIPS users mailling list <[hidden email]>
Date : mercredi 12 décembre 2018 à 17:10
À : OpenSIPS users mailling list <[hidden email]>
Objet : [OpenSIPS-Users] convert from tel: to sip: on To header

 

Hi All,

 

what is the best way to convert « tel: » format to « sip: » on a To header.

 

For exemple :

 

INVITE sip:+[hidden email];user=phone SIP/2.0

Via: SIP/2.0/UDP X.Y.Z.Z:5060;branch=z9hG4bKiqehr50040ilbvfkjfn0.1

To: <tel:+33999999999>

From: "De 0888888888"<sip:+[hidden email];user=phone>;tag=SDu2kba01-1653662573-1544626875515-

Call-ID: SDu2kba01-1317d56f03e5fc6d6dc2136c0254bed0-v300g00

CSeq: 293066302 INVITE

Max-Forwards: 67

Content-Length: 255

 

I want to convert : « To: <a href="tel:+33999999999">tel:+33999999999 » to « To: <a href="sip:33999999999@A.B.C.D:5060">sip:33999999999@...:5060 »
 
Thanks for your help

 

 

 

_______________________________________________ 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: convert from tel: to sip: on To header

Ben Newlin

Alain,

 

The URI module also contains a tel2sip conversion function you may wish to use. It properly handles converting parameters from tel: to sip: format, which I don’t believe your solution does.

 

https://opensips.org/html/docs/modules/2.4.x/uri.html#func_tel2sip

 

Ben Newlin

 

From: Users <[hidden email]> on behalf of Alain Bieuzent <[hidden email]>
Reply-To: OpenSIPS users mailling list <[hidden email]>
Date: Thursday, December 13, 2018 at 5:57 AM
To: OpenSIPS users mailling list <[hidden email]>
Subject: Re: [OpenSIPS-Users] convert from tel: to sip: on To header

 

Reply to myself, perhaps it can help someone

 

##### if we receive a call with "tel:" in To header we remove it

        $var(str) = 'tel:';

        $var(tu) = $tu;

        if ($(var(tu){s.index, $var(str)}) >=0)

        {

                $var(reg) = "/tel://g";

                $var(newtu) = $(var(tu){re.subst,$var(reg)});

                uac_replace_to("","sip:$var(newtu)@$Ri");

        }

 

De : Users <[hidden email]> au nom de Alain Bieuzent <[hidden email]>
Répondre à : OpenSIPS users mailling list <[hidden email]>
Date : mercredi 12 décembre 2018 à 17:10
À : OpenSIPS users mailling list <[hidden email]>
Objet : [OpenSIPS-Users] convert from tel: to sip: on To header

 

Hi All,

 

what is the best way to convert « tel: » format to « sip: » on a To header.

 

For exemple :

 

INVITE sip:+[hidden email];user=phone SIP/2.0

Via: SIP/2.0/UDP X.Y.Z.Z:5060;branch=z9hG4bKiqehr50040ilbvfkjfn0.1

To: <tel:+33999999999>

From: "De 0888888888"<sip:+[hidden email];user=phone>;tag=SDu2kba01-1653662573-1544626875515-

Call-ID: SDu2kba01-1317d56f03e5fc6d6dc2136c0254bed0-v300g00

CSeq: 293066302 INVITE

Max-Forwards: 67

Content-Length: 255

 

I want to convert : « To: <a href="tel:&#43;33999999999">tel:+33999999999 » to « To: <a href="sip:33999999999@A.B.C.D:5060">sip:33999999999@...:5060 »
 
Thanks for your help

 

 

 

_______________________________________________ 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: convert from tel: to sip: on To header

alain BIEUZENT

Thanks Ben,

 

i see this function of uri module, but as I understand it convert only « tel » format on RURI and not on To (or From) header.

 

Regards

 

De : Users <[hidden email]> au nom de Ben Newlin <[hidden email]>
Répondre à : OpenSIPS users mailling list <[hidden email]>
Date : jeudi 13 décembre 2018 à 14:04
À : OpenSIPS users mailling list <[hidden email]>
Objet : Re: [OpenSIPS-Users] convert from tel: to sip: on To header

 

Alain,

 

The URI module also contains a tel2sip conversion function you may wish to use. It properly handles converting parameters from tel: to sip: format, which I don’t believe your solution does.

 

https://opensips.org/html/docs/modules/2.4.x/uri.html#func_tel2sip

 

Ben Newlin

 

From: Users <[hidden email]> on behalf of Alain Bieuzent <[hidden email]>
Reply-To: OpenSIPS users mailling list <[hidden email]>
Date: Thursday, December 13, 2018 at 5:57 AM
To: OpenSIPS users mailling list <[hidden email]>
Subject: Re: [OpenSIPS-Users] convert from tel: to sip: on To header

 

Reply to myself, perhaps it can help someone

 

##### if we receive a call with "tel:" in To header we remove it

        $var(str) = 'tel:';

        $var(tu) = $tu;

        if ($(var(tu){s.index, $var(str)}) >=0)

        {

                $var(reg) = "/tel://g";

                $var(newtu) = $(var(tu){re.subst,$var(reg)});

                uac_replace_to("","sip:$var(newtu)@$Ri");

        }

 

De : Users <[hidden email]> au nom de Alain Bieuzent <[hidden email]>
Répondre à : OpenSIPS users mailling list <[hidden email]>
Date : mercredi 12 décembre 2018 à 17:10
À : OpenSIPS users mailling list <[hidden email]>
Objet : [OpenSIPS-Users] convert from tel: to sip: on To header

 

Hi All,

 

what is the best way to convert « tel: » format to « sip: » on a To header.

 

For exemple :

 

INVITE sip:+[hidden email];user=phone SIP/2.0

Via: SIP/2.0/UDP X.Y.Z.Z:5060;branch=z9hG4bKiqehr50040ilbvfkjfn0.1

To: <tel:+33999999999>

From: "De 0888888888"<sip:+[hidden email];user=phone>;tag=SDu2kba01-1653662573-1544626875515-

Call-ID: SDu2kba01-1317d56f03e5fc6d6dc2136c0254bed0-v300g00

CSeq: 293066302 INVITE

Max-Forwards: 67

Content-Length: 255

 

I want to convert : « To: <a href="tel:+33999999999">tel:+33999999999 » to « To: <a href="sip:33999999999@A.B.C.D:5060">sip:33999999999@...:5060 »
 
Thanks for your help

 

 

 

_______________________________________________ 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


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

Re: convert from tel: to sip: on To header

Ben Newlin

Alain,

 

Yes, I see now that is the case. My apologies for missing that.

 

Ben Newlin

 

From: Users <[hidden email]> on behalf of Alain Bieuzent <[hidden email]>
Reply-To: OpenSIPS users mailling list <[hidden email]>
Date: Thursday, December 13, 2018 at 8:10 AM
To: OpenSIPS users mailling list <[hidden email]>
Subject: Re: [OpenSIPS-Users] convert from tel: to sip: on To header

 

Thanks Ben,

 

i see this function of uri module, but as I understand it convert only « tel » format on RURI and not on To (or From) header.

 

Regards

 

De : Users <[hidden email]> au nom de Ben Newlin <[hidden email]>
Répondre à : OpenSIPS users mailling list <[hidden email]>
Date : jeudi 13 décembre 2018 à 14:04
À : OpenSIPS users mailling list <[hidden email]>
Objet : Re: [OpenSIPS-Users] convert from tel: to sip: on To header

 

Alain,

 

The URI module also contains a tel2sip conversion function you may wish to use. It properly handles converting parameters from tel: to sip: format, which I don’t believe your solution does.

 

https://opensips.org/html/docs/modules/2.4.x/uri.html#func_tel2sip

 

Ben Newlin

 

From: Users <[hidden email]> on behalf of Alain Bieuzent <[hidden email]>
Reply-To: OpenSIPS users mailling list <[hidden email]>
Date: Thursday, December 13, 2018 at 5:57 AM
To: OpenSIPS users mailling list <[hidden email]>
Subject: Re: [OpenSIPS-Users] convert from tel: to sip: on To header

 

Reply to myself, perhaps it can help someone

 

##### if we receive a call with "tel:" in To header we remove it

        $var(str) = 'tel:';

        $var(tu) = $tu;

        if ($(var(tu){s.index, $var(str)}) >=0)

        {

                $var(reg) = "/tel://g";

                $var(newtu) = $(var(tu){re.subst,$var(reg)});

                uac_replace_to("","sip:$var(newtu)@$Ri");

        }

 

De : Users <[hidden email]> au nom de Alain Bieuzent <[hidden email]>
Répondre à : OpenSIPS users mailling list <[hidden email]>
Date : mercredi 12 décembre 2018 à 17:10
À : OpenSIPS users mailling list <[hidden email]>
Objet : [OpenSIPS-Users] convert from tel: to sip: on To header

 

Hi All,

 

what is the best way to convert « tel: » format to « sip: » on a To header.

 

For exemple :

 

INVITE sip:+[hidden email];user=phone SIP/2.0

Via: SIP/2.0/UDP X.Y.Z.Z:5060;branch=z9hG4bKiqehr50040ilbvfkjfn0.1

To: <tel:+33999999999>

From: "De 0888888888"<sip:+[hidden email];user=phone>;tag=SDu2kba01-1653662573-1544626875515-

Call-ID: SDu2kba01-1317d56f03e5fc6d6dc2136c0254bed0-v300g00

CSeq: 293066302 INVITE

Max-Forwards: 67

Content-Length: 255

 

I want to convert : « To: <a href="tel:&#43;33999999999">tel:+33999999999 » to « To: <a href="sip:33999999999@A.B.C.D:5060">sip:33999999999@...:5060 »
 
Thanks for your help

 

 

 

_______________________________________________ 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


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

Re: convert from tel: to sip: on To header

alain BIEUZENT

no worries, we are here to exchange

 

Alain

 

De : Users <[hidden email]> au nom de Ben Newlin <[hidden email]>
Répondre à : OpenSIPS users mailling list <[hidden email]>
Date : jeudi 13 décembre 2018 à 14:42
À : OpenSIPS users mailling list <[hidden email]>
Objet : Re: [OpenSIPS-Users] convert from tel: to sip: on To header

 

Alain,

 

Yes, I see now that is the case. My apologies for missing that.

 

Ben Newlin

 

From: Users <[hidden email]> on behalf of Alain Bieuzent <[hidden email]>
Reply-To: OpenSIPS users mailling list <[hidden email]>
Date: Thursday, December 13, 2018 at 8:10 AM
To: OpenSIPS users mailling list <[hidden email]>
Subject: Re: [OpenSIPS-Users] convert from tel: to sip: on To header

 

Thanks Ben,

 

i see this function of uri module, but as I understand it convert only « tel » format on RURI and not on To (or From) header.

 

Regards

 

De : Users <[hidden email]> au nom de Ben Newlin <[hidden email]>
Répondre à : OpenSIPS users mailling list <[hidden email]>
Date : jeudi 13 décembre 2018 à 14:04
À : OpenSIPS users mailling list <[hidden email]>
Objet : Re: [OpenSIPS-Users] convert from tel: to sip: on To header

 

Alain,

 

The URI module also contains a tel2sip conversion function you may wish to use. It properly handles converting parameters from tel: to sip: format, which I don’t believe your solution does.

 

https://opensips.org/html/docs/modules/2.4.x/uri.html#func_tel2sip

 

Ben Newlin

 

From: Users <[hidden email]> on behalf of Alain Bieuzent <[hidden email]>
Reply-To: OpenSIPS users mailling list <[hidden email]>
Date: Thursday, December 13, 2018 at 5:57 AM
To: OpenSIPS users mailling list <[hidden email]>
Subject: Re: [OpenSIPS-Users] convert from tel: to sip: on To header

 

Reply to myself, perhaps it can help someone

 

##### if we receive a call with "tel:" in To header we remove it

        $var(str) = 'tel:';

        $var(tu) = $tu;

        if ($(var(tu){s.index, $var(str)}) >=0)

        {

                $var(reg) = "/tel://g";

                $var(newtu) = $(var(tu){re.subst,$var(reg)});

                uac_replace_to("","sip:$var(newtu)@$Ri");

        }

 

De : Users <[hidden email]> au nom de Alain Bieuzent <[hidden email]>
Répondre à : OpenSIPS users mailling list <[hidden email]>
Date : mercredi 12 décembre 2018 à 17:10
À : OpenSIPS users mailling list <[hidden email]>
Objet : [OpenSIPS-Users] convert from tel: to sip: on To header

 

Hi All,

 

what is the best way to convert « tel: » format to « sip: » on a To header.

 

For exemple :

 

INVITE sip:+[hidden email];user=phone SIP/2.0

Via: SIP/2.0/UDP X.Y.Z.Z:5060;branch=z9hG4bKiqehr50040ilbvfkjfn0.1

To: <tel:+33999999999>

From: "De 0888888888"<sip:+[hidden email];user=phone>;tag=SDu2kba01-1653662573-1544626875515-

Call-ID: SDu2kba01-1317d56f03e5fc6d6dc2136c0254bed0-v300g00

CSeq: 293066302 INVITE

Max-Forwards: 67

Content-Length: 255

 

I want to convert : « To: <a href="tel:+33999999999">tel:+33999999999 » to « To: <a href="sip:33999999999@A.B.C.D:5060">sip:33999999999@...:5060 »
 
Thanks for your help

 

 

 

_______________________________________________ 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

_______________________________________________ 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