Correct way of setting the Remote-Party-ID headers

I have installed Asterisk and setup a registration for my provider that is FlowRoute. Now I can make external calls but the problem is that I cannot set my caller id properly.

Flowroute transmits the caller-id in the P-Asserted-Identity or Remote-Party-ID or From headers in the SIP packets.

What is the proper way to set any/all of these headers ? I have done the following in my outgoing dialplan

exten => _X.,1,SIPAddHeader(P-Asserted-Identity:+0123456789)
same => n,Dial(flowroute/${EXTEN})

This definitely dials the number from my softphone but the caller id is not set.

By replacing SIPAddHeader with Set($(CALLERID(num)=+0123456789) I sometimes get the caller id correct, but most the time no, which is very weird.

  1. How do I set the above mentioned headers correctly ? An example dial plan would really be helpful.

  2. Where do I place sendrpid, in the provider peer or the softphone peer or in the sip.conf general section.

  3. Is trustrpid required ? If so where and what should it be set to ?

  4. Do I need a HangUp application at the end of my dial plan after the Dial to my provider ?

You should use the options you’ve mentioned instead of doing it manually.
sendrpid tells chan_sip to send a Remote-Party-ID in the signaling. You would need this on the provider.
trustrpid tells chan_sip to parse and use Remote-Party-ID in the signaling. You would need this on the provider.
An explicit Hangup() is not required.

So just to get this straight could you tell if the give syntax is correct ?


And in the dialplan -:

exten => _X.,1,Set(CALLERID(num)=0123456789)
same => n, Dial(SIP/Flowroute/${EXTEN})

Is the above correct ?

Should sendrpid be equal to yes or should it be equal to pai ie. P-Asserted-Identity.

Also do you have any idea why sometimes the caller id works and sometimes it doesn’t ?

Could it be that some packets are lost on the way to the provider? I have been getting Re transmission error messages in the Asterisk Console, it referred me to this page.

Would shifting to TCP SIP maybe help ?

Also could what is the difference between

What is rport and comedia ?

What it should be equal to is dependent on the ITSP. If they will accept PAI, then you can use that. If they will accept RPID then you can use that. It’s unlikely packets are getting lost. The usage is correct. You’d need to provide console log in a case where it doesn’t work for any further help.

I have got the entire sip debug log. Could you be a little more specific to what you might need to that the debugging can be done faster.

The SIP INVITE in particular.

Okay I think since I am from India it is a signalling issue for my service provider, could you tell me where I can put the options of cidstart and cidesignalling ?

Please note I have installed Asterisk without Dahdi or Zaptel, I am interested in only SIP.

I have found some instructions on this page, but I don’t know how to apply it.

Those options are only applicable to Dahdi and Zaptel. They can not be set on SIP and have no meaning there.

Then how is the caller id sent during SIP calls to PSTN ? Can signalling be an issue when sending the caller id from SIP to PSTN calls ? I mean what I am trying to do is trying to call my cell phone from my SIP softphone and have a particular caller id show up there.

Can signalling be an issue in the above case ? If so what are the options to tweak it, if there are any ?

One small mention. I am interested only in SIP but what if I install Asterisk with DAHDI and ZAPTEL then will I be any closer to solving my problem ?

CallerID information can be sent using various headers in the SIP signaling and is dependent on the provider. They also have to allow you to set it. The options which control it in chan_sip are sendpai and sendrpid.

1 Like

It would also be useful to provide the SIP INVITE like I mentioned so we can see what is actually being sent.