sip.conf: callerid= and trustrpid=no

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

sip.conf: callerid= and trustrpid=no

Postby vitaly » Wed Dec 09, 2015 2:17 am

Hello everyone!
I have an Asterisk 11.13.1 and I'm trying to make sure my users go out with the correct outbound CID for them.

User end points are not trusted.

Currently I'm using these example peer settings in sip.conf for each user:

[7301234]
callerid="John Doe" <7301234>
trustrpid=no

are these settings enough to guarantee that anything John Doe sends regarding his cid number in his SIP headers will not be used, and his outbound CID will always be 7301234?
vitaly
Newsterisk
 
Posts: 5
Joined: Thu Oct 23, 2014 1:43 am

Re: sip.conf: callerid= and trustrpid=no

Postby jcolp » Wed Dec 09, 2015 6:31 am

Not exactly. That explicitly sets the caller id on calls received from the device. If you subsequently modify it in the dialplan then the caller id will be changed, and if an outgoing call is made then the caller id will not be the same as configured in sip.conf. If you don't modify the caller id in dialplan then it will be as configured in sip.conf.
Joshua Colp
Digium, Inc. | Senior Software Developer
jcolp
Oldsterisk
 
Posts: 248
Joined: Tue May 19, 2015 6:59 am

Re: sip.conf: callerid= and trustrpid=no

Postby _alx_ » Thu Dec 10, 2015 2:28 am

You have to set up your callerid right before you dial out from your line.
Also bare in mind that you must setup a valid callerid as your provider expects it to be or else he will overwrite the sent value and put the default number of your line.
_alx_
Oldsterisk
 
Posts: 57
Joined: Fri Oct 16, 2015 1:48 am

Re: sip.conf: callerid= and trustrpid=no

Postby vitaly » Thu Dec 10, 2015 5:41 am

jcolp wrote:Not exactly. That explicitly sets the caller id on calls received from the device. If you subsequently modify it in the dialplan then the caller id will be changed, and if an outgoing call is made then the caller id will not be the same as configured in sip.conf. If you don't modify the caller id in dialplan then it will be as configured in sip.conf.


Thank you, I am concerned with end users (end devices) somehow overriding the CID I set in sip.conf with their own values in order to spoof someone else's number. I am concerned because in the documentation it says that Asterisk will use the value of "callerid=" in sip.conf only if no other source is available.

So my concern is exactly this: if I set trustrpid=no and callerid="John Doe" <1111> in sip.conf in the user's section, will the sip user be able to somehow override those values with his/her own made up ones?
vitaly
Newsterisk
 
Posts: 5
Joined: Thu Oct 23, 2014 1:43 am

Re: sip.conf: callerid= and trustrpid=no

Postby vitaly » Thu Dec 10, 2015 5:44 am

_alx_ wrote:You have to set up your callerid right before you dial out from your line.


I use a common route for a number of users and I don't know how to match user calls based on their SIP username within the dialplan. All I know is matching based on CID (like in exten => 100/1111).

Giving each end user their own context (specifying it in sip.conf context= option) seems redundant.
vitaly
Newsterisk
 
Posts: 5
Joined: Thu Oct 23, 2014 1:43 am

Re: sip.conf: callerid= and trustrpid=no

Postby jcolp » Thu Dec 10, 2015 7:29 am

Setting the callerid value will override what the remote endpoint provides.
Joshua Colp
Digium, Inc. | Senior Software Developer
jcolp
Oldsterisk
 
Posts: 248
Joined: Tue May 19, 2015 6:59 am

Re: sip.conf: callerid= and trustrpid=no

Postby vitaly » Thu Dec 10, 2015 7:35 am

jcolp wrote:Setting the callerid value will override what the remote endpoint provides.

But what does this section in the docs mean then:

callerid = <string> : Caller ID information used when nothing else is available.


It is not very clear.
vitaly
Newsterisk
 
Posts: 5
Joined: Thu Oct 23, 2014 1:43 am

Re: sip.conf: callerid= and trustrpid=no

Postby _alx_ » Thu Dec 10, 2015 8:36 am

It means that if in your dialplan you haven't set up the callerid variable, asterisk will use the value that is found under the sip options of the originating extension.
This will override the callerid value that the endpoint sends.

The end user can pass the callerid that he wants if you don't setup the callerid variable in the conf files or the dialplan.

Related to the problem try this

exten => XXXX.,1,Noop(Outbound calling)
same => n,GotoIf($["${CALLERID(num)}" = "101"]:ex101)
same => n,GotoIf($["${CALLERID(num)}" = "102"]:ex102)
same => n,GotoIf($["${CALLERID(num)}" = "103"]:ex103)
same => n(ex101),Set(CALLERID(num)=7301234101)
same => n,Goto(dial)
same => n(ex102),Set(CALLERID(num)=7301234102)
same => n,Goto(dial)
same => n(ex103),Set(CALLERID(num)=7301234103)
same => n(dial),Dial(SIP/provider/${EXTEN})
same => n,Hangup

Instead of XXXX. put your preferred pattern.
_alx_
Oldsterisk
 
Posts: 57
Joined: Fri Oct 16, 2015 1:48 am


Return to Asterisk Support

Who is online

Users browsing this forum: No registered users and 1 guest