[Resolved]Same Extension Number for Hardphone & Softphon

Hi ,

I have asterisk server configured & working fine. I was planning to provide softphone for all users with same extension number as their hardphone for remote support. The softphone is also working fine. But, as soon the softphone got registered, the hardphone is getting unregistered and calls are not working.

Is it possible to FIX? Is there a solution for this? Please suggest.

Thanks
Sekhar.

set up two entries in sip.conf, ie 810 and 8101.

then Dial(SIP/810&SIP/8101)

sadly asterisk does not currently support two devices registered to the same entry…

Or

PAUL=SIP/810&SIP/8101

Dial(${PAUL})

Hi ,

Thanks for the suggestion.

Mostly softphones will be used after office hours. So, how about a dialy scheduled (auto) restart of asterisk service on everyday early morning? does this solve the problem? i dont know how to do that though. I see if i restart my cisco phone it is back to working condition.

Having another extension is a a problem in my case.

Thanks
Sekhar.

remember, a sip.conf entry is NOT an extension. It is a channel. An extension is defined in extensions.conf and is something you dial. It sends the call to one or more channels, which is where the call goes.

If you are worried about messing up a mass extension macro, you can do something like this-

exten => _XXXX,1,Dial(SIP/${EXTEN}&SIP/${EXTEN}1,20)

as part of your existing extension macro. that will always dial the sip exten and (the exten with one on the end), ie if you dial 810, it will call SIP/810 and SIP/8101. Then if people want to work from home just add the XXXX1 sip.conf entry for them. If it doesn’t exist asterisk will put an error on CLI but it will be otherwise ignored. Use GotoIfTime or something to only send calls to the other exten during off work hours if you want.

Hi IronHelix,

As always, THANKS for your suggestion & help.

I used your script for adding numeric value to extension & it worked in this case. As my extensions are already 4 digits, i dont want to add 1 at the end and make it 5 digit.

[extensions]
exten => _61XX,1,Answer
exten => _61XX,2,SetMusicOnHold(default)
exten => _61XX,3,Dial(SIP/${EXTEN}&SIP/$[${EXTEN}+1000],20)
exten => _61XX,4,Voicemail(u${EXTEN})
exten => _61XX,5,Hangup

See below log:

-- Executing Answer("SIP/2190-08344658", "") in new stack
-- Executing SetMusicOnHold("SIP/2190-08344658", "default") in new stack
-- Executing Dial("SIP/2190-08344658", "SIP/6138&SIP/7138|20") in new stack
-- Called 6138
-- Called 7138
-- SIP/7138-0834fd30 is ringing
-- Nobody picked up in 20000 ms
-- Executing VoiceMail("SIP/2190-08344658", "u6138") in new stack
-- Playing 'vm-theperson' (language 'en')
-- Playing 'digits/6' (language 'en')
-- Playing 'digits/1' (language 'en')
-- Playing 'digits/3' (language 'en')
-- Playing 'digits/8' (language 'en')
-- Playing 'vm-isunavail' (language 'en')
-- Playing 'vm-intro' (language 'en')
-- Playing 'beep' (language 'en')
-- Recording the message
-- x=0, open writing:  /var/spool/asterisk/voicemail/default/6138/tmp/K0KvkL format: wav49, 0x83380d8
-- x=1, open writing:  /var/spool/asterisk/voicemail/default/6138/tmp/K0KvkL format: gsm, 0x833b188
-- x=2, open writing:  /var/spool/asterisk/voicemail/default/6138/tmp/K0KvkL format: wav, 0x8340ad0
-- User hung up

== Spawn extension (internal, 6138, 4) exited non-zero on ‘SIP/2190-08344658’

I am not sure why i am getting “Spawn extension (internal, 6138, 4) exited non-zero on ‘SIP/2190-08344658’” error. (is this an error?)

I will try the macro modification and GotoIfTime tomorrow. Only problem is, i need to create 2 SIP accounts for each employee now :smile:

thanks
Sekhar.

no spawn extension thing is normal, that just means that something was hung up.

Hi IronHelix,

the macro is a problem. I have below version. I am sure i messed something here. Please correct the syntax error if any.

[macro-ext]
exten => s,1,Answer
exten => s,2,SetMusicOnHold(default)
exten => s,3,Dial(${ARG1}&SIP/$[${ARG1:4}+1000],10)
exten => s,4,Voicemail(u${ARG2})
exten => s,5,Hangup

[extensions]
;User Extensions
exten => _61XX,1,Macro(ext,SIP/${EXTEN},${EXTEN})

thanks
sekhar.

i thought you just said it was working?

if it isnt working now, also post the CLI output and i’ll have a look…

Hi IronHelix,

Sorry for the confusion, It is working with below script. I wanted to have macro implemented for the same. I failed to do so.

