We have a many services in our company, each one must display a different number in his outgoing calls. We use a Asterisk SIP server.
Our SIP provider asks us to make our Asterisk server send a prefix before the outgoing number.
for exemple, for a normal call from the extension 1200, the SIP server send the number 0033123456789.
we want to make it adding a prefix for calls from each extension, for exemple :
add the prefix 400 before calls from the extension 1200 to send 40033123456789.
add the prefix 401 before calls from the extension 1201 to send 40133123456789.
... etc.
Can you help please ?
Many thanks.
Regards.
There might be several ways to achieve what you need, if calls from all extensions hit same context(context start with [some-context-name]), then you might achieve it in following way:
[some-context-name]
exten => _00X.,1,ExecIf($["${CALLERID(num)}" = "1200"]?Dial(SIP/mytrunk/400${EXTEN:2}))
exten => _00X.,1,ExecIf($["${CALLERID(num)}" = "1201"]?Dial(SIP/mytrunk/401${EXTEN:2}))
Additionally you might have separate context per extension or you might implement all of this inside AGI script.
Related
My system contain:
- Freeswitch server
- Sip Client: Web using sipjs , mobile react-native using https://github.com/datso/react-native-pjsip to receive call.
My problem is when call done i need to know the uuid of CDR recently add to Postgres DB of that call to attach some info to that call
I try many way but can not success ex: write http request to select into postgres DB, but can not find exactly which uuid because one extension can make many call one time.
Can anyone help me solve this case?
Mark each call with custom variable like callid
Send that to your app via any method, as sipheader, as sip message, using http post etc.
But you also can just search cdr by start date.
How do I get asterisk call Id (uniqueid in cdr table) (for instance, 1487150355.465) in sipml5 client.
As far as I looked, I see only
https://www.doubango.org/sipml5/docgen/symbols/SIPml.Session.html#getId
which has (afaic) no relation to asterisk id.
I know I can set additional headers in asterisk and set there call id, but it cannot be done for some organizational reasons.
Thanks.
Asterisk unique channel id(not call id) assigned to channel. By default asterisk not send that via sip or other protocol.
So no, you can't get it without do something on asterisk.
I need to make transfer from application in one asterisk to application on another asterisk and to pass some ID with it.
Can it be done ?
I am using asterisk 13
thanks in advance for any help
You have following options(i am assuming you are using sip)
1) Use SipAddHeader/SIP_HEADER function on other side.
http://www.voip-info.org/wiki/view/Asterisk+func+sip_header
2) Use callerid number prefix, callerid name or put it as part of DST number when calling.
3) Use jabber or SIPMessage
4) Use CURL function to fire http request/ARI or web server script on other side
I am trying to configure my asterisk to regsiter every user who tries to connect to it, and allow it to establish calls. I have read that I should set "allowguest = yes" in sip.conf.
What about the dialplan in extensions.conf ? What should I add so that all my users could make and recieve calls ? (this is my first questions).
I would go even more precise about the users : is it possible to allow only guests from one precise domain ? If yes please help find how to do it, I will be very thankful.
Guest calls will go to default context which is in general section of sip.conf
[general]
context=some_restricted_access
About dialplan for calls - you need read some book for beginner or install freepbx/other web which do dialplan for you.
No, you can't allow guests from domain. But you can try play with realm= setting or allow access from one ip by using ip-authentification.
I use asterisk in my project and users login with softphones. I want to grant a person to forward an incoming call to another user's sip account by clicking on a button and answer the call immediately so that the user will be able to start talking with caller.
You need read documentation for you softphones/hardphones. Usualy need add sip header Call-Info: answer-after=0.
So you plan can be
Check if auto-answer/intercom posible with your softphone or hardphone.
Create dialplan which will add header and call
Transfer call to that dialplan using AMI Transfer command
For more info check this:
http://icesupport.ingeniussoftware.com/customer/portal/articles/990030-asterisk-auto-answer-on-originate
http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+Transfer