Presentation of expansion in asteriks

Hello,
I want to ask what extension I need to add to the phone number profile when phone 1234 tries to ring on an outside phone 4567 to delete zero from and phone not to be presented with 0457 and a code 1461

I need an extension that removes 0 and adds the country code
10x

I don’t recognize the terms “phone number profile”, which may mean you want instructions for some GUI, for which you will have to ask the people that support that GUI.

For pure Asterisk there are many examples of stripping digits in the documentation: https://github.com/asterisk/asterisk/blob/master/configs/samples/extensions.conf.sample

Adding digits is trivial; just place them before or after the stripped extension number, as needed.

1 Like

in addition, how can I save .picap ор .wav

I want to write a number 203

sip.conf

exten => 203,1,Set(CALLERID(num)=0${CALLERID(num)})<-><------>; TEST 1
exten => 203,2,GotoIf($[${CALLINGTON}=17]?3:4)
exten => 203,3,Set(CALLERID(num)=0${CALLERID(num)})<-><------>; Normalize CLI
exten => 203,4,SET(fname=${STRFTIME(${EPOCH},,%Y%m%d_%H%M%S)}_X_${EXTEN}_${CALLERID(num)})
exten => 203,5,MixMonitor(/user/AsteriskCDR/${fname}.pcap,b)
exten => 203,6,Goto(1,1)

is this combination for recording a conversation correct?

You can’t record or MixMonitor to a .pcap. You would need to use .wav if you want it to be a wav.

If I want to be .pcap ?

There is no support in Asterisk for .pcap files.

well, a script correctly written for .wav? and is it right in the sip.con?

As mentioned if you want to record to a .wav then you’d specify a file that ends in .wav - but I’m not sure what exactly you are asking about.

As for sip.conf you haven’t provided that file so noone can comment.

exten => 203,1,Set(CALLERID(num)=0${CALLERID(num)})<-><------>; TEST 1
exten => 203,2,GotoIf($[${CALLINGTON}=17]?3:4)
exten => 203,3,Set(CALLERID(num)=0${CALLERID(num)})<-><------>; Normalize CLI
exten => 203,4,SET(fname=${STRFTIME(${EPOCH},,%Y%m%d_%H%M%S)}_X_${EXTEN}_${CALLERID(num)})
exten => 203,5,MixMonitor(/user/AsteriskCDR/${fname}.wav,b)
exten => 203,6,Goto(1,1)

do I want to write the number 203, I have chosen the correct code and I have put the code in the right file the file I put in the code to write number 203 is sip.conf

The file you appear to have supplied is extensions.conf, not sip.conf.

What is at extension 1?

so I’m asking you if the code is properly written to record .wav
in a directory /user/AsteriskCDR

now I put it in extensions.conf but he does not want to record again

extension 1 I do not know what he is doing right.

if this code is erroneously written to record the number, I would be grateful if you can provide me with a working one.

We need to see a more complete dialplan, including extension 1, and also the verbose level 5 log that results when it is run.

The code should record the traffic to 203, if that code is run, extension 1 exists, and extension one does not exit immediately. Extension one needs to do something useful for the recording to be useful.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.