Working Configuration:
[extensions]
exten => _61XX,1,Answer
exten => _61XX,2,SetMusicOnHold(default)
exten => _61XX,3,Dial(SIP/${EXTEN}&SIP/$[${EXTEN}+1000],20)
exten => _61XX,4,Voicemail(u${EXTEN})
exten => _61XX,5,Hangup

NOT Working Configuration:
[macro-ext]
exten => s,1,Answer
exten => s,2,SetMusicOnHold(default)
exten => s,3,Dial(SIP/${ARG1}&SIP/$[${ARG1:4}+1000],10)
exten => s,4,Voicemail(u${ARG2})
exten => s,5,Hangup

[extensions]
;User Extensions
exten => _61XX,1,Macro(ext,SIP/${EXTEN},${EXTEN})

Debug Out for NOT working setup:

-- Executing Macro("SIP/2190-08827648", "ext|SIP/6138|6138") in new stack
-- Executing Answer("SIP/2190-08827648", "") in new stack
-- Executing SetMusicOnHold("SIP/2190-08827648", "default") in new stack
-- Executing Dial("SIP/2190-08827648", "SIP/SIP/6138&SIP/7138|10") in new stack

Sep 19 09:42:03 WARNING[4256]: chan_sip.c:1989 create_addr: No such host: SIP
Sep 19 09:42:03 NOTICE[4256]: app_dial.c:1056 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 3 - No route to destination)
Sep 19 09:42:03 NOTICE[4256]: app_dial.c:1056 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 3 - No route to destination)
== Everyone is busy/congested at this time (2:0/0/2)
– Executing VoiceMail(“SIP/2190-08827648”, “u6138”) in new stack

I dont want to trouble you too much in this. If passing parameters to macro with requested setup is not possible please let me know. i can live with the working setup.

thanks
sekhar.

without stepping on iron’s toes, i’m wondering why you wouldn’t just use[code]
[macro-ext]
exten => s,1,Answer
exten => s,2,SetMusicOnHold(default)
exten => s,3,Dial(SIP/${ARG1}&SIP/1${ARG1},10)
exten => s,4,Voicemail(u${ARG1})
exten => s,5,Hangup

[extensions]
;User Extensions
exten => _61XX,1,Macro(ext,${EXTEN})[/code]

no worries.

The problem is he has a large number of 4 digit extensions and has them mapped out in such a way that like 2xxx are real, 3xxx are their rollovers, 4xxx are real with 5xxx rollovers, or something like that.

The problem has to do with the contents of ${ARG1}

In the working version, ${EXTEN} contains the 4 digit number to perform the addition to. This is fine.

When the macro is called, ${ARG1} contains ‘SIP/xxxx’ (xxxx being ${EXTEN}.

Thus,
exten => s,3,Dial(SIP/${ARG1}&SIP/$[${ARG1:4}+1000],10)
is wrong…

it depends on where the SIP/ gets thrown in.
If ${ARG1} contains SIP/xxxx then you don’t need to add SIP/ again in the macro, but you DO need to strip it (and thus re add it) like this

exten => _61XX,1,Macro(ext,SIP/${EXTEN},${EXTEN})
goes to (in macro)
exten => s,3,Dial(${ARG1}&SIP/$[${ARG1:4}+1000],10)

or if ${ARG1} just contains the ${EXTEN} (no SIP/) then you have to add it yourself in the macro

exten => _61XX,1,Macro(ext,${EXTEN},${EXTEN})
goes to (in macro)
exten => s,3,Dial(SIP/${ARG1}&SIP/$[${ARG1}+1000],10)

Hope that helps!

iron,

sorry, i wasn’t confused about the process, just thinking that we don’t seem to know the actual scale of the entension range, and looking at the 61XX used, i wonder if we’re talking < 100 extensions here.

ignore me, it’s late !

Hi baconbutte,

Thanks for the help. MACRO is working fine now.

[macro-ext]
exten => s,1,Answer
exten => s,2,SetMusicOnHold(default)
exten => s,3,Dial(SIP/${ARG1}&SIP/$[${ARG1}+1000],10)
exten => s,4,Voicemail(u${ARG2})
exten => s,5,Hangup

[extensions]
;User Extensions
exten => _61XX,1,Macro(ext,${EXTEN},${EXTEN})
exten => _62XX,1,Macro(ext,${EXTEN},${EXTEN})

Acutally i have 400 DID Numbers. I have 4 digit extensions, so i dont wanted to have 1 added either side of the extension. Instead, i added 1000 to maintain 4 digits.

Youre reply did helped & solved my problem.

IronHelix is my GURU in this forum. He helped me in the entire implementation. I am almost ready to go live. Just waiting for my new TE212P card & Dell 2950. I am trying all possible options before i go live. so, that i will be confident to manage the system. This forum is great place to learn Asterisk. 4 months ago, i dont even know how to install LINUX. Today i am confident that i can manage a small office PBX.

Thanks for both of you.

glad to help! :smiley:

thanks.