To Header Instead Of Request URI Based Routing

Home » Asterisk Users » To Header Instead Of Request URI Based Routing
Asterisk Users 2 Comments

Dear List

It looks like the common way to to sip signaling over a trunk is:

In the Request URI, return the ‘Register’ Contact. In the To: Header, send the destination number.

Unfortunately, asterisk with pjsip (i did not try chan_sip) does expect the dialed extension as request uri and does ignore what it is getting in the To: header.

I could not find any hint in the documentation of this can be changed.

I found instructions for a work-around:

In the meantime: Is there a way to tell the asterisk with pjsip to use the To: header to address an extension?

Kind regards

-BenoƮt Panizzon-

I m p r o W a r e A G – Leiter Commerce Kunden

2 thoughts on - To Header Instead Of Request URI Based Routing

  • Both chan_sip and chan_pjsip use the request URI, there’s no configuration option currently to change it. Most people end up just doing the parsing in the dialplan.


  • –Ljo9hr1YUp93bfRP6XGMAlxf3LTWTOl3u Content-Type: text/plain; charset=utf-8
    Content-Language: de-DE
    Content-Transfer-Encoding: quoted-printable


    do you have access to the system that sends you these calls?
    If it’s also an Asterisk, you could tell it to send another INVITE URI, regardless of what is submitted in the registration.

    On Asterisk with chan_sip you can do it by dialling:


    That is, as said, if the remote system which is sending you the calls is an Asterisk machine so you can just reconfigure the way you get the calls to your local machine.

    If it’s not your system, you need to parse the To: header – for example, with:


    That should give you the dialed number in Variable “DialedNumber”.

    Greetings Max

    Am 22.12.2017 um 14:54 schrieb Benoit Panizzon: