SIP Outbound telephony


#1

I’ve got a problem with dialout to a pstn-phonenumber. My sip outbound provider require an e.164 userpart e.g. +49301234567 to dialout. It isn’t possible to dial 0301234567 or 0049301234567. How could I replace automatically in asterisk config the numbers with e.g. +49

extensions.conf:
exten => _.,1,Dial(SIP/${EXTEN}@123.123.123.123)

if a sip client dial +49301234567 everything is ok
if a sip client dial 0049301234567 replace 00 with +
if a sip client dial 0301234567 replace 0 with +49

please help :smile:

best regards,

abarta


#2

[quote=“Abarta”]extensions.conf:
exten => _.,1,Dial(SIP/${EXTEN}@123.123.123.123)

if a sip client dial +49301234567 everything is ok
if a sip client dial 0049301234567 replace 00 with +[/quote]
exten => _0049.,1,Dial(SIP/+${EXTEN:2}@123.123.123.123)

exten => _03.,1,Dial(SIP/+49${EXTEN:1}@123.123.123.123)

BUT

Instead of your first one

exten => _.,1,Dial(SIP/${EXTEN}@123.123.123.123)

you must use

exten => _+.,1,Dial(SIP/${EXTEN}@123.123.123.123)

otherwise it will match everything and it will never get to the others!