Hi all! Such situation.
I have next structure. SIP Provider - Asterisk <-IAX2-> Asterisk - Abonent
And when I calling asterisk CALLERID presented callerid from caller. I need get callerid from provider. How Can I do it?
Hi all! Such situation.
I have next structure. SIP Provider - Asterisk <-IAX2-> Asterisk - Abonent
And when I calling asterisk CALLERID presented callerid from caller. I need get callerid from provider. How Can I do it?
Why are you setting caller ID? If you don’t need to set it, don’t. If you are setting it on the first system, you will need to capture the original ID and, probably, encode it into the number dialled over IAX.
Obviously because I need to. When a call is received from this number to an internal number. I need to do
<<
exten => 2972,1,GotoIf($[“${CALLERID(num)}” = “311727828”]?2:3)
exten => 2972,2,Dial(${EXTEN})
exten => 2972,3,Dial(${TRUNK1}555-555-555)
<<
Where 311727828 is provider callerID, not a caller people.
I would appreciate an example.
Nowhere does that code set the caller ID! Where are you changing the caller ID?
Is the real problem that the SIP provider is not actually sending you the caller ID, which you can’t solve, or is sending it, but not in the From: header, which you probably can solve, by having Asterisk use the proper caller ID.
Nowhere does that code set the caller ID! Where are you changing the caller ID?
Is the real problem that the SIP provider is not actually sending you the caller ID, which you can’t solve, or is sending it, but not in the From: header, which you probably can solve, by having Asterisk use the proper caller ID.
I recieved callerID provider in Sip_header
Is the real problem that the SIP provider is not actually sending you the caller ID
Really?
Executing [s@incoming-callcentric:3] NoOp(“SIP/callcentricB5-0000014c”, “sip:PROVIDERCALLERID@ss.callcentric.com”) in new stack
– Executing [s@incoming-callcentric:4] NoOp(“SIP/callcentricB5-0000014c”, “sip:MYCALLERID@ip;tag=m2X4y90er2gBc”) in new stack
by
exten => s,3,NoOP(${SIP_HEADER(TO)})
exten => s,4,NoOP(${SIP_HEADER(FROM)})
It sounds like you didn’t write the dialplan, in which case you really need to ask the person who did write it.
Without the actual dialplan, I have to assume that two different pieces of data are being displayed, but I don’t know what those pieces of data are.
It sounds like you didn’t write the dialplan, in which case you really need to ask the person who did write it.
Without the actual dialplan, I have to assume that two different pieces of data are being displayed, but I don’t know what those pieces of data are.
Bro, I wrote this dialplan.
From first asterisk, where accepted calls from providers.
I have two NoOp
exten => s,3,NoOP(${SIP_HEADER(TO)})
exten => s,4,NoOP(${SIP_HEADER(FROM)})
and I see provider callerID and callerid callers.
3 NoOp(“SIP/callcentricB5-0000014c”, “sip:PROVIDERCALLERID@ss.callcentric.com”) in new stack
4 NoOp(“SIP/callcentricB5-0000014c”, “sip:MYCALLERID@ip;tag=m2X4y90er2gBc”) in new stack
But I dont know how to sent Provider Caller ID from this SIp Header to next Asterisk connected by IAX2.
This is point why I created this question
Without the actual dialplan, I have to assume that two different pieces of data are being displayed, but I don’t know what those pieces of data are.
In SIP trunk for this connection I have some parameters, such as fromuser= and defaultuser=
Maybe I can use this? but how?
If a caller ID is being sent in the To header, that is a misuse of the To header.
To set the caller ID in the outgoing leg, you change it for the call, using Set(CALLERID(num)=…) where … is the string you actually want. If that string is present in the the To or From header above, you can use string functions, like CUT, to extract the user part, or you can use the regular expression operator.
To see how FreePBX does this for the more conventional case where To contains the original called number, rather than the caller ID, see:
- ;-------------------------------------------------------------------------------
- ; from-pstn-to-did:
- ;
- ; The context is designed for providers who send the DID in the TO: SIP header
- ; only. The format of this header is:
- ;
- ; To: <sip:2125551212@172.31.74.25>
- ;
- ; So the DID must be extracted between the sip: and the @, which this does
- ;
- [from-pstn-toheader]
- exten => _.,1,NoOp(Attempting to extract DID from SIP To header)
- exten => _.,n,gotoif($["${CHANNEL(channeltype)}"="SIP"]?SIP)
- exten => _.,n,gotoif($["${CHANNEL(channeltype)}"="PJSIP"]?PJSIP)
- exten => _.,n,NoOp(Unable to determine SIP channel type)
- exten => _.,n,goto(from-pstn,${EXTEN},1))
- exten => _.,n(SIP),Goto(from-pstn,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)
- exten => _.,n(PJSIP),Goto(from-pstn,${CUT(CUT(PJSIP_HEADER(read,To),@,1),:,2)},1)
- ;-------------------------------------------------------------------------------
-
- ;-------------------------------------------------------------------------------
I have reservations about a missing ${} on one of the CUTs, but I presume it works, as it is in their code.
The callerID values sent to you in the from and to headers of the SIP message, will be saved in the asterisk channel, and if not changed, usually used by the Dial application, on outbound calls.
As such, the only thing you should need to do, is call Dial. No need to change the caller ID at all.
It is possible you’ve setup your IAX trunk with a callerID that overrides the original, in that case you should remove this caller ID from the iax config file.
If a caller ID is being sent in the To header, that is a misuse of the To header.
This is not my point, this is callcentric.
To set the caller ID in the outgoing leg, you change it for the call, using Set(CALLERID(num)=…) where … is the string you actually want. If that string is present in the the To or From header above, you can use string functions, like CUT, to extract the user part, or you can use the regular expression operator.
Why should I do set callerid on the first server if this whole task is needed for one of the hundreds of subscribers on the second server? What you propose will affect all all subscribers. In my opinion, you do not understand the meaning of the question.
The callerID values sent to you in the from and to headers of the SIP message, will be saved in the asterisk channel, and if not changed, usually used by the Dial application, on outbound calls.
As such, the only thing you should need to do, is call Dial. No need to change the caller ID at all.
It is possible you’ve setup your IAX trunk with a callerID that overrides the original, in that case you should remove this caller ID from the iax config file.
Facepalm
I think there’s a misunderstanding of terms here. I think by “provider callerid” they mean the DID that was called for the incoming call.
You seem to be expecting us to read your mind. You might want to note that chano’s reply makes the same assumption I did in my original reply, namely that you have changed the caller ID yourself. That should indicate to you you are failing to explain your unusual system adequately.
I think there’s a misunderstanding of terms here. I think by “provider callerid” they mean the DID that was called for the incoming call.
In the description of the question, below the title, I described what I mean. People just don’t want to read the description.
I read the description and still am uncertain. That’s 3 people who don’t really understand what you mean.
I think there’s a misunderstanding of terms here. I think by “provider callerid” they mean the DID that was called for the incoming call.
I was wondering that. That’s partly why I gave the FreePBX example and certainly why I bolded called number.
I read the description and still am uncertain. That’s 3 people who don’t really understand what you mean.
You seem to be expecting us to read your mind. You might want to note that chano’s reply makes the same assumption I did in my original reply, namely that you have changed the caller ID yourself. That should indicate to you you are failing to explain your unusual system adequately.
It seems that the Western education system is really in crisis.
Okay, I’ll walk away from this thread then. Other people may respond or not.