Problem with hanging up, and changing outgoing number

Hi everyone

Im pretty new to Asterisk, but i got it working but im having some problems, that i hope you guys can help me with.

  1. Im trying to get so when callerA rings in, it should ring to NUM1 and NUM2, and who ever picks it up first, the other one should stop rining.
    I got that part going, but the problem is, if NUM1 is allready in a call, when this is happening, it dosnt try to ring to NUM2, it just goes on and hangs up, is there a solution to this?
  1. In the same script, i want callerAs number to show on my phone, and not my SIP number.
    But this is not working either, am i missing something?

[code]exten => 1234,n,Set(CALLERID(all)=“test” <12345678>)

also tried


sip.conf, [general]

trustrpid=yes sendrpid=yes (tried pia)

Thanks in advance.

  1. Should not happen that way. Detailed logging required.

  2. Your dialplan lines are correct for setting the number to be displayed at the called phone, but one would need to see the full dialplan and possibly detailed logging.

This is my dialplan, will provide logging soon

exten => 1234,1,Answer()
exten => 1234,2,Set(FILENAME=${EPOCH}-${CALLERID(number)}-${EXTEN})
exten => 1234,3,Monitor(wav,${FILENAME})
exten => 1234,4,Background(hello-world)
exten => 1234,5,Set(CALLERID(all)="test" <12345678>)
exten => 1234,6,Dial(SIP/NUM1&SIP/NUM2,60,r)
exten => 1234,7,HangUp()

ofcause, when i try to trigger the #1 problem now, it works.

And for the debug of #2, im not sure i get the correct debug messages, but all i got is:

-- Executing [XXXXXXX@incoming-calls:4] Set("SIP/XXXXXXXX-00000004", "CALLERID(num)=1234") in new stack

Is there an option in sip.conf i need?

fromuser=XXXXXXX (my phonenumber)

You need to change ITSP’s. They are blocking the easiest way of sending caller ID, by requiring you to use fromuser. RPID and PAI support is relatively rare, so they probably don’t support that.

In any case, if you are going through an ITSP, and they are not primarily selling to spammers, you will need to prove to them that you own every number that you use as caller ID.

Also, you have the usual mix of deprecated options and bad practice that results from using a canned configuration.

I would try this:

exten => 1234,1,Answer()
exten => 1234,2,Set(FILENAME=${EPOCH}-${CALLERID(number)}-${EXTEN})
exten => 1234,3,Monitor(wav,${FILENAME})
exten => 1234,6,Dial(SIP/NUM1&SIP/NUM2,60,r)
exten => 1234,7,HangUp()

Still not perfect, but I think it should work better than before.